mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-30 23:43:10 +00:00
Override the list widget's FindWidget() function, to allow it to return the
scrollbar widget. svn-id: r22672
This commit is contained in:
parent
9943084227
commit
923101abcb
@ -78,6 +78,13 @@ ListWidget::~ListWidget() {
|
||||
delete[] _textWidth;
|
||||
}
|
||||
|
||||
Widget *ListWidget::findWidget(int x, int y) {
|
||||
if (x >= _w - _scrollBarWidth)
|
||||
return _scrollBar;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
void ListWidget::setSelected(int item) {
|
||||
assert(item >= -1 && item < (int)_list.size());
|
||||
|
||||
@ -138,11 +145,6 @@ void ListWidget::handleMouseDown(int x, int y, int button, int clickCount) {
|
||||
if (!isEnabled())
|
||||
return;
|
||||
|
||||
if (x >= _w - _scrollBarWidth) {
|
||||
_scrollBar->handleMouseDown(x, y, button, clickCount);
|
||||
return;
|
||||
}
|
||||
|
||||
// First check whether the selection changed
|
||||
int newSelectedItem;
|
||||
newSelectedItem = findItem(x, y);
|
||||
|
@ -73,6 +73,8 @@ public:
|
||||
ListWidget(GuiObject *boss, String name);
|
||||
virtual ~ListWidget();
|
||||
|
||||
virtual Widget *findWidget(int x, int y);
|
||||
|
||||
void setList(const StringList& list);
|
||||
const StringList& getList() const { return _list; }
|
||||
int getSelected() const { return _selectedItem; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user