mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 11:43:49 +00:00
Fixes issues with shifting the gui selection dropdown to be searchable via the Ex control.
This commit is contained in:
parent
1d2ed41ab3
commit
50e05800f4
3 changed files with 30 additions and 12 deletions
|
|
@ -1317,21 +1317,35 @@ void GuiPopUpMenuCtrlEx::closePopUp()
|
|||
return;
|
||||
|
||||
// Get the selection from the text list:
|
||||
mSelIndex = mTl->getSelectedCell().y;
|
||||
if (mSearchText.isEmpty())
|
||||
{
|
||||
mSelIndex = mTl->getSelectedCell().y;
|
||||
}
|
||||
else
|
||||
{
|
||||
S32 filteredEntryCount = 0;
|
||||
for (U32 i=0; i < mEntries.size(); i++)
|
||||
{
|
||||
String entryText = String::ToLower(mEntries[i].buf);
|
||||
if (entryText.find(mSearchText) != -1 && mEntries[i].id != -2)
|
||||
{
|
||||
if (filteredEntryCount == mTl->getSelectedCell().y)
|
||||
{
|
||||
mSelIndex = i;
|
||||
break;
|
||||
}
|
||||
|
||||
filteredEntryCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
mSelIndex = ( mRevNum >= mSelIndex && mSelIndex != -1 ) ? mRevNum - mSelIndex : mSelIndex;
|
||||
if ( mSelIndex != -1 )
|
||||
{
|
||||
if (mReplaceText)
|
||||
setText(mEntries[mSelIndex].buf);
|
||||
|
||||
for(U32 i=0; i < mEntries.size(); i++)
|
||||
{
|
||||
if(dStrcmp(mEntries[i].buf,mTl->mList[mSelIndex].text) == 0)
|
||||
{
|
||||
setIntVariable(mEntries[i].id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
setIntVariable(mEntries[mSelIndex].id);
|
||||
}
|
||||
|
||||
// Release the mouse:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue