[Scummvm-cvs-logs] scummvm master -> 5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9
eriktorbjorn
eriktorbjorn at telia.com
Thu Dec 27 10:39:13 CET 2012
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ba182faeaf GUI: Notify when popup widget changes by mousewheel
5b09c1c8e3 GUI: Don't allow changing disabled popup widgets with mouse wheel
Commit: ba182faeaf3158f6bbeec001617f64a954637c9d
https://github.com/scummvm/scummvm/commit/ba182faeaf3158f6bbeec001617f64a954637c9d
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-12-27T01:30:52-08:00
Commit Message:
GUI: Notify when popup widget changes by mousewheel
This is consistent with the notification when the widget changes by
clicking. As far as I can tell, that notification was added shortly
before mouse wheel handling was added. It missing from the mouse
wheel handler was presumably just an oversight.
Changed paths:
gui/widgets/popup.cpp
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 048714b..61d4a54 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -406,6 +406,7 @@ void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
(newSelection != _selectedItem)) {
_selectedItem = newSelection;
+ sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
draw();
}
}
Commit: 5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9
https://github.com/scummvm/scummvm/commit/5b09c1c8e3dd4ed927e1c6ee670defe83e4382c9
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2012-12-27T01:37:02-08:00
Commit Message:
GUI: Don't allow changing disabled popup widgets with mouse wheel
This was another inconsistency between changing the widget by
clicking and changing it with the mouse wheel. Hopefully the last
one, though.
Changed paths:
gui/widgets/popup.cpp
diff --git a/gui/widgets/popup.cpp b/gui/widgets/popup.cpp
index 61d4a54..829a49c 100644
--- a/gui/widgets/popup.cpp
+++ b/gui/widgets/popup.cpp
@@ -394,20 +394,22 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
}
void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
- int newSelection = _selectedItem + direction;
+ if (isEnabled()) {
+ int newSelection = _selectedItem + direction;
- // Skip separator entries
- while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
- _entries[newSelection].name.equals("")) {
- newSelection += direction;
- }
+ // Skip separator entries
+ while ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
+ _entries[newSelection].name.equals("")) {
+ newSelection += direction;
+ }
- // Just update the selected item when we're in range
- if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
- (newSelection != _selectedItem)) {
- _selectedItem = newSelection;
- sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
- draw();
+ // Just update the selected item when we're in range
+ if ((newSelection >= 0) && (newSelection < (int)_entries.size()) &&
+ (newSelection != _selectedItem)) {
+ _selectedItem = newSelection;
+ sendCommand(kPopUpItemSelectedCmd, _entries[_selectedItem].tag);
+ draw();
+ }
}
}
More information about the Scummvm-git-logs
mailing list