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
2 changed files with 9 additions and 5 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue