100 Commits

Author SHA1 Message Date
Mark de Wever
b12ac11399 Properly set the cursor when opening a dialog.
Fixes bug #12961.
2009-03-01 11:01:33 +00:00
Mark de Wever
d39a649b21 Made the tooltips 'work' again.
Added a bit hacky code for 1.6, which needs to be cleanup later. Doing
it properly is a bit too intrusive for 1.6.
2009-03-01 09:40:47 +00:00
Mark de Wever
b6f49e0ff8 Allow widgets to get the same size.
This is an initial implementation, it still needs quite some extra work,
which will be postponed until 1.7.
2009-02-28 11:43:56 +00:00
Ali El Gariani
54ed6fd54f Mainly revert 2009-02-20T16:40:51Z!alinkmaze@gmail.com...
...(problem with fake screen) but keep the small optimization
2009-02-21 15:48:02 +00:00
Ali El Gariani
2e12324a38 Add a new function get_screen_portion,
...slightly better than get_surface_portion and use it for old and new
dialogs, haloes and sidebar.
2009-02-20 16:40:51 +00:00
Ali El Gariani
4c68555ae0 Small optimization of the new dialogs.
Skip useless RLE and Alpha for the screen restorer.
2009-02-20 15:49:05 +00:00
Mark de Wever
d184c47fe8 Evaluate the mouse focus upon showing and resizing.
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.
2009-02-17 20:41:49 +00:00
Mark de Wever
57b7287741 Disable the escape in some dialogs.
Like the old dialogs disable the escape when a textbox or input list is
shown.
2009-02-02 21:35:02 +00:00
Mark de Wever
f8c7098f2f Cleanup part 3.
twindow::get_client_rect() can now use the version in tpanel...

...and thus can be removed from window.?pp.
2009-01-03 15:45:29 +00:00
Mark de Wever
fdb603b505 Cleanup part 2.
Rename the screen_foo to foo (partly reverts part 1).
2009-01-03 15:45:25 +00:00
Mark de Wever
f7095fa824 Code cleanup step 1.
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.
2009-01-03 15:45:20 +00:00
Mark de Wever
59b69b4e8d Updated some comment and debug code. 2009-01-02 20:11:05 +00:00
Mark de Wever
3f22df9daa Fixed a division by 0 in the sunset code.
Using a coloured cursor without sunset set caused a division by 0.
(Fixes bug #12806.)
2009-01-02 13:42:48 +00:00
Mark de Wever
4af0181638 Added the sunset feature to the new dialogs.
The sunset feature is used to see which part of a dialog is redrawn.
2009-01-01 18:35:16 +00:00
Mark de Wever
35003295be Spacebar closes dialogs without a scrollbar again. 2009-01-01 15:50:21 +00:00
Mark de Wever
a274e8b591 Remove obsolete resized_ member.
The need_layout_ member can be used instead so no need for two members
for the same purpose.
2009-01-01 15:50:13 +00:00
Mark de Wever
973a0a7d5c Remove trailing whitespace. 2009-01-01 10:28:26 +00:00
Mark de Wever
a5d1d2e969 New year copyright update. 2009-01-01 10:27:41 +00:00
Mark de Wever
ebe8ffb77b Fixed the listbox out of bounds drawing. 2009-01-01 01:03:34 +00:00
Mark de Wever
1dc9b572e2 Add better draw support for invisible items.
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.
2009-01-01 01:03:21 +00:00
Mark de Wever
ebcd530e27 Fix a small error in my previous commit. 2008-12-31 19:23:05 +00:00
Mark de Wever
d96b6fa571 Add some helper functions for the widgets.
These functions make getting the sizes and origin of a widget easier.
2008-12-31 12:54:49 +00:00
Mark de Wever
1a138d7505 Reimplement the visibility of widgets.
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.
2008-12-29 21:39:04 +00:00
Mark de Wever
c2368c2b61 Make NEW_DRAW unconditionally, code side.
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.
2008-12-29 08:51:28 +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
e14a3b8fb7 Make the debug layout domains working. 2008-12-28 13:10:56 +00:00
Mark de Wever
bdd600d006 Remove trailing whitespace. 2008-12-25 14:52:20 +00:00
Mark de Wever
fa16daecf7 Properly redraw dialogs.
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.
2008-12-24 23:33:22 +00:00
Mark de Wever
1551704bc3 First steps for the new drawing engine.
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.
2008-12-07 18:54:32 +00:00
Mark de Wever
19478dd3ba Export the easy_close status.
Other classes want to query this status in the future.
2008-11-24 19:54:30 +00:00
Mark de Wever
db6036c6e1 Rewrote the layout algorithm for the new widgets.
This rewrite disables, the not so good working, wrapping. This will be
fixed later also some cleaning up has been postponed.
2008-11-22 20:42:19 +00:00
Mark de Wever
9c1e36145c Add a new debug class for the widgets.
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.)
2008-11-10 20:01:25 +00:00
Eric S. Raymond
9223460daa Remove unused headers. 2008-11-09 04:35:13 +00:00
Mark de Wever
6f07fa5c58 Add the get_screen_size_variables function.
A small refactoring, other places will need the same object soon. Also
changed to only place where this was used.
2008-11-01 16:43:12 +00:00
Mark de Wever
b08ae9ce97 Make sure all widgets have a parent. 2008-10-31 18:45:25 +00:00
Mark de Wever
c89168bf0e Add the easy close code to the window.
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.
2008-10-31 18:45:14 +00:00
Mark de Wever
f2d3cef13f Fix the language dialog.
The 'fix' is bit ugly and needs a proper fix later on.
2008-10-29 20:07:22 +00:00
Mark de Wever
a36e1ee696 Add text wrapping.
The layout engine now first tries to wrap some text if too wide before
trying to use scrollbars.
2008-10-11 17:04:18 +00:00
Mark de Wever
6329273f9e Logging improvements.
Moved the layout logging to the gui_layout domain and added move verbose
debug logging.
2008-10-11 17:04: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
Pauli Nieminen
715b7d031b Fixed signed/unsigned comparision warnings 2008-09-11 12:34:33 +00:00
Mark de Wever
cd97e3f4f0 Fix some redraw problems with invalidate_layout().
The next draw didn't undraw itself properly. Also discovered undrawing
fails if the area used shrinks, since only the new area is properly
updated.
2008-09-07 19:53:49 +00:00
Tomasz Śniatowski
d553c9d313 change #ifdef USE_EDITOR2 to #ifndef DISABLE_EDITOR2...
...and update buildsystems accordingly. This will force people using
custom builds (e.g. devcpp, codeblocks) to either add editor2 sources
or consciously disable it.
2008-09-05 14:32:24 +01:00
Mark de Wever
5ca875af4c Fix colour cursor lagging.
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.
2008-08-25 20:26:15 +00:00
Mark de Wever
a5abf58f2c Add a new title screen.
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.
2008-08-24 19:27:53 +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
ab7cefafb6 Before we create a toplevel twindow the screen size needs to be reevaluated,
the user might have resized the main window, when no twindow was active.
2008-08-19 06:07:43 +00:00
Mark de Wever
b6440d68ee Fix a redraw glitch upon resizing the window. 2008-08-18 16:45:11 +00:00
Mark de Wever
6a07bc3706 Fix the foreground drawing, which was broken in the previous commit. 2008-08-18 15:53:23 +00:00