Commit graph

120 commits

Author SHA1 Message Date
Charles Dang
3236d0d8bf Don't copy-initialize SDL_Rects (or arrays of rects) 2017-04-25 04:27:09 +11:00
Celtic Minstrel
22980629f7 Fixup 1954bb67b 2017-04-21 15:45:38 -04:00
Celtic Minstrel
8923978c70 Squash some MSVC warnings 2017-04-19 04:08:10 -04:00
Celtic Minstrel
1954bb67b4 Lua GUI2: A few additions
- 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
2017-04-18 14:26:29 -04:00
Celtic Minstrel
3c5a9aa57c Some style/formatting cleanup 2017-04-18 14:26:28 -04:00
Celtic Minstrel
3802fda221 Rename some labels to be more explanatory 2017-04-18 14:26:26 -04:00
gfgtdf
75c21815f6 allow multi_page to contain differnt types of pages
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
2017-04-12 15:14:58 +02:00
gfgtdf
4608c2d368 wesnoth.set_dialog_value can now unfold treeview nodes (#978) 2017-04-11 03:59:22 +02:00
Charles Dang
a4647b5300 Styled Widget: renamed multi-canvas getter get_canvases()
The single-canvas getter remains, and I deployed it in a few cases where multi-canvas fetching doesn't make sense.
2017-03-22 02:13:29 +11:00
Celtic Minstrel
b4dc11ce36 Belated 2017 copyright update 2017-03-19 10:05:38 -04:00
Charles Dang
84903c99d2 Drop Down Menu: several improvements to embedded toggle button handling
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.
2017-02-17 08:22:07 +11:00
gfgtdf
283fd32077 remove added widget definitions on lua kernel destruction. 2016-12-07 04:10:11 +01:00
gfgtdf
118d18ec7a add lua add_widget_definition function
http://gna.org/bugs/?25337
2016-12-07 04:10:10 +01:00
Celtic Minstrel
67ea79d86f Rename some GUI2 files to match the contained class 2016-11-19 17:16:10 -05:00
Gregory A Lundberg
d31555f8cf Pedantic includes
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.
2016-11-11 11:00:22 -06:00
Charles Dang
5872f52879 Fix some missed rename instances and wrong widget/window IDs 2016-11-10 11:04:09 -05:00
Celtic Minstrel
3da8a27ae7 Fix unit tests 2016-11-09 12:52:41 -05:00
Celtic Minstrel
b6c88df9e7 Final sweep of renames to drop t- prefix 2016-11-09 01:28:24 -05:00
Celtic Minstrel
10b6a34615 Rename all GUI2 dialogs to drop t- prefix
This also places them in a new dialogs namespace.
2016-11-09 01:27:30 -05:00
Celtic Minstrel
3c0470ad93 Rename GUI2 auxiliary types to avoid t- prefix 2016-11-09 01:27:30 -05:00
Celtic Minstrel
c09125096b Rename GUI2 widget classes to drop t- prefix 2016-11-09 01:27:30 -05:00
Celtic Minstrel
f9609c4bb1 Rename GUI2 widget support classes to drop t- prefix 2016-11-09 01:24:25 -05:00
Celtic Minstrel
749f68716d Rename GUI2 canvas classes to avoid t- prefix 2016-11-09 01:17:14 -05:00
Gregory A Lundberg
36ab1f9a5c wesnoth.show_message_dialog: Don't expose has_input flag to Lua
Adjustment of PR 841 (as PR #843)
2016-10-26 00:51:38 -04:00
Gregory A Lundberg
9d08723236 [text_input] Fix bug 25173
Added an internal flag to indicate [text_input] appeared so we no longer require label= to be present.
2016-10-24 21:58:26 -05:00
Gregory A Lundberg
1528a8bb5a Refactor luaL_typerror
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.
2016-10-10 10:19:41 -05:00
Wedge009
2e9a9fc2c9 Avoid hidden variable warnings produced in MSVC compilation.
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.
2016-10-06 19:56:29 +11:00
Celtic Minstrel
0180a72573 Fix lots of warnings in MSVC12
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
2016-09-06 17:55:00 -04:00
Celtic Minstrel
144ce315c3 Lua GUI2: Support stacked widgets and unit preview pane, and add show_menu function 2016-08-28 00:24:19 -04:00
Celtic Minstrel
b1141fe457 Allow the WML message dialog to show a portrait on both sides 2016-08-25 15:57:45 -04:00
Celtic Minstrel
404568c212 Fix gamestate inspector unit tests 2016-08-24 23:18:07 -04:00
Celtic Minstrel
30b7ab8b2d Reduce use of const_cast 2016-08-20 20:38:46 -04:00
Celtic Minstrel
1521f326df Move Lua unit wrapper to own file 2016-08-20 20:38:46 -04:00
Celtic Minstrel
d5a78dfcd0 Redesign gamestate inspector window 2016-08-20 02:52:11 -04:00
Celtic Minstrel
43f5deaaf0 Rename potentially ambiguous function 2016-08-20 02:52:11 -04:00
Charles Dang
82973000a0 Convert gui2::tvisible and gui2::tredraw_action to scoped enums 2016-07-29 23:22:54 -04:00
Charles Dang
0ca4e6c943 Convert uses of boost functional to standard library variants
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.
2016-04-04 02:20:52 +11:00
Celtic Minstrel
3ac7f8d970 NULL -> nullptr
A few cases of NULL were missed, since changing them led to errors
(Mainly instances where it was passed to a boost::function)
2016-03-31 00:42:38 -04:00
Celtic Minstrel
6307b9459c Move most of gui/auxiliary to gui/core to reflect its true nature 2016-03-20 23:18:48 -04:00
Celtic Minstrel
2900f1cb38 Better deprecation message for new DescriptionWML 2016-03-20 00:26:14 -04:00
Charles Dang
6a636dcd1c Fixup b6d89addd3 2016-01-28 19:32:16 +11:00
gfgtdf
b6d89addd3 fix widget not redrawing after wesnoth.set_dialog_canvas 2016-01-28 02:02:48 +01:00
gfgtdf
c978954a43 revert to get_dialog_value retuning bools for togglebuttons
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.
2016-01-28 02:02:44 +01:00
gfgtdf
68d20d8409 lua gui get/set_dialog_value take numbers for tselectable_
This adds lua support for tristate buttons and comboboxes.
2016-01-20 17:44:20 +01:00
gfgtdf
2369d3f9ae clenaup more includes
this changes some class member types to scoped pointer so that we can
remove an include from the header.
2016-01-16 23:42:02 +01:00
Chris Beck
ba51524f6e update copyright to year 2016
using this shell script:

find src -type f -print0 | xargs -0 sed -i "s|Copyright (C) \([[:digit:]]*\)\([ ]*\)-\([ ]*\)2015|Copyright (C) \1\2-\32016|g"
2016-01-02 23:59:31 -05:00
Elvish_Hunter
9b7b1751fd Removed trailing tabs and whitespaces from C++ source
I used this command line: find <source directory> -name \*.\[ch\]pp -print0 | xargs -0 sed -i 's/[[:blank:]]*$//'
2015-12-21 20:39:46 +01:00
Celtic Minstrel
c12ccfa30b Lua API: Keep stack clean after gathering message dialog options 2015-10-10 12:43:34 -04:00
Celtic Minstrel
114b31c90c New syntax for [message][option]message= similar to new [campaign][difficulty] 2015-09-30 02:01:03 -04:00
Celtic Minstrel
7f7f0f48d5 Lua API: show_message_dialog now assumes options are translatable 2015-09-20 19:31:22 -04:00