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.
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.
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.
- 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.
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.)
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.
...-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
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.