mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-17 23:44:22 +00:00
Modify the PopUpWidget selection by using the mouse wheel
svn-id: r35514
This commit is contained in:
parent
f75893a294
commit
604b8f08b6
@ -379,6 +379,23 @@ void PopUpWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||
}
|
||||
}
|
||||
|
||||
void PopUpWidget::handleMouseWheel(int x, int y, int direction) {
|
||||
int newSelection = _selectedItem + 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;
|
||||
draw();
|
||||
}
|
||||
}
|
||||
|
||||
void PopUpWidget::reflowLayout() {
|
||||
_leftPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Left", 0);
|
||||
_rightPadding = g_gui.xmlEval()->getVar("Globals.PopUpWidget.Padding.Right", 0);
|
||||
|
@ -68,6 +68,7 @@ public:
|
||||
void changeLabelWidth(uint newWidth) { _labelWidth = newWidth; }
|
||||
|
||||
void handleMouseDown(int x, int y, int button, int clickCount);
|
||||
void handleMouseWheel(int x, int y, int direction);
|
||||
|
||||
void appendEntry(const String &entry, uint32 tag = (uint32)-1);
|
||||
void clearEntries();
|
||||
|
Loading…
x
Reference in New Issue
Block a user