Remove the now unused tooltip widget.
This commit is contained in:
parent
b677d0ac1f
commit
c61bea3404
9 changed files with 0 additions and 271 deletions
|
@ -1,62 +0,0 @@
|
||||||
#textdomain wesnoth-lib
|
|
||||||
###
|
|
||||||
### Definition of a tooltip.
|
|
||||||
###
|
|
||||||
|
|
||||||
|
|
||||||
#define _GUI_RESOLUTION RESOLUTION MAX_WIDTH BORDER FONT_SIZE
|
|
||||||
[resolution]
|
|
||||||
min_width = 0
|
|
||||||
min_height = 0
|
|
||||||
|
|
||||||
default_width = 0
|
|
||||||
default_height = 0
|
|
||||||
|
|
||||||
max_width = {MAX_WIDTH}
|
|
||||||
max_height = 0
|
|
||||||
|
|
||||||
text_font_size = {FONT_SIZE}
|
|
||||||
text_extra_width = {BORDER}
|
|
||||||
text_extra_height = {BORDER}
|
|
||||||
|
|
||||||
[state_enabled]
|
|
||||||
|
|
||||||
[draw]
|
|
||||||
|
|
||||||
[rectangle]
|
|
||||||
x = 0
|
|
||||||
y = 0
|
|
||||||
w = "(width)"
|
|
||||||
h = "(height)"
|
|
||||||
border_thickness = 0
|
|
||||||
fill_color = "0, 0, 0, 187"
|
|
||||||
[/rectangle]
|
|
||||||
|
|
||||||
[text]
|
|
||||||
x = "((width-text_width)/2)"
|
|
||||||
y = "((height-text_height)/2)"
|
|
||||||
w = "(text_width)"
|
|
||||||
h = "(text_height)"
|
|
||||||
font_size = {FONT_SIZE}
|
|
||||||
color = {GUI__FONT_COLOR_ENABLED__DEFAULT}
|
|
||||||
text = "(text)"
|
|
||||||
[/text]
|
|
||||||
|
|
||||||
[/draw]
|
|
||||||
|
|
||||||
[/state_enabled]
|
|
||||||
|
|
||||||
[/resolution]
|
|
||||||
#enddef
|
|
||||||
|
|
||||||
[tooltip_definition]
|
|
||||||
id = "default"
|
|
||||||
description = "small help tooltip"
|
|
||||||
|
|
||||||
# Tiny gui sizes haven't been tested yet so might need some tuning.
|
|
||||||
{_GUI_RESOLUTION ({GUI_TINY__RESOLUTION}) 0 4 ({GUI_TINY__FONT_SIZE__LARGE}) }
|
|
||||||
{_GUI_RESOLUTION () 0 10 ({GUI_NORMAL__FONT_SIZE__LARGE}) }
|
|
||||||
|
|
||||||
[/tooltip_definition]
|
|
||||||
|
|
||||||
#undef _GUI_RESOLUTION
|
|
|
@ -30,7 +30,6 @@ src/gui/auxiliary/widget_definition/stacked_widget.cpp
|
||||||
src/gui/auxiliary/widget_definition/text_box.cpp
|
src/gui/auxiliary/widget_definition/text_box.cpp
|
||||||
src/gui/auxiliary/widget_definition/toggle_button.cpp
|
src/gui/auxiliary/widget_definition/toggle_button.cpp
|
||||||
src/gui/auxiliary/widget_definition/toggle_panel.cpp
|
src/gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||||
src/gui/auxiliary/widget_definition/tooltip.cpp
|
|
||||||
src/gui/auxiliary/widget_definition/tree_view.cpp
|
src/gui/auxiliary/widget_definition/tree_view.cpp
|
||||||
src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
src/gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||||
src/gui/auxiliary/widget_definition/window.cpp
|
src/gui/auxiliary/widget_definition/window.cpp
|
||||||
|
@ -120,7 +119,6 @@ src/gui/widgets/text_box.cpp
|
||||||
src/gui/widgets/text.cpp
|
src/gui/widgets/text.cpp
|
||||||
src/gui/widgets/toggle_button.cpp
|
src/gui/widgets/toggle_button.cpp
|
||||||
src/gui/widgets/toggle_panel.cpp
|
src/gui/widgets/toggle_panel.cpp
|
||||||
src/gui/widgets/tooltip.cpp
|
|
||||||
src/gui/widgets/tree_view.cpp
|
src/gui/widgets/tree_view.cpp
|
||||||
src/gui/widgets/tree_view_node.cpp
|
src/gui/widgets/tree_view_node.cpp
|
||||||
src/gui/widgets/vertical_scrollbar.cpp
|
src/gui/widgets/vertical_scrollbar.cpp
|
||||||
|
|
|
@ -374,7 +374,6 @@ set(wesnoth-main_SRC
|
||||||
gui/auxiliary/widget_definition/text_box.cpp
|
gui/auxiliary/widget_definition/text_box.cpp
|
||||||
gui/auxiliary/widget_definition/toggle_button.cpp
|
gui/auxiliary/widget_definition/toggle_button.cpp
|
||||||
gui/auxiliary/widget_definition/toggle_panel.cpp
|
gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||||
gui/auxiliary/widget_definition/tooltip.cpp
|
|
||||||
gui/auxiliary/widget_definition/tree_view.cpp
|
gui/auxiliary/widget_definition/tree_view.cpp
|
||||||
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
gui/auxiliary/widget_definition/vertical_scrollbar.cpp
|
||||||
gui/auxiliary/widget_definition/window.cpp
|
gui/auxiliary/widget_definition/window.cpp
|
||||||
|
@ -468,7 +467,6 @@ set(wesnoth-main_SRC
|
||||||
gui/widgets/text_box.cpp
|
gui/widgets/text_box.cpp
|
||||||
gui/widgets/toggle_button.cpp
|
gui/widgets/toggle_button.cpp
|
||||||
gui/widgets/toggle_panel.cpp
|
gui/widgets/toggle_panel.cpp
|
||||||
gui/widgets/tooltip.cpp
|
|
||||||
gui/widgets/tree_view.cpp
|
gui/widgets/tree_view.cpp
|
||||||
gui/widgets/tree_view_node.cpp
|
gui/widgets/tree_view_node.cpp
|
||||||
gui/widgets/vertical_scrollbar.cpp
|
gui/widgets/vertical_scrollbar.cpp
|
||||||
|
|
|
@ -314,7 +314,6 @@ wesnoth_sources = Split("""
|
||||||
gui/auxiliary/widget_definition/text_box.cpp
|
gui/auxiliary/widget_definition/text_box.cpp
|
||||||
gui/auxiliary/widget_definition/toggle_button.cpp
|
gui/auxiliary/widget_definition/toggle_button.cpp
|
||||||
gui/auxiliary/widget_definition/toggle_panel.cpp
|
gui/auxiliary/widget_definition/toggle_panel.cpp
|
||||||
gui/auxiliary/widget_definition/tooltip.cpp
|
|
||||||
gui/auxiliary/widget_definition/tree_view.cpp
|
gui/auxiliary/widget_definition/tree_view.cpp
|
||||||
gui/auxiliary/widget_definition/window.cpp
|
gui/auxiliary/widget_definition/window.cpp
|
||||||
gui/auxiliary/window_builder/button.cpp
|
gui/auxiliary/window_builder/button.cpp
|
||||||
|
@ -406,7 +405,6 @@ wesnoth_sources = Split("""
|
||||||
gui/widgets/text_box.cpp
|
gui/widgets/text_box.cpp
|
||||||
gui/widgets/toggle_button.cpp
|
gui/widgets/toggle_button.cpp
|
||||||
gui/widgets/toggle_panel.cpp
|
gui/widgets/toggle_panel.cpp
|
||||||
gui/widgets/tooltip.cpp
|
|
||||||
gui/widgets/tree_view.cpp
|
gui/widgets/tree_view.cpp
|
||||||
gui/widgets/tree_view_node.cpp
|
gui/widgets/tree_view_node.cpp
|
||||||
gui/widgets/vertical_scrollbar.cpp
|
gui/widgets/vertical_scrollbar.cpp
|
||||||
|
|
|
@ -1,50 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
/*
|
|
||||||
Copyright (C) 2007 - 2011 by Mark de Wever <koraq@xs4all.nl>
|
|
||||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY.
|
|
||||||
|
|
||||||
See the COPYING file for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
|
||||||
|
|
||||||
#include "gui/auxiliary/widget_definition/tooltip.hpp"
|
|
||||||
|
|
||||||
#include "gui/auxiliary/log.hpp"
|
|
||||||
|
|
||||||
namespace gui2 {
|
|
||||||
|
|
||||||
ttooltip_definition::ttooltip_definition(const config& cfg)
|
|
||||||
: tcontrol_definition(cfg)
|
|
||||||
{
|
|
||||||
DBG_GUI_P << "Parsing tooltip " << id << '\n';
|
|
||||||
|
|
||||||
load_resolutions<tresolution>(cfg);
|
|
||||||
}
|
|
||||||
|
|
||||||
ttooltip_definition::tresolution::tresolution(const config& cfg)
|
|
||||||
: tresolution_definition_(cfg)
|
|
||||||
{
|
|
||||||
/*WIKI
|
|
||||||
* @page = GUIWidgetDefinitionWML
|
|
||||||
* @order = 1_tooltip
|
|
||||||
*
|
|
||||||
* == Tooltip ==
|
|
||||||
*
|
|
||||||
* The definition of a tooltip.
|
|
||||||
*
|
|
||||||
* The following states exist:
|
|
||||||
* * state_enabled, the tooltip has only one state, it's either shown or hidden.
|
|
||||||
*/
|
|
||||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace gui2
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
/*
|
|
||||||
Copyright (C) 2007 - 2011 by Mark de Wever <koraq@xs4all.nl>
|
|
||||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY.
|
|
||||||
|
|
||||||
See the COPYING file for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GUI_AUXILIARY_WIDGET_DEFINITION_TOOLTIP_HPP_INCLUDED
|
|
||||||
#define GUI_AUXILIARY_WIDGET_DEFINITION_TOOLTIP_HPP_INCLUDED
|
|
||||||
|
|
||||||
#include "gui/auxiliary/widget_definition.hpp"
|
|
||||||
|
|
||||||
namespace gui2 {
|
|
||||||
|
|
||||||
struct ttooltip_definition
|
|
||||||
: public tcontrol_definition
|
|
||||||
{
|
|
||||||
explicit ttooltip_definition(const config& cfg);
|
|
||||||
|
|
||||||
struct tresolution
|
|
||||||
: public tresolution_definition_
|
|
||||||
{
|
|
||||||
explicit tresolution(const config& cfg);
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace gui2
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
|
@ -1,55 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
/*
|
|
||||||
Copyright (C) 2008 - 2011 by Mark de Wever <koraq@xs4all.nl>
|
|
||||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY.
|
|
||||||
|
|
||||||
See the COPYING file for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
|
||||||
|
|
||||||
#include "gui/widgets/tooltip.hpp"
|
|
||||||
|
|
||||||
#include "gui/auxiliary/widget_definition/tooltip.hpp"
|
|
||||||
#include "gui/auxiliary/window_builder/control.hpp"
|
|
||||||
#include "gui/widgets/settings.hpp"
|
|
||||||
|
|
||||||
#include <boost/bind.hpp>
|
|
||||||
|
|
||||||
namespace gui2 {
|
|
||||||
|
|
||||||
namespace implementation {
|
|
||||||
|
|
||||||
/** @todo See whether this hack can be removed. */
|
|
||||||
// Needed to fix a compiler error in REGISTER_WIDGET.
|
|
||||||
class tbuilder_tooltip
|
|
||||||
: public tbuilder_control
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
tbuilder_tooltip(const config& cfg)
|
|
||||||
: tbuilder_control(cfg)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
twidget* build() const { return NULL; }
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace implementation
|
|
||||||
|
|
||||||
REGISTER_WIDGET(tooltip)
|
|
||||||
|
|
||||||
const std::string& ttooltip::get_control_type() const
|
|
||||||
{
|
|
||||||
static const std::string type = "tooltip";
|
|
||||||
return type;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace gui2
|
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
/* $Id$ */
|
|
||||||
/*
|
|
||||||
Copyright (C) 2008 - 2011 by Mark de Wever <koraq@xs4all.nl>
|
|
||||||
Part of the Battle for Wesnoth Project http://www.wesnoth.org/
|
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
|
||||||
it under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation; either version 2 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
This program is distributed in the hope that it will be useful,
|
|
||||||
but WITHOUT ANY WARRANTY.
|
|
||||||
|
|
||||||
See the COPYING file for more details.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef GUI_WIDGETS_TOOLTIP_HPP_INCLUDED
|
|
||||||
#define GUI_WIDGETS_TOOLTIP_HPP_INCLUDED
|
|
||||||
|
|
||||||
#include "gui/widgets/control.hpp"
|
|
||||||
|
|
||||||
namespace gui2 {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A tooltip shows a 'floating' message.
|
|
||||||
*
|
|
||||||
* This is a small class which only has one state and that's active, so the
|
|
||||||
* functions implemented are mostly dummies.
|
|
||||||
*
|
|
||||||
* @todo Allow wrapping for the tooltip.
|
|
||||||
*/
|
|
||||||
class ttooltip : public tcontrol
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
ttooltip() :
|
|
||||||
tcontrol(1)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Inherited from tcontrol. */
|
|
||||||
void set_active(const bool) {}
|
|
||||||
|
|
||||||
/** Inherited from tcontrol. */
|
|
||||||
bool get_active() const { return true; }
|
|
||||||
|
|
||||||
/** Inherited from tcontrol. */
|
|
||||||
unsigned get_state() const { return 0; }
|
|
||||||
|
|
||||||
/** Inherited from tcontrol. */
|
|
||||||
bool disable_click_dismiss() const { return false; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
/** Inherited from tcontrol. */
|
|
||||||
const std::string& get_control_type() const;
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace gui2
|
|
||||||
|
|
||||||
#endif
|
|
|
@ -26,7 +26,6 @@
|
||||||
#include "gui/auxiliary/formula.hpp"
|
#include "gui/auxiliary/formula.hpp"
|
||||||
#include "gui/widgets/helper.hpp"
|
#include "gui/widgets/helper.hpp"
|
||||||
#include "gui/widgets/panel.hpp"
|
#include "gui/widgets/panel.hpp"
|
||||||
#include "gui/widgets/tooltip.hpp"
|
|
||||||
|
|
||||||
#include "events.hpp"
|
#include "events.hpp"
|
||||||
#include "SDL.h"
|
#include "SDL.h"
|
||||||
|
|
Loading…
Add table
Reference in a new issue