Commit graph

31 commits

Author SHA1 Message Date
Mark de Wever
62ed384d10 Add a register_text2 function.
The original version has an optional flag the new version a
mandatory flag. The latter feels better. At some point all register
functions need to be changed.
2011-03-13 07:49:38 +00:00
Mark de Wever
8d5b387138 Add a register_bool2 function.
The original version has an optional flag the new version a mandatory
flag. The latter feels better. At some point all register functions need
to be changed.
2011-03-13 07:49:32 +00:00
Mark de Wever
b8f9670eee Add register functions to the dialog.
The functions added allow to register images and labels.
2011-03-13 07:49:27 +00:00
Mark de Wever
1ab34120c9 Add a new register_text function.
This version also allows to set the focus to a widget. The goal is to
extend the number of helper functions so less pre and post show
functions are needed.
2011-03-13 07:49:06 +00:00
Mark de Wever
596a4d3e22 Improve the dialogs.
- Allow the linked variable fields to be used.

- Let show return a status boolean.

Also wrote some documentation about how to improve dialog code. During a
code review saw a lot of small wrapper functions for setters and getters
of variables. The new idea is to send these variables per reference and
let the dialog update them so the caller only needs to check the execute
status. The next commit has an example of its usage the other dialogs
will be converted during their code review.
2011-03-05 13:54:27 +00:00
Mark de Wever
c64cb8776e Remove tdialog::show_tooltip.
The function is no longer needed, windows that should be shown non modal
need to inherit from tpopup. (Partly reverts 2011-02-03T20:43:52Z!koraq@xs4all.nl.)
2011-02-20 09:06:01 +00:00
Mark de Wever
a7c1d992d8 Add a tooltip mode for a dialog.
The code is still a bit experimental, but like to have it committed
before the FOSDEM.
2011-02-03 20:43:52 +00:00
Mark de Wever
ecbabea838 New year copyright update. 2011-01-01 15:57:50 +00:00
Guillaume Melquiond
eeb047de55 Fixed file headers so that they match the content of the COPYING file. 2010-09-01 21:12:38 +00:00
Mark de Wever
108afde220 Code polishing no functional changes. 2010-05-01 13:30:11 +00:00
Mark de Wever
867f52dc96 Let windows register themselves automatically.
This reduces the bindings between modules.
2010-03-26 14:48:35 +00:00
Mark de Wever
92f5f92ce5 New year copyright update. 2010-01-01 13:16:49 +00:00
Mark de Wever
ab9342904e Fix a compiler error. 2009-10-17 20:21:58 +00:00
Mark de Wever
ee5cee21f6 Fix double click event dispatching.
Soliton ran into the problem that when using his touchpad to double
click on a campaign it might directly select the difficulty and dismiss
the next dialog. When using a mouse the problem didn't occur.

The output of events for the mouse were:
Push DOUBLE_CLICK_EVENT.
Process DOUBLE_CLICK_EVENT.
Window dtor.

The output of events for the touchpad were:
Push DOUBLE_CLICK_EVENT.
Window dtor.
Process DOUBLE_CLICK_EVENT.

This explains why the events are send to the next dialog. It doesn't
explain why it happens, but that might be the touchpad driver or OS.

The problem is solved by removing the extra events after closing the
dialog. Avoiding the events to be generated is tricky since a gui2
dialog can open a gui1 one, when that happens double clicks need to be
enabled temporary and then again disabled when that dialog closes.
2009-10-17 20:12:10 +00:00
Mark de Wever
5af294d470 Make sure a dialog is not shown on a faked screen.
cjhopman discovered the problem when running Wesnoth with --no-gui.
2009-05-31 06:00:26 +00:00
Mark de Wever
692e5f78bc Add the autoclose feature for dialogs/windows.
This might not be really useful for normal usage, but allows the
unit tests to show a window. (This will be implemented later.)
2009-04-30 20:56:41 +00:00
Ignacio R. Morelle
50e4162272 You Fail at Copy-Paste, part 2. 2009-04-12 23:48:53 +00:00
Mark de Wever
27a0c47800 Wiki cleanups.
Move the GUIWindowWML items to GUIWindowDefinitionWML...

...and added an initial header and footer.
2009-03-08 11:51:40 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Nils Kneuper
c84f995e88 add declarations of the textdomain to all files from the domains...
...-lib and -test even if they got no translateable strings the
declaration is done via this define: #define GETTEXT_DOMAIN
"wesnoth-lib" a short "how to get .cpp files translated" is left in
src/gettext.hpp
2008-12-28 21:40:02 +00:00
Mark de Wever
90a090ac76 Let the window builder return a pointer.
The current design of twindow (and some other widget classes) have the
problem that they shouldn't be copied. The code doesn't copy the
objects as long as the compiler does a return value optimization,
which indicates a bad class design. By turning the return value into a
pointer the copying is no longer needed.
2008-12-25 14:36:20 +00:00
Mark de Wever
f92ec60b51 Move tinteger_selector_ to its own header. 2008-11-27 17:41:18 +00:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Mark de Wever
f9a15e6f0e Move all log macros for the widget library to log.hpp. 2008-09-28 14:46:18 +00:00
Mark de Wever
be54f822a0 Make the restore of the window background conditionally. 2008-08-24 18:25:23 +00:00
Mark de Wever
bafcd9cdb5 Revert 2008-08-24T18:17:56Z!koraq@xs4all.nl, too much code was committed.
Forgot to do a partial commit after a failed commit :/
2008-08-24 18:23:52 +00:00
Mark de Wever
918e77a789 Make the restore of the window background conditionally. 2008-08-24 18:17:56 +00:00
Mark de Wever
5420ef0ba1 Fix invalid log domains, spotted by ilor. 2008-08-12 20:31:04 +00:00
Mark de Wever
10840e969c Move the return values from tbutton to twindow, where it belongs. 2008-08-06 12:27:03 +00:00
Mark de Wever
a125396585 Add a new method to more automatically handle fields in a dialog.
Converted the tmp_connect dialog to use this new method.
2008-07-25 16:16:49 +00:00
Mark de Wever
5693ac8027 Oops forgot to add the dialog files. 2008-06-10 21:40:19 +00:00