Address Issue 1570: Make comboboxes scrollable
Note: It appears that mLabel is never set by combo boxes, this should eventually be fixed. Checking !getFirstSelected() is sufficient to test if we're in the list, however.
This commit is contained in:
@@ -909,6 +909,19 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char)
|
||||
return result;
|
||||
}
|
||||
|
||||
BOOL LLComboBox::handleScrollWheel(S32 x, S32 y, S32 clicks)
|
||||
{
|
||||
if (mList->getVisible()) return mList->handleScrollWheel(x, y, clicks);
|
||||
if (mAllowTextEntry) // We might be editable
|
||||
if (!mList->getFirstSelected()) // We aren't in the list, don't kill their text
|
||||
return false;
|
||||
|
||||
setCurrentByIndex(llclamp(getCurrentIndex() + clicks, 0, getItemCount() - 1));
|
||||
prearrangeList();
|
||||
onCommit();
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative)
|
||||
{
|
||||
mAllowTextEntry = allow;
|
||||
|
||||
@@ -76,6 +76,7 @@ public:
|
||||
virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect);
|
||||
virtual BOOL handleKeyHere(KEY key, MASK mask);
|
||||
virtual BOOL handleUnicodeCharHere(llwchar uni_char);
|
||||
virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);
|
||||
|
||||
// LLUICtrl interface
|
||||
virtual void clear(); // select nothing
|
||||
|
||||
Reference in New Issue
Block a user