When a dialog is shown or resized and the mouse pointer is above the
widget the engine didn't send and mouse enter event. This partly fixes
bug #12927.
At the moment widget have an coordinate in the parent window and on the
screen. After the changes to the drawing engine the coordinate in the
parent window is not really needed anymore. So we can do several
refactoring and cleanup steps.
Remove the old coordinates and use the sceen coordinates everywhere.
Items in a scrollbar container which are not visible are no longer
redrawn even it they're dirty. (This was observed if a language which
was selected and scrolled out of sight still showed up when deselected.)
Items that are partly visible are still fully redrawn, this will be
addressed later.
Widget can now be shown, hidden or be invisible. The invisible state
also makes a widget not to use any space, which will allow to optimize
the scrollbars away when not needed.
Initial tests show that NEW_DRAW works reasonable so make it the default
and remove the old cruft. This commit cleans up the code side, WML side
will follow in a separate commit.
...-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
For semi transparent dialogs it's important the background is also
restored before redrawing that part of the window. Otherwise the
semitransparent area will add to itself and darken the area.
The new engine draws in layers like the units and terrains. The engine
is not ready for genaral usage and is enabled by adding -DNEW_DRAW to
the compiler. Most normal widgets (except the minimap) already work.
Scrollbar containers don't work yet, since they need a redesign.
This debug option can output dot files which can be transformed to
images so it's easier to get debug info about the widgets in a
window. This function is enabled by the --enable-debug-window-layout
configure switch. It has not been implemented in the other build
systems yet. (Not sure whether or not it's needed.)
Easy close means a single click will close a window (if this is enabled
in the configs). Also convert the dialogs in the test scenario to use
this feature.
...and update buildsystems accordingly. This will force people using
custom builds (e.g. devcpp, codeblocks) to either add editor2 sources
or consciously disable it.
When a new widget dialog is shown the colour cursor location only got
updated if a widget was dirtied. Fixed the problem by forcing a cursor
update if no widget is dirty. The problem was spotted by suokko.
Now that all 'stable' --new-widgets code has been moved to the default way
starting with --new-widgets is no longer needed unless you want to develop for
it. So the new proof-of-concept title screen can be committed. Only has the
basic buttons which work, but needs some cleanup up, both in looks and code
working.