Mark de Wever
2ac841c8f2
Make the drawing be event driven instead of a delayed loop.
2008-08-18 15:35:54 +00:00
Mark de Wever
6db93aa7c1
Allow the window size if not automatically placed to depend on the window size.
2008-08-17 17:31:19 +00:00
Mark de Wever
b671ce052d
Code and comment cleanup.
2008-08-17 13:40:23 +00:00
Mark de Wever
27c4042564
Hack to make the floating labels work again in the editor,
...
...it does fail in the test scenario since the window there is big and
transparent. Since it's really needed for the editor this hack does
suffice. NOTE there are glitches if the border of the dialog is
partial on a label (same cause which breaks the test scenario).
2008-08-16 14:51:15 +00:00
Mark de Wever
c5652e0034
Valgrind discovered some memory leaks.
...
The reference_counted objects aren't stored in a intrusive_ptr so
don't cleanup themselves.
This commit fixes tresolution_ and subclasses.
2008-08-14 16:03:37 +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
ef61e6fc8a
First step into making a better determination of the best size...
...
...for a dialog in case a resizable element is longer as
wanted. (Still needs improvements.)
2008-07-27 11:31:42 +00:00
Mark de Wever
7240329b26
Since the window loads its definition during its construction...
...
...it also needs to know its definition, so that's sent to the
constructor as well. Now the window does honour the requested
definition.
2008-06-24 19:20:59 +00:00
Mark de Wever
2a82b841da
Enter/return and escape now close the window.
2008-06-24 05:45:34 +00:00
Mark de Wever
0c8f478c61
Rename twidget::dirty() to twidget::is_dirty().
2008-06-23 20:16:07 +00:00
Mark de Wever
e8b1280a7b
[[drawing code fixes]]
...
* Rewrote the drawing code to be able to force a redraw and to invalidate the
background. This fixes the ttoggle_panel redraw problems.
* Removed the no_redraw label hack
* Updated the WIKI comment blocks to fix some typos and add some forgotten info.
2008-06-23 16:32:37 +00:00
Mark de Wever
da52d12f07
Add a dialog() function so a widget can find the dialog that owns it.
...
This is needed to allow callbacks call dialog methods.
2008-06-10 21:27:15 +00:00
Jérôme Brongniart
6081ed7267
correct compiler warning (mainly bad unsigned and int comparaisons)
2008-06-01 21:01:29 +00:00
Mark de Wever
66c207f801
Refactoring:
...
* Rename get_widget_by_id and get widget both to find_widget.
* Add an extra flag to these functions to only find active widgets.
* Add const version for all of them.
* Mouse events now only find active widgets.
2008-05-18 06:05:59 +00:00
Mark de Wever
7b1312dfb6
All widget used the default defintion due to a bug, this has been fixed.
2008-05-17 07:18:31 +00:00
Mark de Wever
c9a4e89bbd
Move the size calculation from the builder to the window,
...
...this way it can be recalculated if needed. (This is required for
listboxes).
Fix a few definition typos in comments.
2008-05-11 09:47:49 +00:00
Mark de Wever
3352e5d73f
Remove some unneeded includes.
2008-05-03 15:10:39 +00:00
Mark de Wever
1782658a29
Add the settings section for the gui.
2008-05-01 13:52:24 +00:00
Mark de Wever
2c3d8719f2
Some small cleanups.
2008-04-30 18:28:09 +00:00
Mark de Wever
7c3c8ee00f
Move the drawing in its own function,
...
...since get_rect() returns the screen coordinates we can't inherit
the panel function.
2008-04-30 13:38:03 +00:00
Mark de Wever
2e7b554e10
Only allow set_size() to modify the size of a widget.
2008-04-30 12:31:51 +00:00
Mark de Wever
35e48eba8a
More refactoring, the window definition now inherits from the panel definition.
...
The window now uses the canvasses as defined in the control.
2008-04-30 10:16:55 +00:00
Mark de Wever
a8fb9e9d9a
tpanel now has its own defintion and part of twindow moved to tpanel.
...
More refactoring still required.
2008-04-30 09:43:54 +00:00
Mark de Wever
07df021d5b
load_config() should be called in the constructor.
2008-04-29 17:18:33 +00:00
Mark de Wever
61f7ff6168
Make the window defintion also more general.
...
Make text_font_size no longer mandatory.
2008-04-28 16:10:27 +00:00
Moritz Göbelbecker
ab74a6bc3c
Move blit_surface from gui/widgets/helper.cpp to sdl_utils.cpp
2008-04-27 20:33:19 +00:00
Mark de Wever
2fc5ea5d67
Make colour cursors work in the widget library,
...
...the problem was discovered by Ivanovic.
2008-04-24 18:37:18 +00:00
Mark de Wever
724143e019
Remove a not needed variable.
2008-04-17 06:07:01 +00:00
Mark de Wever
cfc6417f68
Wrote a replacement for SDL_BlitSurface...
...
...which allows blitting of transparent surfaces on top of
each other. It's not optimized with assembly code like the normal
SDL_BlitSurface so might be a bit slower.
2008-04-16 17:21:12 +00:00
Mark de Wever
a1cbcd5a49
Rather large changeset, the primary change is allowing tooltips...
...
...and help messageto be shown. Secondary changes are:
- moving hovering in tcontrol instead of the widgets.
- make the visible flag working for drawing.
- small refactoring of the window_builder class.
2008-04-13 10:11:14 +00:00
Mark de Wever
aedd35f93e
Mark twindow::get_client_rect() as const.
2008-04-12 17:43:06 +00:00
Mark de Wever
fc6d047c13
Converted the entire widget toolkit to use the new LOG_STREAM_INDENT instead of
...
LOG_STREAM.
2008-04-08 21:00:41 +00:00
Mark de Wever
8d2a2a6d54
Another refactoring.
...
- remove set_best_size()
- move more code in tcontrol.
2008-04-08 16:04:03 +00:00
Mark de Wever
0f420d967a
Started to implement the grid flags:
...
- panel no longer decends from a grid but contains one, give less problems with
the functions with the same name.
- flags are read from the .cfg file.
Still more testing and some cleaning up is required.
2008-04-07 18:16:30 +00:00
Mark de Wever
7fb7a01d26
Small cleanup.
...
- Added some comment.
- Made a separate function to update the canvasses.
2008-04-06 08:41:23 +00:00
Mark de Wever
c795501f64
Proof of concept; to use buttons to return a value for a dialog.
2008-04-05 09:31:33 +00:00
Mark de Wever
87705e8d94
Let tevent_handler derive from events::handler...
...
...and twindow derive from tevent_handler instead of
events::handler. This means that the event handling is now done in
tevent_handler instead of in twindow.
2008-03-24 07:24:25 +00:00
Mark de Wever
1de1bca43e
Rename tevent_info to tevent_handler.
2008-03-23 21:52:20 +00:00
Mark de Wever
a8c422af6c
Move the event handling stuff out of the twindow class into a the
...
tevent_info class. More modifications will follow.
2008-03-23 18:15:37 +00:00
Mark de Wever
b6d222a683
Moved the tsizer class to grid.?pp and renamed it to tgrid.
2008-03-16 14:04:18 +00:00
Mark de Wever
f2b701c996
Add some more debug domains in the gui area...
...
...(changes to log.?pp aren't committed).
2008-03-16 13:37:43 +00:00
Mark de Wever
340d1531ac
Turn all widths and heights into unsigned...
...
...and make a const parameter a reference instead of a copy.
2008-03-15 22:46:25 +00:00
Mark de Wever
e4c1da3ec6
Added proof-of-concept code to do the window drawing,
...
...the window can now draw it's own contents and the closing now
properly cleans up.
2008-03-15 21:35:00 +00:00
Mark de Wever
19db0ef00b
Make the library resize aware.
2008-03-12 19:12:39 +00:00
Mark de Wever
a2113d679d
Avoid drawing a container without a widget, which lead to a crash.
2008-03-12 18:17:08 +00:00
Mark de Wever
795787c6f6
Make the drawing of the button now react on a press or mouse over.
2008-03-12 17:32:06 +00:00
Mark de Wever
85661240b1
Added some rudimentary mouse handling support.
2008-03-11 19:35:49 +00:00
Benoît Timbert
584c664cba
Fix some svn properties (eol style=native; keyword substitution)
2008-03-09 16:41:10 +00:00
Mark de Wever
7fdb20fd62
Various improvements in order to make the automatic layout of a window...
...
...and its children work.
2008-03-09 12:34:16 +00:00
Mark de Wever
53c0a11d2b
Initial checkin of the work in progress gui library.
...
The code _isn't_ wired in the Makefiles since it's a wip project, the
code doesn't touch mainline code so forking a branch isn't
required. Forking might be done later if intrusive changes to the main
code is required, but I think it can be marged in a non-intrusive way.
2008-03-09 07:40:41 +00:00