aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2003-03-26 12:30:20 +0000
committerMax Horn2003-03-26 12:30:20 +0000
commit3b1d4e4c06f00e7136a59beac6ea58b0715e0512 (patch)
tree4acd9747a4d3e3ae7a4de1ee2ebb4e3815b2edcc /gui
parentc40989548345e00e26b42be5acbe9d11f87685bb (diff)
downloadscummvm-rg350-3b1d4e4c06f00e7136a59beac6ea58b0715e0512.tar.gz
scummvm-rg350-3b1d4e4c06f00e7136a59beac6ea58b0715e0512.tar.bz2
scummvm-rg350-3b1d4e4c06f00e7136a59beac6ea58b0715e0512.zip
Make it possible to disable popups/checkboxes
svn-id: r6864
Diffstat (limited to 'gui')
-rw-r--r--gui/PopUpWidget.cpp20
-rw-r--r--gui/widget.cpp4
2 files changed, 15 insertions, 9 deletions
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index 22e2fb9834..eaebc8ebc4 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -265,6 +265,9 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) {
_gui->addDirtyRect(x, y, w, kLineHeight);
}
+
+#pragma mark -
+
//
// PopUpWidget
//
@@ -278,11 +281,14 @@ PopUpWidget::PopUpWidget(Dialog *boss, int x, int y, int w, int h)
}
void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
- PopUpDialog popupDialog(this, x + _x + _boss->getX(), y + _y + _boss->getY());
- int newSel = popupDialog.runModal();
- if (newSel != -1 && _selectedItem != newSel) {
- _selectedItem = newSel;
- sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
+
+ if (isEnabled()) {
+ PopUpDialog popupDialog(this, x + _x + _boss->getX(), y + _y + _boss->getY());
+ int newSel = popupDialog.runModal();
+ if (newSel != -1 && _selectedItem != newSel) {
+ _selectedItem = newSel;
+ sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
+ }
}
}
@@ -320,11 +326,11 @@ void PopUpWidget::drawWidget(bool hilite) {
gui->vline(_x + _w - 1, _y, _y +_h - 1, gui->_shadowcolor);
// Draw an arrow pointing down at the right end to signal this is a dropdown/popup
- gui->drawBitmap(up_down_arrows, _x+_w - 10, _y+2, hilite ? gui->_textcolorhi : gui->_textcolor);
+ gui->drawBitmap(up_down_arrows, _x+_w - 10, _y+2, !isEnabled() ? gui->_color : hilite ? gui->_textcolorhi : gui->_textcolor);
// Draw the selected entry, if any
if (_selectedItem >= 0) {
int align = (gui->getStringWidth(_entries[_selectedItem].name) > _w-6) ? kTextAlignRight : kTextAlignLeft;
- gui->drawString(_entries[_selectedItem].name, _x+2, _y+3, _w-6, gui->_textcolor, align);
+ gui->drawString(_entries[_selectedItem].name, _x+2, _y+3, _w-6, !isEnabled() ? gui->_color : gui->_textcolor, align);
}
}
diff --git a/gui/widget.cpp b/gui/widget.cpp
index f390d3b2e5..ed899ffc57 100644
--- a/gui/widget.cpp
+++ b/gui/widget.cpp
@@ -167,12 +167,12 @@ void CheckboxWidget::drawWidget(bool hilite) {
// If checked, draw cross inside the box
if (_state)
- gui->drawBitmap(checked_img, _x + 3, _y + 3, gui->_textcolor);
+ gui->drawBitmap(checked_img, _x + 3, _y + 3, !isEnabled() ? gui->_color : gui->_textcolor);
else
gui->fillRect(_x + 2, _y + 2, 10, 10, gui->_bgcolor);
// Finally draw the label
- gui->drawString(_label, _x + 20, _y + 3, _w, gui->_textcolor);
+ gui->drawString(_label, _x + 20, _y + 3, _w, !isEnabled() ? gui->_color : gui->_textcolor);
}
#pragma mark -