aboutsummaryrefslogtreecommitdiff
path: root/gui/PopUpWidget.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2007-11-04 03:38:30 +0000
committerJohannes Schickel2007-11-04 03:38:30 +0000
commit0ec41a2d8022f5af042bffec7513e8f2d5e36a1b (patch)
tree8aeb8e4a2c770182c2d7ef08541a8f433e8e6cdd /gui/PopUpWidget.cpp
parent7cf5a578275f97f490c85e25409562718e23482f (diff)
downloadscummvm-rg350-0ec41a2d8022f5af042bffec7513e8f2d5e36a1b.tar.gz
scummvm-rg350-0ec41a2d8022f5af042bffec7513e8f2d5e36a1b.tar.bz2
scummvm-rg350-0ec41a2d8022f5af042bffec7513e8f2d5e36a1b.zip
- made Widget::_flags private
- reworked state (enabled/disabled/highlighted) handling of widgets - cleanup in ModernTheme.cpp svn-id: r29403
Diffstat (limited to 'gui/PopUpWidget.cpp')
-rw-r--r--gui/PopUpWidget.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 6df54343b6..91b7c40687 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -357,7 +357,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &label, uint labelWidth)
: Widget(boss, name), CommandSender(boss), _label(label), _labelWidth(labelWidth) {
- _flags = WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS;
+ setFlags(WIDGET_ENABLED | WIDGET_CLEARBG | WIDGET_RETAIN_FOCUS);
setHints(THEME_HINT_SAVE_BACKGROUND);
_type = kPopUpWidget;
@@ -368,7 +368,6 @@ PopUpWidget::PopUpWidget(GuiObject *boss, const String &name, const String &labe
}
void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
-
if (isEnabled()) {
PopUpDialog popupDialog(this, x + getAbsX(), y + getAbsY());
int newSel = popupDialog.runModal();
@@ -420,19 +419,18 @@ void PopUpWidget::setSelectedTag(uint32 tag) {
}
}
-void PopUpWidget::drawWidget(bool hilite) {
+void PopUpWidget::drawWidget() {
int x = _x + _labelWidth + _labelSpacing;
int w = _w - _labelWidth - _labelSpacing;
// Draw the label, if any
if (_labelWidth > 0)
- g_gui.theme()->drawText(Common::Rect(_x+2,_y+3,_x+2+_labelWidth, _y+3+g_gui.theme()->getFontHeight()), _label,
- isEnabled() ? Theme::kStateEnabled : Theme::kStateDisabled, Theme::kTextAlignRight);
+ g_gui.theme()->drawText(Common::Rect(_x+2,_y+3,_x+2+_labelWidth, _y+3+g_gui.theme()->getFontHeight()), _label, _state, Theme::kTextAlignRight);
Common::String sel;
if (_selectedItem >= 0)
sel = _entries[_selectedItem].name;
- g_gui.theme()->drawPopUpWidget(Common::Rect(x, _y, x+w, _y+_h), sel, _leftPadding, isEnabled() ? (hilite ? Theme::kStateHighlight : Theme::kStateEnabled) : Theme::kStateDisabled, g_gui.theme()->convertAligment(kTextAlignLeft));
+ g_gui.theme()->drawPopUpWidget(Common::Rect(x, _y, x+w, _y+_h), sel, _leftPadding, _state, g_gui.theme()->convertAligment(kTextAlignLeft));
}
} // End of namespace GUI