aboutsummaryrefslogtreecommitdiff
path: root/gui/ThemeEngine.h
diff options
context:
space:
mode:
authorEugene Sandulenko2010-06-15 10:52:35 +0000
committerEugene Sandulenko2010-06-15 10:52:35 +0000
commit01f9006ee7e8d0fd153f42fb00afbc25c4804d2b (patch)
tree774725290301c00c9e362a38fd917ea9b28db978 /gui/ThemeEngine.h
parentea7405d7ef177a547d840424497d2f7ffd72626b (diff)
downloadscummvm-rg350-01f9006ee7e8d0fd153f42fb00afbc25c4804d2b.tar.gz
scummvm-rg350-01f9006ee7e8d0fd153f42fb00afbc25c4804d2b.tar.bz2
scummvm-rg350-01f9006ee7e8d0fd153f42fb00afbc25c4804d2b.zip
GUI: Implement tooltips. FR #2821513.
FR #2821513: "GUI: add tooltips". Added tooltips for Add Game button, clear field buttons and couple other. Current problem: Only first call correctly restores text. I could not find where restore information gets lost. svn-id: r49774
Diffstat (limited to 'gui/ThemeEngine.h')
-rw-r--r--gui/ThemeEngine.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 2ef6fe3781..5f474f1a88 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -112,6 +112,7 @@ enum TextData {
kTextDataDefault = 0,
kTextDataButton,
kTextDataNormalFont,
+ kTextDataTooltip,
kTextDataMAX
};
@@ -177,7 +178,7 @@ public:
enum TextInversionState {
kTextInversionNone, ///< Indicates that the text should not be drawn inverted
kTextInversion, ///< Indicates that the text should be drawn inverted, but not focused
- kTextInversionFocus ///< Indicates thte the test should be drawn inverted, and focused
+ kTextInversionFocus ///< Indicates that the text should be drawn inverted, and focused
};
enum ScrollbarState {
@@ -196,6 +197,7 @@ public:
kFontStyleFixedNormal = 3, ///< Fixed size font.
kFontStyleFixedBold = 4, ///< Fixed size bold font.
kFontStyleFixedItalic = 5, ///< Fixed size italic font.
+ kFontStyleTooltip = 6, ///< Tiny console font
kFontStyleMax
};
@@ -259,6 +261,17 @@ public:
void enable();
void disable();
+ struct StoredState {
+ Common::Rect r;
+ Graphics::Surface screen;
+ Graphics::Surface backBuffer;
+
+ StoredState() {}
+ };
+
+ StoredState *storeState(const Common::Rect &r);
+ void restoreState(StoredState *state);
+
/**
* Implementation of the GUI::Theme API. Called when a
* new dialog is opened. Note that the boolean parameter
@@ -284,6 +297,8 @@ public:
TextData fontStyleToData(FontStyle font) const {
if (font == kFontStyleNormal)
return kTextDataNormalFont;
+ if (font == kFontStyleTooltip)
+ return kTextDataTooltip;
return kTextDataDefault;
}
@@ -336,7 +351,7 @@ public:
void drawDialogBackground(const Common::Rect &r, DialogBackground type, WidgetStateInfo state = kStateEnabled);
- void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal);
+ void drawText(const Common::Rect &r, const Common::String &str, WidgetStateInfo state = kStateEnabled, Graphics::TextAlign align = Graphics::kTextAlignCenter, TextInversionState inverted = kTextInversionNone, int deltax = 0, bool useEllipsis = true, FontStyle font = kFontStyleBold, FontColor color = kFontColorNormal, bool restore = true);
void drawChar(const Common::Rect &r, byte ch, const Graphics::Font *font, WidgetStateInfo state = kStateEnabled, FontColor color = kFontColorNormal);