diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-12-16 00:43:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-12-16 00:56:57 +0300 |
commit | 955c9fcba2a4a8b19389760bc74a59ab2173de02 (patch) | |
tree | 50dc69ff5c8a4d94238f51b707db1718e7ae5dcb /src/gui/widgets/popuplist.cpp | |
parent | 661a14c66685de67ec560005c285267fe7098c62 (diff) | |
download | manaplus-955c9fcba2a4a8b19389760bc74a59ab2173de02.tar.gz manaplus-955c9fcba2a4a8b19389760bc74a59ab2173de02.tar.bz2 manaplus-955c9fcba2a4a8b19389760bc74a59ab2173de02.tar.xz manaplus-955c9fcba2a4a8b19389760bc74a59ab2173de02.zip |
Add keyboard selection in drop down.
Diffstat (limited to 'src/gui/widgets/popuplist.cpp')
-rw-r--r-- | src/gui/widgets/popuplist.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp index 586dd5172..3a27b78a1 100644 --- a/src/gui/widgets/popuplist.cpp +++ b/src/gui/widgets/popuplist.cpp @@ -42,7 +42,6 @@ PopupList::PopupList(DropDown *const widget, setFocusable(true); mListBox->setDistributeMousePressed(true); - mListBox->addSelectionListener(this); mScrollArea->setPosition(mPadding, mPadding); add(mScrollArea); @@ -51,6 +50,8 @@ PopupList::PopupList(DropDown *const widget, if (gui) gui->addGlobalFocusListener(this); + addKeyListener(mDropDown); + addMouseListener(this); adjustSize(); } @@ -58,6 +59,7 @@ PopupList::~PopupList() { if (gui) gui->removeGlobalFocusListener(this); + removeKeyListener(mDropDown); } void PopupList::show(int x, int y) @@ -113,7 +115,7 @@ void PopupList::adjustSize() mListBox->setWidth(getWidth() - pad2); } -void PopupList::valueChanged(const gcn::SelectionEvent& event A_UNUSED) +void PopupList::mousePressed(gcn::MouseEvent& mouseEvent) { if (mDropDown) mDropDown->updateSelection(); |