187 Commits

Author SHA1 Message Date
Max Horn
9287ea8376 Patch #1926787: small memory leak and cleanup
svn-id: r31261
2008-03-27 11:06:29 +00:00
Johannes Schickel
75a5c41ab4 - starting to document the theme renderer
- Theme::closeDialog -> Theme::closeAllDialogs, since it would remove every dialog currently

svn-id: r29394
2007-11-04 00:30:53 +00:00
Nicola Mettifogo
258901bab9 Merged common/stdafx.h into common/scummsys.h. All referencing files have been updated.
svn-id: r28966
2007-09-19 08:40:12 +00:00
Max Horn
2243197f50 Changed GUI system to use Common::KeyState state
svn-id: r27786
2007-06-30 12:26:59 +00:00
Eugene Sandulenko
09ae91b118 Fix bugs mentioned in #1730147 "GUI: Classic themes need to be updated"
svn-id: r27061
2007-06-03 08:11:19 +00:00
Max Horn
218e132e37 Updated legal headers in source files, based on what Pidgin (the IM client formerly knowns as Gaim) does; added new (incomplete) COPYRIGHT file; updated copyright dates in a few spots
svn-id: r27024
2007-05-30 21:56:52 +00:00
Max Horn
ed02fb1443 Fix warning caused by not handling all enum values in a switch (caused by the newly added EVENT_PREDICTIVE_DIALOG constant)
svn-id: r27008
2007-05-29 21:35:13 +00:00
Johannes Schickel
86104e0bf0 Reverted r26922.
svn-id: r26967
2007-05-27 11:40:03 +00:00
Johannes Schickel
8ff17142c5 Simpilified Singleton implementation and usage.
svn-id: r26922
2007-05-22 14:17:44 +00:00
Johannes Schickel
e0b462b33b Fix for crash when trying to select an outdated/wrong theme config.
svn-id: r26670
2007-04-29 00:15:32 +00:00
Max Horn
ed54ea9155 Moved Event/EventType/keyboard enum from common/system.h (part of class OSystem) to common/events.h (part of namespace Common). Porters may have to make minor changes to their backends to get them to compile again
svn-id: r26180
2007-03-17 19:02:05 +00:00
Torbjörn Andersson
53624376b4 Applied my re-revised patch #1487149 ("Simplified keyboard repeat"), with
Fingolfin's blessings. Keyboard repeat is now handled by the event manager,
rather than by individual engines.

Since this can cause problems with some engines (see the AGI engine), the extra
"key down" events are marked as "synthetic", so that they can be ignored if
necessary.

svn-id: r26170
2007-03-17 15:44:26 +00:00
Max Horn
15d9bc42ea Force all code to use EventManager::pollEvent instead of OSystem::pollEvent
svn-id: r26156
2007-03-17 00:53:21 +00:00
Max Horn
a73c6c3670 Added new file gui/object.cpp (collecting GuiObject methods in there), and renamed Dialog::deleteWidget to Dialog::removeWidget (name was misleading, the removed object does *not* get deleted)
svn-id: r26147
2007-03-16 20:47:41 +00:00
Torbjörn Andersson
3bc0661065 Merged the "palette manager" into the cursor manager. It was only used to
manage *cursor* palettes, so the name was misleading.

svn-id: r25500
2007-02-12 00:04:56 +00:00
Johannes Schickel
dda1431e7c cleanup
svn-id: r25435
2007-02-09 00:06:54 +00:00
Johannes Schickel
956affd3d2 Moved definition of ThemeClassic and ThemeModern to their own files.
svn-id: r25432
2007-02-08 23:25:07 +00:00
Max Horn
f01f4eea98 Added NewGui::getTopDialog method
svn-id: r24938
2006-12-27 22:51:14 +00:00
Johannes Schickel
6e16df7891 - renamed GUI::ThemeNew to GUI::ThemeModern
- renamed ThemeNew.cpp to ThemeModern.cpp

svn-id: r24512
2006-10-25 21:20:31 +00:00
Johannes Schickel
055d80c4dc Formatting.
svn-id: r24511
2006-10-25 21:06:49 +00:00
Bertrand Augereau
312f4747d5 Compile fix when DISABLE_FANCY_THEMES is #defined
svn-id: r24510
2006-10-25 20:18:16 +00:00
Johannes Schickel
ab7bced4fd Final fix for wrong cursor palettes in SCUMM games after using the GUI.
svn-id: r24233
2006-10-08 20:37:39 +00:00
Johannes Schickel
cfe6d9725c Making engines working again.
svn-id: r24232
2006-10-08 20:19:23 +00:00
Johannes Schickel
e11bfe5f49 - reworked my commit for r24216, not 'Classic (Builtin)' uses the builtin classic theme and classic uses the classic.ini file
- save the chosen theme now

svn-id: r24222
2006-10-08 19:24:31 +00:00
Johannes Schickel
1ced1777f8 - Forcing 'classic' as the builtin classic theme (which means it ignores the classic.ini atm)
svn-id: r24216
2006-10-08 18:49:25 +00:00
Johannes Schickel
3a81941981 - Added dialog for selecting the theme to use
- Added runtime theme switching

svn-id: r24213
2006-10-08 18:22:28 +00:00
Johannes Schickel
25486c789e - added auto detection of the Theme style to use
- fixed a bug which would lead to a crash when loading the modern theme config with the classic theme

svn-id: r24201
2006-10-08 12:00:19 +00:00
Torbjörn Andersson
e9b9aa65a6 Whitespace.
svn-id: r23704
2006-08-12 16:42:19 +00:00
Max Horn
aab45bac44 Only refresh the theme & reflow all dialogs if the screen settings actually changed
svn-id: r23669
2006-08-04 18:11:00 +00:00
Max Horn
40835e42b9 There is no need anymore to report EVENT_SCREEN_CHANGED changes to the GUI code
svn-id: r23668
2006-08-04 18:01:43 +00:00
Max Horn
0485f76c8d Changed GUI code to do 'lazy'/'just-in-time' reflowing, so that client code doesn't have to forward EVENT_SCREEN_CHANGED to us (this may initially cause some regressions, please report any induced crashes or oddities you observe to me)
svn-id: r23663
2006-08-04 15:48:37 +00:00
Max Horn
1a10cacfb9 Renamed handleScreenChanged() -> reflowLayout() in the GUI code
svn-id: r23662
2006-08-04 13:55:53 +00:00
Max Horn
4fcdbb9349 String class usage cleanup
svn-id: r23582
2006-07-23 15:08:48 +00:00
Torbjörn Andersson
6358547a43 More whitespace changes.
svn-id: r23496
2006-07-14 13:33:58 +00:00
Torbjörn Andersson
50673f9f1f The top dialog can change during the event loop. In that case, flush all the
dialog-related events since they were probably generated while the old dialog
was still visible, and therefore note intended for the new one.

This hopefully fixes strange behaviour/crashes with pop-up widgets. (Most easy
to trigger in 3x mode or when running ScummVM under Valgrind.)

svn-id: r23141
2006-06-16 06:26:26 +00:00
Johannes Schickel
84b54c3173 - Adds 'THEME_HINT_NO_BACKGROUND_RESTORE' for buttons which don't want restored background (example: the tab scrolling buttons).
- Call _theme->drawAll() at the end of the redraw method of NewGui

svn-id: r23134
2006-06-15 14:25:59 +00:00
Torbjörn Andersson
3728e96b17 Disable the theme before restoring the cursor, not afterwards. Otherwise there
may be a noticeable amount of time (disabling the theme can be comparatively
slow) where the cursor is wrong.

svn-id: r23082
2006-06-13 09:57:16 +00:00
Johannes Schickel
15aee485ea - Removes (obsolete) USE_AUTO_SCALE define
- typo fix

svn-id: r22987
2006-06-08 19:43:37 +00:00
Max Horn
76116f36dd *Loads* of Common::String related optimizations. Woa, *tons* of methods were copying strings needlessly
svn-id: r22873
2006-06-03 13:33:39 +00:00
Torbjörn Andersson
ca84620745 When the screen changes, redraw all dialogs *immediately* rather than waiting
for the main loop to check for _needRedraw. Otherwise subsequent events can
cause widgets to be redrawn before the theme has had a chance to re-open the
dialogs, and this could cause at least the modern theme to crash.

svn-id: r22860
2006-06-03 10:48:37 +00:00
Torbjörn Andersson
7f1eafea96 Don't "tickle" a dialog until after it has had a chance to redraw itself,
otherwise it may be in an inconsistent state since the modern theme uses
openDialog() to allocate a surface as large as he dialog itself.

This fixes a crash when changing to a bigger scaler when the About dialog is
running.

svn-id: r22688
2006-05-27 22:57:00 +00:00
Eugene Sandulenko
b56c7b88d7 Major GUI update:
- Implemented padding in console
- Update only current line in console instead of whole screen
- Fixed caret positioning in edit text widget
- Improved buttons drawing, now they look more realistic
- Added label spacing in popup widget
- Correct shadow in popup widget
- Fixed up with selected popup widget being drawn on wrong tab
- Added shading to list dialog
- Adjusted shading of inactive widgets
- Proper coloring of browset (add game) dialog
- Introduced Container widget
- Used Container widget in scumm save/load dialog. Now it looks properly
- Adjusted button colors even more. Now they match almost perfectly albeit with banding
- Made scrollbar appear only when it is really needed

svn-id: r22670
2006-05-27 05:46:04 +00:00
Torbjörn Andersson
79819da301 The GUI never asked for the cursor to be visible. I'm not sure why that used to
work before the cursor manager. Oh well, the launcher should have a visible
cursor again, knock on wood.

svn-id: r22641
2006-05-25 23:20:35 +00:00
Torbjörn Andersson
8062eb6ec3 Set and show/hide mouse cursors through a "cursor manager" (analogous to the
recently added (cursor) palette manager) so that the cursor can be properly
restored after returning from the GUI.

If there's any C++ magic that can keep the backend functions from being called
by anything else than these managing classes, that would probably be a good
idea. Also, since the cursor manager keeps a copy of the cursor image, perhaps
there are at least some backends that will no longer need to?

svn-id: r22639
2006-05-25 22:51:42 +00:00
Torbjörn Andersson
6cdd98b617 After the GUI has finished, restore the old cursor palette (if any). For this
to work, cursor palette now has to be set using the new "palette manager". See
graphics/paletteman.cpp

svn-id: r22543
2006-05-20 10:59:25 +00:00
Torbjörn Andersson
22fb1e48ef Set a cursor palette for the classic theme, as well. Otherwise we'll get the
wrong colours in many games.

svn-id: r22540
2006-05-20 08:29:50 +00:00
Johannes Schickel
9e734b0851 Adds handleScreenChanged() to NewGui, so (scumm) engine can call it when it recives a EVENT_SCREEN_CHANGED.
svn-id: r22025
2006-04-19 06:22:15 +00:00
Johannes Schickel
0a767b6467 Implements custom cursor support for the new theme and includes a standard cursor (it should be replaced though).
svn-id: r22019
2006-04-19 03:17:00 +00:00
Johannes Schickel
30787714d3 Started to prepare the gui for runtime resolution switches.
(some little things could be missing yet though)

svn-id: r22017
2006-04-19 01:05:28 +00:00
Eugene Sandulenko
5daa835cc7 - PopUpWidget (drop down list) does not shadow underlying dialog anymore
- Remove reduntant code in drawing pipeline. Topmost dialog was drawn
  up to 4 times

svn-id: r21998
2006-04-18 00:37:04 +00:00