diff --git a/data/gui/default/widget/tooltip_default.cfg b/data/gui/default/widget/tooltip_default.cfg deleted file mode 100644 index 0c5c75b1109..00000000000 --- a/data/gui/default/widget/tooltip_default.cfg +++ /dev/null @@ -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 diff --git a/po/wesnoth-lib/POTFILES.in b/po/wesnoth-lib/POTFILES.in index d85eaff611a..432cf09913f 100644 --- a/po/wesnoth-lib/POTFILES.in +++ b/po/wesnoth-lib/POTFILES.in @@ -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/toggle_button.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/vertical_scrollbar.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/toggle_button.cpp src/gui/widgets/toggle_panel.cpp -src/gui/widgets/tooltip.cpp src/gui/widgets/tree_view.cpp src/gui/widgets/tree_view_node.cpp src/gui/widgets/vertical_scrollbar.cpp diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f88c559f44f..31d891c21b3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -374,7 +374,6 @@ set(wesnoth-main_SRC gui/auxiliary/widget_definition/text_box.cpp gui/auxiliary/widget_definition/toggle_button.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/vertical_scrollbar.cpp gui/auxiliary/widget_definition/window.cpp @@ -468,7 +467,6 @@ set(wesnoth-main_SRC gui/widgets/text_box.cpp gui/widgets/toggle_button.cpp gui/widgets/toggle_panel.cpp - gui/widgets/tooltip.cpp gui/widgets/tree_view.cpp gui/widgets/tree_view_node.cpp gui/widgets/vertical_scrollbar.cpp diff --git a/src/SConscript b/src/SConscript index 7fce88690cf..d80639ed43d 100644 --- a/src/SConscript +++ b/src/SConscript @@ -314,7 +314,6 @@ wesnoth_sources = Split(""" gui/auxiliary/widget_definition/text_box.cpp gui/auxiliary/widget_definition/toggle_button.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/window.cpp gui/auxiliary/window_builder/button.cpp @@ -406,7 +405,6 @@ wesnoth_sources = Split(""" gui/widgets/text_box.cpp gui/widgets/toggle_button.cpp gui/widgets/toggle_panel.cpp - gui/widgets/tooltip.cpp gui/widgets/tree_view.cpp gui/widgets/tree_view_node.cpp gui/widgets/vertical_scrollbar.cpp diff --git a/src/gui/auxiliary/widget_definition/tooltip.cpp b/src/gui/auxiliary/widget_definition/tooltip.cpp deleted file mode 100644 index 9e0a86fa39b..00000000000 --- a/src/gui/auxiliary/widget_definition/tooltip.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* $Id$ */ -/* - Copyright (C) 2007 - 2011 by Mark de Wever - 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(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 - diff --git a/src/gui/auxiliary/widget_definition/tooltip.hpp b/src/gui/auxiliary/widget_definition/tooltip.hpp deleted file mode 100644 index 24cd3d31d5e..00000000000 --- a/src/gui/auxiliary/widget_definition/tooltip.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* $Id$ */ -/* - Copyright (C) 2007 - 2011 by Mark de Wever - 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 - diff --git a/src/gui/widgets/tooltip.cpp b/src/gui/widgets/tooltip.cpp deleted file mode 100644 index cbc226ed390..00000000000 --- a/src/gui/widgets/tooltip.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* $Id$ */ -/* - Copyright (C) 2008 - 2011 by Mark de Wever - 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 - -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 - diff --git a/src/gui/widgets/tooltip.hpp b/src/gui/widgets/tooltip.hpp deleted file mode 100644 index d99d5cca3d7..00000000000 --- a/src/gui/widgets/tooltip.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* $Id$ */ -/* - Copyright (C) 2008 - 2011 by Mark de Wever - 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 diff --git a/src/gui/widgets/window.hpp b/src/gui/widgets/window.hpp index a4f3ef0a25e..763cdb7384d 100644 --- a/src/gui/widgets/window.hpp +++ b/src/gui/widgets/window.hpp @@ -26,7 +26,6 @@ #include "gui/auxiliary/formula.hpp" #include "gui/widgets/helper.hpp" #include "gui/widgets/panel.hpp" -#include "gui/widgets/tooltip.hpp" #include "events.hpp" #include "SDL.h"