- Support for multimenu buttons
- Support for selecting multiple items in listboxes and stacked widgets
GUI2 C++ API:
- Documentation fixups
- Function to test if a layer of a stacked_widget is selected
- Function to test if a row of a listbox is selected
- listbox::select_row now returns false if it failed to select/deselect anything
- Functions to count and select options of a multimenu_button
- multimenu_button now always has keep_open, so the function to set it is removed
- multimenu_button now assumes every option has a toggle
although stacked_widget supports similar functionality this is currently
not easily doable from the lua gui2 api. In particular
1) stacked_widget cannot add pages dynamically
2) multi_page can only contain one type of widget.
3) a stacked_widget inside a multi_page is ineffective since it
generates many unused widgets
4) a multi_page inside a stacked_widget is just unhandy to use
Any click on a row with a toggle button will now toggle that row's button prior to closing the dialog, unless the
keep_open flag was set, in which case the click will toggle the button but the dialog will not close.
Clicks directly on the toggle buttons themselves are unchanged.
Change all includes to start at the base instead of assuming the directory where included from.
This makes it more apparent exactly which header has been included, since many have the same name.
This also allows moving all header files out of the src directory.
Lua deprecated luaL_typerror. Wesnoth needs it. Traditionally this was handled as a by-hand edit to the Lua source kit. Refactored into Wesnoth as luaW_type_error.
An extension of af73336, hopefully this will remove some more of the warnings which pop up in MSVC compilation. Also try to use more explanatory variable names as code should generally be self-documenting and easy to read.
Some explanations:
- savepng uses setjmp, so I changed it to C; this guarantees that someone does not accidentally introduce a C++ object in it (unlikely though that is)
- The loop in multiplayer.cpp seemed intended to allow the command-line to request repeated plays, so the break was removed rather than refactoring it to an if statement
- Some uninitialized structs were changed to be zero-initialized
- Use luaW_toboolean instead of lua_toboolean
- Needed explicit constructor for vconfig iterators, since their only member is const
This commit converts the following function calls:
* boost::bind -> std::bind
* boost::function and boost::functionN -> std::function
* boost::ref and boost::cref -> std::ref and std::cref
* boost::bad_function_call -> std::bad_function_call
In the process, it was discovered that std::bind has trouble with overloaded
functions. There were two such cases in the code:
* gui2::twindow had an ancient unused overload to draw(). The overload was removed.
* gui2::trepeating_button was binding tdispatcher::fire. This case was converted
to a lambda.
This partly reverts
68d20d8409
so that not get_dialog_value only returns a number for toggle panels if
the toggle panel/button has more than 2 states.
This commit was made for more backwards compability.