Rename combobox -> menu_button
This commit is contained in:
parent
db167c0cb4
commit
396f5dfc4c
19 changed files with 162 additions and 162 deletions
|
@ -585,7 +585,7 @@
|
|||
[/tag]
|
||||
[/tag]
|
||||
[tag]
|
||||
name="combobox_definition"
|
||||
name="menu_button_definition"
|
||||
min="0"
|
||||
max="-1"
|
||||
super="gui/button_definition"
|
||||
|
@ -1387,7 +1387,7 @@
|
|||
[/key]
|
||||
[/tag]
|
||||
[tag]
|
||||
name="combobox"
|
||||
name="menu_button"
|
||||
min="0"
|
||||
max="-1"
|
||||
super="gui/window/resolution/grid/row/column/button"
|
||||
|
|
|
@ -130,14 +130,14 @@
|
|||
[/resolution]
|
||||
#enddef
|
||||
|
||||
[combobox_definition]
|
||||
[menu_button_definition]
|
||||
|
||||
id = "default"
|
||||
description = "Default button"
|
||||
|
||||
{_GUI_RESOLUTION () 40 140 30 13 4 ({GUI_NORMAL__FONT_SIZE__SMALL}) "button_dropdown/button_dropdown" ()}
|
||||
|
||||
[/combobox_definition]
|
||||
[/menu_button_definition]
|
||||
|
||||
#undef _GUI_RESOLUTION
|
||||
#undef _GUI_DRAW_BORDER
|
|
@ -1083,7 +1083,7 @@
|
|||
horizontal_alignment = "left"
|
||||
|
||||
# TODO: maybe do this in the source code?
|
||||
[combobox]
|
||||
[menu_button]
|
||||
definition = "default"
|
||||
[option]
|
||||
label = "All Add-ons"
|
||||
|
@ -1104,7 +1104,7 @@
|
|||
[option]
|
||||
label = "Not Uploaded"
|
||||
[/option]
|
||||
[/combobox]
|
||||
[/menu_button]
|
||||
[/column]
|
||||
|
||||
[column]
|
||||
|
|
|
@ -103,10 +103,10 @@
|
|||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
|
||||
[combobox]
|
||||
[menu_button]
|
||||
id = "eras"
|
||||
definition = "default"
|
||||
[/combobox]
|
||||
[/menu_button]
|
||||
|
||||
[/column]
|
||||
|
||||
|
@ -139,10 +139,10 @@
|
|||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
|
||||
[combobox]
|
||||
[menu_button]
|
||||
id = "random_faction_mode"
|
||||
definition = "default"
|
||||
[/combobox]
|
||||
[/menu_button]
|
||||
|
||||
[/column]
|
||||
|
||||
|
@ -359,7 +359,7 @@
|
|||
[/node]
|
||||
|
||||
[node]
|
||||
id = "option_combobox_node"
|
||||
id = "option_menu_button_node"
|
||||
unfolded = true
|
||||
|
||||
[node_definition]
|
||||
|
@ -371,7 +371,7 @@
|
|||
border_size = 5
|
||||
|
||||
[label]
|
||||
id = "combobox_label"
|
||||
id = "menu_button_label"
|
||||
definition = "default_small"
|
||||
linked_group = "custom_options_labels"
|
||||
[/label]
|
||||
|
@ -384,9 +384,9 @@
|
|||
border_size = 5
|
||||
horizontal_grow = "true"
|
||||
|
||||
[combobox]
|
||||
id = "option_combobox"
|
||||
[/combobox]
|
||||
[menu_button]
|
||||
id = "option_menu_button"
|
||||
[/menu_button]
|
||||
|
||||
[/column]
|
||||
|
||||
|
@ -1233,10 +1233,10 @@
|
|||
horizontal_grow = "true"
|
||||
vertical_alignment = "top"
|
||||
|
||||
[combobox]
|
||||
[menu_button]
|
||||
id = "game_types"
|
||||
definition = "default"
|
||||
[/combobox]
|
||||
[/menu_button]
|
||||
|
||||
[/column]
|
||||
|
||||
|
|
|
@ -26,11 +26,11 @@
|
|||
border_size = 5
|
||||
horizontal_alignment = "left"
|
||||
|
||||
[combobox]
|
||||
[menu_button]
|
||||
id = "resolution_set"
|
||||
definition = "default"
|
||||
tooltip = _ "Change the game resolution"
|
||||
[/combobox]
|
||||
[/menu_button]
|
||||
[/column]
|
||||
|
||||
[/row]
|
||||
|
|
|
@ -644,8 +644,6 @@
|
|||
<Unit filename="../../src/gui/widgets/button.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/button.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/clickable.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/combobox.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/combobox.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/container.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/container.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/control.cpp" />
|
||||
|
@ -679,6 +677,8 @@
|
|||
<Unit filename="../../src/gui/widgets/matrix.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/minimap.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/minimap.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/menu_button.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/menu_button.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/multi_page.cpp" />
|
||||
<Unit filename="../../src/gui/widgets/multi_page.hpp" />
|
||||
<Unit filename="../../src/gui/widgets/pane.cpp" />
|
||||
|
|
|
@ -2220,14 +2220,6 @@
|
|||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\combobox.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\container.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
|
@ -2338,6 +2330,14 @@
|
|||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\menu_button.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='ReleaseDEBUG|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Test_Release|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\minimap.cpp">
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug_with_VLD|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
<ObjectFileName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)Gui\Widgets\</ObjectFileName>
|
||||
|
@ -4153,7 +4153,6 @@
|
|||
<ClInclude Include="..\..\src\gui\dialogs\wml_message.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\button.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\clickable.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\combobox.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\container.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\control.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\debug.hpp" />
|
||||
|
@ -4172,6 +4171,7 @@
|
|||
<ClInclude Include="..\..\src\gui\widgets\list.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\listbox.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\matrix.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\menu_button.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\minimap.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\multi_page.hpp" />
|
||||
<ClInclude Include="..\..\src\gui\widgets\pane.hpp" />
|
||||
|
|
|
@ -395,9 +395,6 @@
|
|||
<ClCompile Include="..\..\src\gui\widgets\button.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\combobox.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\container.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
|
@ -437,6 +434,9 @@
|
|||
<ClCompile Include="..\..\src\gui\widgets\matrix.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\menu_button.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\src\gui\widgets\minimap.cpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClCompile>
|
||||
|
@ -1745,9 +1745,6 @@
|
|||
<ClInclude Include="..\..\src\gui\widgets\clickable.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\widgets\combobox.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\widgets\container.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
|
@ -1802,6 +1799,9 @@
|
|||
<ClInclude Include="..\..\src\gui\widgets\matrix.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\widgets\menu_button.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\src\gui\widgets\minimap.hpp">
|
||||
<Filter>Gui\Widgets</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -395,7 +395,7 @@
|
|||
91A215E21CAD9B9000927AEA /* libpango-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EC5C242E18EF07B4001FA499 /* libpango-1.0.0.dylib */; };
|
||||
91A215E31CAD9B9000927AEA /* libpangocairo-1.0.0.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = EC5C242F18EF07B4001FA499 /* libpangocairo-1.0.0.dylib */; };
|
||||
91A215E41CAD9D4300927AEA /* button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A9BCEA0ECA805A002BE442 /* button.cpp */; };
|
||||
91A215E71CAD9D4300927AEA /* combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462861C7115C50050A9C9 /* combobox.cpp */; };
|
||||
91A215E71CAD9D4300927AEA /* menu_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462861C7115C50050A9C9 /* menu_button.cpp */; };
|
||||
91A215E91CAD9D4300927AEA /* container.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A9BCEE0ECA805A002BE442 /* container.cpp */; };
|
||||
91A215EB1CAD9D4300927AEA /* control.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A9BCF00ECA805A002BE442 /* control.cpp */; };
|
||||
91A215ED1CAD9D4300927AEA /* debug.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A9BCF20ECA805A002BE442 /* debug.cpp */; };
|
||||
|
@ -739,7 +739,7 @@
|
|||
91E357501CACCC3E00774252 /* message.cpp in Sources */ = {isa = PBXBuildFile; fileRef = B5A9BCC10ECA805A002BE442 /* message.cpp */; };
|
||||
91ECD5D21BA11A5200B25CF1 /* unit_creator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91ECD5D01BA11A5200B25CF1 /* unit_creator.cpp */; };
|
||||
91F462841C71139C0050A9C9 /* preferences_dialog.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462821C71139B0050A9C9 /* preferences_dialog.cpp */; };
|
||||
91F462881C7115C50050A9C9 /* combobox.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462861C7115C50050A9C9 /* combobox.cpp */; };
|
||||
91F462881C7115C50050A9C9 /* menu_button.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462861C7115C50050A9C9 /* menu_button.cpp */; };
|
||||
91F462941C7117400050A9C9 /* drop_down_list.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91F462921C7117400050A9C9 /* drop_down_list.cpp */; };
|
||||
91FAC70A1C7FBC3400DAB2C3 /* lua_formula_bridge.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91FAC7091C7FBC2C00DAB2C3 /* lua_formula_bridge.cpp */; };
|
||||
91FBBAD61CB6AF8900470BFE /* player_connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 91FBBAD41CB6AF8900470BFE /* player_connection.cpp */; };
|
||||
|
@ -1747,8 +1747,8 @@
|
|||
91EF6C041C9E22E400E2A733 /* smart_list.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = smart_list.hpp; sourceTree = "<group>"; };
|
||||
91F462821C71139B0050A9C9 /* preferences_dialog.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = preferences_dialog.cpp; sourceTree = "<group>"; };
|
||||
91F462831C71139B0050A9C9 /* preferences_dialog.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = preferences_dialog.hpp; sourceTree = "<group>"; };
|
||||
91F462861C7115C50050A9C9 /* combobox.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = combobox.cpp; sourceTree = "<group>"; };
|
||||
91F462871C7115C50050A9C9 /* combobox.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = combobox.hpp; sourceTree = "<group>"; };
|
||||
91F462861C7115C50050A9C9 /* menu_button.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = menu_button.cpp; sourceTree = "<group>"; };
|
||||
91F462871C7115C50050A9C9 /* menu_button.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = menu_button.hpp; sourceTree = "<group>"; };
|
||||
91F462921C7117400050A9C9 /* drop_down_list.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = drop_down_list.cpp; sourceTree = "<group>"; };
|
||||
91F462931C7117400050A9C9 /* drop_down_list.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = drop_down_list.hpp; sourceTree = "<group>"; };
|
||||
91FAC7081C7F931900DAB2C3 /* lua_formula_bridge.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = lua_formula_bridge.hpp; sourceTree = "<group>"; };
|
||||
|
@ -4376,8 +4376,6 @@
|
|||
B5A9BCEA0ECA805A002BE442 /* button.cpp */,
|
||||
B5A9BCEB0ECA805A002BE442 /* button.hpp */,
|
||||
B5CF7BBE10D55F7B00A8BEB5 /* clickable.hpp */,
|
||||
91F462861C7115C50050A9C9 /* combobox.cpp */,
|
||||
91F462871C7115C50050A9C9 /* combobox.hpp */,
|
||||
B5A9BCEE0ECA805A002BE442 /* container.cpp */,
|
||||
B5A9BCEF0ECA805A002BE442 /* container.hpp */,
|
||||
B5A9BCF00ECA805A002BE442 /* control.cpp */,
|
||||
|
@ -4409,6 +4407,8 @@
|
|||
B5A9BD000ECA805A002BE442 /* listbox.hpp */,
|
||||
62579C811573E797003089D5 /* matrix.cpp */,
|
||||
62579C821573E797003089D5 /* matrix.hpp */,
|
||||
91F462861C7115C50050A9C9 /* menu_button.cpp */,
|
||||
91F462871C7115C50050A9C9 /* menu_button.hpp */,
|
||||
B5A9BD030ECA805A002BE442 /* minimap.cpp */,
|
||||
B5A9BD040ECA805A002BE442 /* minimap.hpp */,
|
||||
B54AC6F80FEA9FA5006F6FBD /* multi_page.cpp */,
|
||||
|
@ -5214,7 +5214,7 @@
|
|||
919B37F81BAF789E00E0094C /* synced_user_choice.cpp in Sources */,
|
||||
919B37FC1BAF7A9D00E0094C /* synced_choice_wait.cpp in Sources */,
|
||||
91F462841C71139C0050A9C9 /* preferences_dialog.cpp in Sources */,
|
||||
91F462881C7115C50050A9C9 /* combobox.cpp in Sources */,
|
||||
91F462881C7115C50050A9C9 /* menu_button.cpp in Sources */,
|
||||
91F462941C7117400050A9C9 /* drop_down_list.cpp in Sources */,
|
||||
9130A4601C73BB6100852782 /* select_orb_colors.cpp in Sources */,
|
||||
91DCA6891C9066CC0030F8D0 /* unit_preview_pane.cpp in Sources */,
|
||||
|
@ -5721,7 +5721,7 @@
|
|||
91A215D91CAD96D900927AEA /* mp_method_selection.cpp in Sources */,
|
||||
91A215DA1CAD96D900927AEA /* synced_choice_wait.cpp in Sources */,
|
||||
91A215E41CAD9D4300927AEA /* button.cpp in Sources */,
|
||||
91A215E71CAD9D4300927AEA /* combobox.cpp in Sources */,
|
||||
91A215E71CAD9D4300927AEA /* menu_button.cpp in Sources */,
|
||||
91A215E91CAD9D4300927AEA /* container.cpp in Sources */,
|
||||
91A215EB1CAD9D4300927AEA /* control.cpp in Sources */,
|
||||
91A215ED1CAD9D4300927AEA /* debug.cpp in Sources */,
|
||||
|
|
|
@ -519,7 +519,6 @@ add_library(wesnoth-gui_tooltip
|
|||
set(wesnoth-gui_widget_SRC
|
||||
gui/dialogs/drop_down_list.cpp
|
||||
gui/widgets/button.cpp
|
||||
gui/widgets/combobox.cpp
|
||||
gui/widgets/container.cpp
|
||||
gui/widgets/control.cpp
|
||||
gui/widgets/debug.cpp
|
||||
|
@ -533,6 +532,7 @@ set(wesnoth-gui_widget_SRC
|
|||
gui/widgets/list.cpp
|
||||
gui/widgets/listbox.cpp
|
||||
gui/widgets/matrix.cpp
|
||||
gui/widgets/menu_button.cpp
|
||||
gui/widgets/minimap.cpp
|
||||
gui/widgets/multi_page.cpp
|
||||
gui/widgets/pane.cpp
|
||||
|
|
|
@ -429,7 +429,6 @@ wesnoth_sources = Split("""
|
|||
gui/dialogs/wml_error.cpp
|
||||
gui/dialogs/wml_message.cpp
|
||||
gui/widgets/button.cpp
|
||||
gui/widgets/combobox.cpp
|
||||
gui/widgets/container.cpp
|
||||
gui/widgets/control.cpp
|
||||
gui/widgets/drawing.cpp
|
||||
|
@ -442,6 +441,7 @@ wesnoth_sources = Split("""
|
|||
gui/widgets/list.cpp
|
||||
gui/widgets/listbox.cpp
|
||||
gui/widgets/matrix.cpp
|
||||
gui/widgets/menu_button.cpp
|
||||
gui/widgets/minimap.cpp
|
||||
gui/widgets/multi_page.cpp
|
||||
gui/widgets/pane.cpp
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include "gui/core/window_builder/helper.hpp"
|
||||
#include "gui/core/window_builder/instance.hpp"
|
||||
#include "gui/widgets/button.hpp"
|
||||
#include "gui/widgets/combobox.hpp"
|
||||
#include "gui/widgets/menu_button.hpp"
|
||||
#include "gui/widgets/drawing.hpp"
|
||||
#include "gui/widgets/horizontal_scrollbar.hpp"
|
||||
#include "gui/widgets/image.hpp"
|
||||
|
@ -223,7 +223,7 @@ tbuilder_widget_ptr create_builder_widget(const config& cfg)
|
|||
TRY(matrix);
|
||||
TRY(minimap);
|
||||
TRY(button);
|
||||
TRY(combobox);
|
||||
TRY(menu_button);
|
||||
TRY(drawing);
|
||||
TRY(password_box);
|
||||
TRY(unit_preview_pane);
|
||||
|
|
|
@ -21,7 +21,7 @@ class config;
|
|||
|
||||
namespace gui2
|
||||
{
|
||||
///Used by the combobox widget.
|
||||
///Used by the menu_button widget.
|
||||
class tdrop_down_list : public tdialog
|
||||
{
|
||||
public:
|
||||
|
@ -34,7 +34,7 @@ public:
|
|||
}
|
||||
int selected_item() const { return selected_item_; }
|
||||
private:
|
||||
/// The screen location of the combobox button that triggred this droplist.
|
||||
/// The screen location of the menu_button button that triggred this droplist.
|
||||
/// Note: we don't adjust the location of this dialog to when resizing the window.
|
||||
/// Instead this dialog automatically closes itself on resizing.
|
||||
SDL_Rect button_pos_;
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "gui/dialogs/transient_message.hpp"
|
||||
#include "gui/widgets/integer_selector.hpp"
|
||||
#include "gui/widgets/button.hpp"
|
||||
#include "gui/widgets/combobox.hpp"
|
||||
#include "gui/widgets/menu_button.hpp"
|
||||
#include "gui/widgets/image.hpp"
|
||||
#ifdef GUI2_EXPERIMENTAL_LISTBOX
|
||||
#include "gui/widgets/list.hpp"
|
||||
|
@ -150,7 +150,7 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
window.keyboard_capture(&filter);
|
||||
|
||||
//
|
||||
// Set up game types combobox
|
||||
// Set up game types menu_button
|
||||
//
|
||||
std::vector<config> game_types;
|
||||
for(level_type_info& type_info : level_types_) {
|
||||
|
@ -162,19 +162,19 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
throw game::error(_("No games found."));
|
||||
}
|
||||
|
||||
tcombobox& game_combobox = find_widget<tcombobox>(&window, "game_types", false);
|
||||
tmenu_button& game_menu_button = find_widget<tmenu_button>(&window, "game_types", false);
|
||||
|
||||
game_combobox.set_values(game_types);
|
||||
game_menu_button.set_values(game_types);
|
||||
if(game_config::debug || preferences::level_type() != ng::level::TYPE::SP_CAMPAIGN) {
|
||||
game_combobox.set_selected(preferences::level_type());
|
||||
game_menu_button.set_selected(preferences::level_type());
|
||||
}
|
||||
|
||||
game_combobox.connect_click_handler(std::bind(&tmp_create_game::update_games_list, this, std::ref(window)));
|
||||
game_menu_button.connect_click_handler(std::bind(&tmp_create_game::update_games_list, this, std::ref(window)));
|
||||
|
||||
//
|
||||
// Set up eras combobox
|
||||
// Set up eras menu_button
|
||||
//
|
||||
tcombobox& eras_combobox = find_widget<tcombobox>(&window, "eras", false);
|
||||
tmenu_button& eras_menu_button = find_widget<tmenu_button>(&window, "eras", false);
|
||||
|
||||
std::vector<config> era_names;
|
||||
for(const auto& era : create_engine_.extras_menu_item_names(ng::create_engine::ERA, false)) {
|
||||
|
@ -186,12 +186,12 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
throw config::error(_("No eras found"));
|
||||
}
|
||||
|
||||
eras_combobox.set_values(era_names);
|
||||
eras_combobox.connect_click_handler(std::bind(&tmp_create_game::on_era_select, this, std::ref(window)));
|
||||
eras_menu_button.set_values(era_names);
|
||||
eras_menu_button.connect_click_handler(std::bind(&tmp_create_game::on_era_select, this, std::ref(window)));
|
||||
|
||||
const int era_selection = create_engine_.find_extra_by_id(ng::create_engine::ERA, preferences::era());
|
||||
if(era_selection >= 0) {
|
||||
eras_combobox.set_selected(era_selection);
|
||||
eras_menu_button.set_selected(era_selection);
|
||||
}
|
||||
|
||||
on_era_select(window);
|
||||
|
@ -234,7 +234,7 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
on_mod_select(window);
|
||||
|
||||
//
|
||||
// Set up random faction mode copobox
|
||||
// Set up random faction mode menu_button
|
||||
//
|
||||
std::vector<config> rfm_options;
|
||||
for(const auto& type : rfm_types_) {
|
||||
|
@ -249,11 +249,11 @@ void tmp_create_game::pre_show(twindow& window)
|
|||
const int initial_index = std::find(rfm_types_.begin(), rfm_types_.end(),
|
||||
mp_game_settings::RANDOM_FACTION_MODE::string_to_enum(prefs::random_faction_mode())) - rfm_types_.begin();
|
||||
|
||||
tcombobox& rfm_combobox = find_widget<tcombobox>(&window, "random_faction_mode", false);
|
||||
tmenu_button& rfm_menu_button = find_widget<tmenu_button>(&window, "random_faction_mode", false);
|
||||
|
||||
rfm_combobox.set_values(rfm_options);
|
||||
rfm_combobox.set_selected(initial_index);
|
||||
rfm_combobox.connect_click_handler(std::bind(&tmp_create_game::on_random_faction_mode_select, this, std::ref(window)));
|
||||
rfm_menu_button.set_values(rfm_options);
|
||||
rfm_menu_button.set_selected(initial_index);
|
||||
rfm_menu_button.connect_click_handler(std::bind(&tmp_create_game::on_random_faction_mode_select, this, std::ref(window)));
|
||||
|
||||
on_random_faction_mode_select(window);
|
||||
|
||||
|
@ -334,7 +334,7 @@ void tmp_create_game::on_tab_select(twindow& window)
|
|||
if(i == tab::TAB_GENERAL) {
|
||||
const bool can_select_era = create_engine_.current_level().allow_era_choice();
|
||||
|
||||
tcombobox& era_combo = find_widget<tcombobox>(&window, "eras", false);
|
||||
tmenu_button& era_combo = find_widget<tmenu_button>(&window, "eras", false);
|
||||
if(!can_select_era) {
|
||||
era_combo.set_label(_("No eras available for this game."));
|
||||
} else {
|
||||
|
@ -370,14 +370,14 @@ void tmp_create_game::on_mod_toggle(const int index)
|
|||
|
||||
void tmp_create_game::on_era_select(twindow& window)
|
||||
{
|
||||
create_engine_.set_current_era_index(find_widget<tcombobox>(&window, "eras", false).get_value());
|
||||
create_engine_.set_current_era_index(find_widget<tmenu_button>(&window, "eras", false).get_value());
|
||||
|
||||
show_description(window, create_engine_.current_extra(ng::create_engine::ERA).description);
|
||||
}
|
||||
|
||||
void tmp_create_game::on_random_faction_mode_select(twindow& window)
|
||||
{
|
||||
selected_rfm_index_ = find_widget<tcombobox>(&window, "random_faction_mode", false).get_value();
|
||||
selected_rfm_index_ = find_widget<tmenu_button>(&window, "random_faction_mode", false).get_value();
|
||||
}
|
||||
|
||||
void tmp_create_game::show_description(twindow& window, const std::string& new_description)
|
||||
|
@ -390,7 +390,7 @@ void tmp_create_game::show_description(twindow& window, const std::string& new_d
|
|||
|
||||
void tmp_create_game::update_games_list(twindow& window)
|
||||
{
|
||||
const int index = find_widget<tcombobox>(&window, "game_types", false).get_value();
|
||||
const int index = find_widget<tmenu_button>(&window, "game_types", false).get_value();
|
||||
|
||||
display_games_of_type(window, level_types_[index].first, create_engine_.current_level().id());
|
||||
}
|
||||
|
@ -508,19 +508,19 @@ void tmp_create_game::display_custom_options(twindow& window, ttree_view& tree,
|
|||
option_node.add_child("options_spacer_node", empty_map);
|
||||
}
|
||||
|
||||
for(const auto& combobox_option : options.child_range("combo")) {
|
||||
for(const auto& menu_button_option : options.child_range("combo")) {
|
||||
data.clear();
|
||||
|
||||
item["label"] = combobox_option["name"];
|
||||
data.emplace("combobox_label", item);
|
||||
item["label"] = menu_button_option["name"];
|
||||
data.emplace("menu_button_label", item);
|
||||
item.clear();
|
||||
item["tooltip"] = combobox_option["description"];
|
||||
data.emplace("option_combobox", item);
|
||||
item["tooltip"] = menu_button_option["description"];
|
||||
data.emplace("option_menu_button", item);
|
||||
|
||||
std::vector<config> combo_items;
|
||||
std::vector<std::string> combo_values;
|
||||
|
||||
config::const_child_itors items = combobox_option.child_range("item");
|
||||
config::const_child_itors items = menu_button_option.child_range("item");
|
||||
for(auto item : items) {
|
||||
// Comboboxes expect this key to be 'label' not 'name'
|
||||
item["label"] = item["name"];
|
||||
|
@ -533,31 +533,31 @@ void tmp_create_game::display_custom_options(twindow& window, ttree_view& tree,
|
|||
continue;
|
||||
}
|
||||
|
||||
ttree_view_node& node = option_node.add_child("option_combobox_node", data);
|
||||
ttree_view_node& node = option_node.add_child("option_menu_button_node", data);
|
||||
|
||||
tcombobox* combobox = dynamic_cast<tcombobox*>(node.find("option_combobox", true));
|
||||
tmenu_button* menu_button = dynamic_cast<tmenu_button*>(node.find("option_menu_button", true));
|
||||
|
||||
VALIDATE(combobox, missing_widget("option_combobox"));
|
||||
VALIDATE(menu_button, missing_widget("option_menu_button"));
|
||||
|
||||
const std::string widget_id = combobox_option["id"];
|
||||
const std::string widget_id = menu_button_option["id"];
|
||||
|
||||
if(data_map.find(widget_id) == data_map.end() || data_map[widget_id].empty()) {
|
||||
data_map[widget_id] = combobox_option["default"];
|
||||
data_map[widget_id] = menu_button_option["default"];
|
||||
}
|
||||
|
||||
combobox->set_id(widget_id);
|
||||
combobox->set_values(combo_items);
|
||||
menu_button->set_id(widget_id);
|
||||
menu_button->set_values(combo_items);
|
||||
|
||||
config::attribute_value val = data_map[widget_id];
|
||||
auto iter = std::find_if(items.begin(), items.end(), [&val](const config& cfg) {
|
||||
return cfg["value"] == val;
|
||||
});
|
||||
if(iter != items.end()) {
|
||||
combobox->set_selected(iter - items.begin());
|
||||
menu_button->set_selected(iter - items.begin());
|
||||
}
|
||||
|
||||
combobox->connect_click_handler(
|
||||
std::bind(&tmp_create_game::update_options_data_map<tcombobox>, this, combobox, visible_options_.back()));
|
||||
menu_button->connect_click_handler(
|
||||
std::bind(&tmp_create_game::update_options_data_map<tmenu_button>, this, menu_button, visible_options_.back()));
|
||||
}
|
||||
|
||||
// Only add a spacer if there were an option of this type
|
||||
|
|
|
@ -80,15 +80,15 @@ private:
|
|||
std::vector<level_type_info> level_types_;
|
||||
|
||||
/* We keep and work with a vector of the RFM types since it's the easiest way to get a value for the
|
||||
* config_engine and preferences setters, since comboboxes aren't supported by tfield. Even if they
|
||||
* config_engine and preferences setters, since menu_buttons aren't supported by tfield. Even if they
|
||||
* were, the above functions take a RANDOM_FACTION_MODE value, not an index. Even if we try to keep a
|
||||
* copy of the selected RFM type index in a int value and update it every time you perform a selection,
|
||||
* there's still the problem of getting an initial value from preferences, which again is provided as a
|
||||
* RANDOM_FACTION_MODE value. Comparing strings between the (translated) combobox values in the WML and
|
||||
* RANDOM_FACTION_MODE value. Comparing strings between the (translated) menu_button values in the WML and
|
||||
* the hardcoded (non-translated) RANDOM_FACTION_MODE string values stored in preferences is a horrible
|
||||
* way to do it and would break in any language other than English. Instead, we'll keep a vector and use
|
||||
* std::find to get the initial index. This method should also allow the values to eventually be translated,
|
||||
* since the string values don't come into consideration at all, save for populating the combobox.
|
||||
* since the string values don't come into consideration at all, save for populating the menu_button.
|
||||
*
|
||||
* -- vultraz, 8/21/2016
|
||||
*/
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#include "gui/dialogs/helper.hpp"
|
||||
#include "gui/dialogs/transient_message.hpp"
|
||||
#include "gui/widgets/button.hpp"
|
||||
#include "gui/widgets/combobox.hpp"
|
||||
#include "gui/widgets/menu_button.hpp"
|
||||
#include "gui/widgets/grid.hpp"
|
||||
#include "gui/widgets/image.hpp"
|
||||
#include "gui/widgets/label.hpp"
|
||||
|
@ -110,7 +110,7 @@ static std::string disambiguate_widget_value(const ttoggle_button& parent_widget
|
|||
return bool_to_display_string(parent_widget.get_value_bool());
|
||||
}
|
||||
|
||||
static std::string disambiguate_widget_value(const tcombobox& parent_widget)
|
||||
static std::string disambiguate_widget_value(const tmenu_button& parent_widget)
|
||||
{
|
||||
return parent_widget.get_value_string();
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ static std::string get_max_autosaves_status_label(const tslider& slider)
|
|||
}
|
||||
|
||||
// Helper function to refresh resolution list
|
||||
static void set_resolution_list(tcombobox& res_list, CVideo& video)
|
||||
static void set_resolution_list(tmenu_button& res_list, CVideo& video)
|
||||
{
|
||||
const std::vector<std::pair<int,int> > resolutions = video.get_available_resolutions(true);
|
||||
|
||||
|
@ -225,21 +225,21 @@ void tpreferences::setup_single_slider(
|
|||
slider_callback));
|
||||
}
|
||||
|
||||
void tpreferences::setup_combobox(
|
||||
void tpreferences::setup_menu_button(
|
||||
const std::string& widget_id,
|
||||
const combo_data& options,
|
||||
const unsigned start_value,
|
||||
std::function<void(std::string)> callback,
|
||||
twidget& find_in)
|
||||
{
|
||||
tcombobox& widget =
|
||||
find_widget<tcombobox>(&find_in, widget_id, false);
|
||||
tmenu_button& widget =
|
||||
find_widget<tmenu_button>(&find_in, widget_id, false);
|
||||
|
||||
widget.set_use_markup(true);
|
||||
widget.set_values(options.first, start_value);
|
||||
|
||||
connect_signal_mouse_left_click(widget, std::bind(
|
||||
&tpreferences::simple_combobox_callback,
|
||||
&tpreferences::simple_menu_button_callback,
|
||||
this, std::ref(widget),
|
||||
callback, options.second));
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ void tpreferences::initialize_members(twindow& window)
|
|||
this, std::ref(window)));
|
||||
|
||||
/* SET RESOLUTION */
|
||||
tcombobox& res_list = find_widget<tcombobox>(&window, "resolution_set", false);
|
||||
tmenu_button& res_list = find_widget<tmenu_button>(&window, "resolution_set", false);
|
||||
|
||||
res_list.set_use_markup(true);
|
||||
res_list.set_active(!fullscreen());
|
||||
|
@ -791,7 +791,7 @@ void tpreferences::initialize_members(twindow& window)
|
|||
combo_options.second.begin(), combo_options.second.end(),
|
||||
get(pref_name, option["default"].str())) - combo_options.second.begin();
|
||||
|
||||
tcombobox* setter_widget = new tcombobox;
|
||||
tmenu_button* setter_widget = new tmenu_button;
|
||||
setter_widget->set_definition("default");
|
||||
setter_widget->set_id("setter");
|
||||
|
||||
|
@ -801,7 +801,7 @@ void tpreferences::initialize_members(twindow& window)
|
|||
typedef void (*setter) (const std::string &, const std::string &);
|
||||
setter set_ptr = &preferences::set;
|
||||
|
||||
setup_combobox("setter",
|
||||
setup_menu_button("setter",
|
||||
combo_options, selected,
|
||||
std::bind(set_ptr, pref_name, _1),
|
||||
*details_grid);
|
||||
|
@ -1167,7 +1167,7 @@ void tpreferences::single_slider_callback(const tslider& widget,
|
|||
setter(widget.get_value());
|
||||
}
|
||||
|
||||
void tpreferences::simple_combobox_callback(const tcombobox& widget,
|
||||
void tpreferences::simple_menu_button_callback(const tmenu_button& widget,
|
||||
std::function<void(std::string)> setter, std::vector<std::string>& vec)
|
||||
{
|
||||
const unsigned index = widget.get_value();
|
||||
|
@ -1188,14 +1188,14 @@ void tpreferences::fullscreen_toggle_callback(twindow& window)
|
|||
find_widget<ttoggle_button>(&window, "fullscreen", false).get_value_bool();
|
||||
window.video().set_fullscreen(ison);
|
||||
|
||||
tcombobox& res_list = find_widget<tcombobox>(&window, "resolution_set", false);
|
||||
tmenu_button& res_list = find_widget<tmenu_button>(&window, "resolution_set", false);
|
||||
set_resolution_list(res_list, window.video());
|
||||
res_list.set_active(!ison);
|
||||
}
|
||||
|
||||
void tpreferences::handle_res_select(twindow& window)
|
||||
{
|
||||
tcombobox& res_list = find_widget<tcombobox>(&window, "resolution_set", false);
|
||||
tmenu_button& res_list = find_widget<tmenu_button>(&window, "resolution_set", false);
|
||||
const int choice = res_list.get_value();
|
||||
|
||||
if (resolutions_[static_cast<size_t>(choice)] == window.video().current_resolution()) {
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace gui2
|
|||
{
|
||||
|
||||
class tlistbox;
|
||||
class tcombobox;
|
||||
class tmenu_button;
|
||||
class tcontrol;
|
||||
class tslider;
|
||||
class ttext_box;
|
||||
|
@ -150,16 +150,16 @@ private:
|
|||
typedef std::pair<std::vector<config>, std::vector<std::string> > combo_data;
|
||||
|
||||
/**
|
||||
* Sets the initial state and callback for a combobox
|
||||
* Sets the initial state and callback for a menu_button
|
||||
*/
|
||||
void setup_combobox(
|
||||
void setup_menu_button(
|
||||
const std::string& widget_id,
|
||||
const combo_data& options,
|
||||
const unsigned start_value,
|
||||
std::function<void(std::string)> callback,
|
||||
twidget& find_in);
|
||||
|
||||
void simple_combobox_callback(const tcombobox& widget,
|
||||
void simple_menu_button_callback(const tmenu_button& widget,
|
||||
std::function<void(std::string)> setter, std::vector<std::string>& vec);
|
||||
|
||||
/**
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
#define GETTEXT_DOMAIN "wesnoth-lib"
|
||||
|
||||
#include "gui/widgets/combobox.hpp"
|
||||
#include "gui/widgets/menu_button.hpp"
|
||||
|
||||
#include "gui/core/log.hpp"
|
||||
#include "gui/core/widget_definition.hpp"
|
||||
|
@ -37,9 +37,9 @@ namespace gui2
|
|||
|
||||
// ------------ WIDGET -----------{
|
||||
|
||||
REGISTER_WIDGET(combobox)
|
||||
REGISTER_WIDGET(menu_button)
|
||||
|
||||
tcombobox::tcombobox()
|
||||
tmenu_button::tmenu_button()
|
||||
: tcontrol(COUNT)
|
||||
, tselectable_()
|
||||
, state_(ENABLED)
|
||||
|
@ -50,36 +50,36 @@ tcombobox::tcombobox()
|
|||
values_.push_back(config_of("label", this->label()));
|
||||
|
||||
connect_signal<event::MOUSE_ENTER>(
|
||||
std::bind(&tcombobox::signal_handler_mouse_enter, this, _2, _3));
|
||||
std::bind(&tmenu_button::signal_handler_mouse_enter, this, _2, _3));
|
||||
connect_signal<event::MOUSE_LEAVE>(
|
||||
std::bind(&tcombobox::signal_handler_mouse_leave, this, _2, _3));
|
||||
std::bind(&tmenu_button::signal_handler_mouse_leave, this, _2, _3));
|
||||
|
||||
connect_signal<event::LEFT_BUTTON_DOWN>(std::bind(
|
||||
&tcombobox::signal_handler_left_button_down, this, _2, _3));
|
||||
&tmenu_button::signal_handler_left_button_down, this, _2, _3));
|
||||
connect_signal<event::LEFT_BUTTON_UP>(
|
||||
std::bind(&tcombobox::signal_handler_left_button_up, this, _2, _3));
|
||||
std::bind(&tmenu_button::signal_handler_left_button_up, this, _2, _3));
|
||||
connect_signal<event::LEFT_BUTTON_CLICK>(std::bind(
|
||||
&tcombobox::signal_handler_left_button_click, this, _2, _3));
|
||||
&tmenu_button::signal_handler_left_button_click, this, _2, _3));
|
||||
}
|
||||
|
||||
void tcombobox::set_active(const bool active)
|
||||
void tmenu_button::set_active(const bool active)
|
||||
{
|
||||
if(get_active() != active) {
|
||||
set_state(active ? ENABLED : DISABLED);
|
||||
}
|
||||
}
|
||||
|
||||
bool tcombobox::get_active() const
|
||||
bool tmenu_button::get_active() const
|
||||
{
|
||||
return state_ != DISABLED;
|
||||
}
|
||||
|
||||
unsigned tcombobox::get_state() const
|
||||
unsigned tmenu_button::get_state() const
|
||||
{
|
||||
return state_;
|
||||
}
|
||||
|
||||
void tcombobox::set_state(const tstate state)
|
||||
void tmenu_button::set_state(const tstate state)
|
||||
{
|
||||
if(state != state_) {
|
||||
state_ = state;
|
||||
|
@ -87,13 +87,13 @@ void tcombobox::set_state(const tstate state)
|
|||
}
|
||||
}
|
||||
|
||||
const std::string& tcombobox::get_control_type() const
|
||||
const std::string& tmenu_button::get_control_type() const
|
||||
{
|
||||
static const std::string type = "combobox";
|
||||
static const std::string type = "menu_button";
|
||||
return type;
|
||||
}
|
||||
|
||||
void tcombobox::signal_handler_mouse_enter(const event::tevent event,
|
||||
void tmenu_button::signal_handler_mouse_enter(const event::tevent event,
|
||||
bool& handled)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
@ -102,7 +102,7 @@ void tcombobox::signal_handler_mouse_enter(const event::tevent event,
|
|||
handled = true;
|
||||
}
|
||||
|
||||
void tcombobox::signal_handler_mouse_leave(const event::tevent event,
|
||||
void tmenu_button::signal_handler_mouse_leave(const event::tevent event,
|
||||
bool& handled)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
@ -111,7 +111,7 @@ void tcombobox::signal_handler_mouse_leave(const event::tevent event,
|
|||
handled = true;
|
||||
}
|
||||
|
||||
void tcombobox::signal_handler_left_button_down(const event::tevent event,
|
||||
void tmenu_button::signal_handler_left_button_down(const event::tevent event,
|
||||
bool& handled)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
@ -125,7 +125,7 @@ void tcombobox::signal_handler_left_button_down(const event::tevent event,
|
|||
handled = true;
|
||||
}
|
||||
|
||||
void tcombobox::signal_handler_left_button_up(const event::tevent event,
|
||||
void tmenu_button::signal_handler_left_button_up(const event::tevent event,
|
||||
bool& handled)
|
||||
{
|
||||
DBG_GUI_E << LOG_HEADER << ' ' << event << ".\n";
|
||||
|
@ -134,7 +134,7 @@ void tcombobox::signal_handler_left_button_up(const event::tevent event,
|
|||
handled = true;
|
||||
}
|
||||
|
||||
void tcombobox::signal_handler_left_button_click(const event::tevent event,
|
||||
void tmenu_button::signal_handler_left_button_click(const event::tevent event,
|
||||
bool& handled)
|
||||
{
|
||||
assert(get_window());
|
||||
|
@ -163,7 +163,7 @@ void tcombobox::signal_handler_left_button_click(const event::tevent event,
|
|||
handled = true;
|
||||
}
|
||||
|
||||
void tcombobox::set_values(const std::vector<::config>& values, int selected)
|
||||
void tmenu_button::set_values(const std::vector<::config>& values, int selected)
|
||||
{
|
||||
assert(static_cast<size_t>(selected) < values.size());
|
||||
assert(static_cast<size_t>(selected_) < values_.size());
|
||||
|
@ -175,7 +175,7 @@ void tcombobox::set_values(const std::vector<::config>& values, int selected)
|
|||
set_label(values_[selected_]["label"]);
|
||||
|
||||
}
|
||||
void tcombobox::set_selected(int selected)
|
||||
void tmenu_button::set_selected(int selected)
|
||||
{
|
||||
assert(static_cast<size_t>(selected) < values_.size());
|
||||
assert(static_cast<size_t>(selected_) < values_.size());
|
||||
|
@ -188,29 +188,29 @@ void tcombobox::set_selected(int selected)
|
|||
|
||||
// }---------- DEFINITION ---------{
|
||||
|
||||
tcombobox_definition::tcombobox_definition(const config& cfg)
|
||||
tmenu_button_definition::tmenu_button_definition(const config& cfg)
|
||||
: tcontrol_definition(cfg)
|
||||
{
|
||||
DBG_GUI_P << "Parsing combobox " << id << '\n';
|
||||
DBG_GUI_P << "Parsing menu_button " << id << '\n';
|
||||
|
||||
load_resolutions<tresolution>(cfg);
|
||||
}
|
||||
|
||||
/*WIKI
|
||||
* @page = GUIWidgetDefinitionWML
|
||||
* @order = 1_combobox
|
||||
* @order = 1_menu_button
|
||||
*
|
||||
* == combobox ==
|
||||
* == menu_button ==
|
||||
*
|
||||
* @macro = combobox_description
|
||||
* @macro = menu_button_description
|
||||
*
|
||||
* The following states exist:
|
||||
* * state_enabled, the combobox is enabled.
|
||||
* * state_disabled, the combobox is disabled.
|
||||
* * state_pressed, the left mouse combobox is down.
|
||||
* * state_focused, the mouse is over the combobox.
|
||||
* * state_enabled, the menu_button is enabled.
|
||||
* * state_disabled, the menu_button is disabled.
|
||||
* * state_pressed, the left mouse menu_button is down.
|
||||
* * state_focused, the mouse is over the menu_button.
|
||||
* @begin{parent}{name="gui/"}
|
||||
* @begin{tag}{name="combobox_definition"}{min=0}{max=-1}{super="generic/widget_definition"}
|
||||
* @begin{tag}{name="menu_button_definition"}{min=0}{max=-1}{super="generic/widget_definition"}
|
||||
* @begin{tag}{name="resolution"}{min=0}{max=-1}{super="generic/widget_definition/resolution"}
|
||||
* @begin{tag}{name="state_enabled"}{min=0}{max=1}{super="generic/state"}
|
||||
* @end{tag}{name="state_enabled"}
|
||||
|
@ -221,13 +221,13 @@ tcombobox_definition::tcombobox_definition(const config& cfg)
|
|||
* @begin{tag}{name="state_focused"}{min=0}{max=1}{super="generic/state"}
|
||||
* @end{tag}{name="state_focused"}
|
||||
* @end{tag}{name="resolution"}
|
||||
* @end{tag}{name="combobox_definition"}
|
||||
* @end{tag}{name="menu_button_definition"}
|
||||
* @end{parent}{name="gui/"}
|
||||
*/
|
||||
tcombobox_definition::tresolution::tresolution(const config& cfg)
|
||||
tmenu_button_definition::tresolution::tresolution(const config& cfg)
|
||||
: tresolution_definition_(cfg)
|
||||
{
|
||||
// Note the order should be the same as the enum tstate in combobox.hpp.
|
||||
// Note the order should be the same as the enum tstate in menu_button.hpp.
|
||||
state.push_back(tstate_definition(cfg.child("state_enabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_disabled")));
|
||||
state.push_back(tstate_definition(cfg.child("state_pressed")));
|
||||
|
@ -237,46 +237,46 @@ tcombobox_definition::tresolution::tresolution(const config& cfg)
|
|||
// }---------- BUILDER -----------{
|
||||
|
||||
/*WIKI_MACRO
|
||||
* @begin{macro}{combobox_description}
|
||||
* @begin{macro}{menu_button_description}
|
||||
*
|
||||
* A combobox is a control to choose an element from a list of elements.
|
||||
* A menu_button is a control to choose an element from a list of elements.
|
||||
* @end{macro}
|
||||
*/
|
||||
|
||||
/*WIKI
|
||||
* @page = GUIWidgetInstanceWML
|
||||
* @order = 2_combobox
|
||||
* @order = 2_menu_button
|
||||
* @begin{parent}{name="gui/window/resolution/grid/row/column/"}
|
||||
* @begin{tag}{name="combobox"}{min=0}{max=-1}{super="generic/widget_instance"}
|
||||
* == combobox ==
|
||||
* @begin{tag}{name="menu_button"}{min=0}{max=-1}{super="generic/widget_instance"}
|
||||
* == menu_button ==
|
||||
*
|
||||
* @macro = combobox_description
|
||||
* @macro = menu_button_description
|
||||
*
|
||||
* Instance of a combobox. When a combobox has a return value it sets the
|
||||
* Instance of a menu_button. When a menu_button has a return value it sets the
|
||||
* return value for the window. Normally this closes the window and returns
|
||||
* this value to the caller. The return value can either be defined by the
|
||||
* user or determined from the id of the combobox. The return value has a
|
||||
* user or determined from the id of the menu_button. The return value has a
|
||||
* higher precedence as the one defined by the id. (Of course it's weird to
|
||||
* give a combobox an id and then override its return value.)
|
||||
* give a menu_button an id and then override its return value.)
|
||||
*
|
||||
* When the combobox doesn't have a standard id, but you still want to use the
|
||||
* When the menu_button doesn't have a standard id, but you still want to use the
|
||||
* return value of that id, use return_value_id instead. This has a higher
|
||||
* precedence as return_value.
|
||||
*
|
||||
* List with the combobox specific variables:
|
||||
* List with the menu_button specific variables:
|
||||
* @begin{table}{config}
|
||||
* return_value_id & string & "" & The return value id. $
|
||||
* return_value & int & 0 & The return value. $
|
||||
*
|
||||
* @end{table}
|
||||
* @end{tag}{name="combobox"}
|
||||
* @end{tag}{name="menu_button"}
|
||||
* @end{parent}{name="gui/window/resolution/grid/row/column/"}
|
||||
*/
|
||||
|
||||
namespace implementation
|
||||
{
|
||||
|
||||
tbuilder_combobox::tbuilder_combobox(const config& cfg)
|
||||
tbuilder_menu_button::tbuilder_menu_button(const config& cfg)
|
||||
: tbuilder_control(cfg)
|
||||
, retval_id_(cfg["return_value_id"])
|
||||
, retval_(cfg["return_value"])
|
||||
|
@ -287,9 +287,9 @@ tbuilder_combobox::tbuilder_combobox(const config& cfg)
|
|||
}
|
||||
}
|
||||
|
||||
twidget* tbuilder_combobox::build() const
|
||||
twidget* tbuilder_menu_button::build() const
|
||||
{
|
||||
tcombobox* widget = new tcombobox();
|
||||
tmenu_button* widget = new tmenu_button();
|
||||
|
||||
init_control(widget);
|
||||
|
||||
|
@ -297,7 +297,7 @@ twidget* tbuilder_combobox::build() const
|
|||
if(!options_.empty()) {
|
||||
widget->set_values(options_);
|
||||
}
|
||||
DBG_GUI_G << "Window builder: placed combobox '" << id
|
||||
DBG_GUI_G << "Window builder: placed menu_button '" << id
|
||||
<< "' with definition '" << definition << "'.\n";
|
||||
|
||||
return widget;
|
|
@ -30,10 +30,10 @@ namespace gui2
|
|||
/**
|
||||
* Simple push button.
|
||||
*/
|
||||
class tcombobox : public tcontrol, public tselectable_
|
||||
class tmenu_button : public tcontrol, public tselectable_
|
||||
{
|
||||
public:
|
||||
tcombobox();
|
||||
tmenu_button();
|
||||
|
||||
/***** ***** ***** ***** Inherited ***** ***** ***** *****/
|
||||
|
||||
|
@ -148,9 +148,9 @@ private:
|
|||
|
||||
// }---------- DEFINITION ---------{
|
||||
|
||||
struct tcombobox_definition : public tcontrol_definition
|
||||
struct tmenu_button_definition : public tcontrol_definition
|
||||
{
|
||||
explicit tcombobox_definition(const config& cfg);
|
||||
explicit tmenu_button_definition(const config& cfg);
|
||||
|
||||
struct tresolution : public tresolution_definition_
|
||||
{
|
||||
|
@ -165,10 +165,10 @@ class tcontrol;
|
|||
namespace implementation
|
||||
{
|
||||
|
||||
struct tbuilder_combobox : public tbuilder_control
|
||||
struct tbuilder_menu_button : public tbuilder_control
|
||||
{
|
||||
public:
|
||||
explicit tbuilder_combobox(const config& cfg);
|
||||
explicit tbuilder_menu_button(const config& cfg);
|
||||
|
||||
using tbuilder_control::build;
|
||||
|
Loading…
Add table
Reference in a new issue