mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Merge pull request #1192 from Areloch/EditorPopupEXFieldExpansion
Usability improvements for editor fields utilizing popup menus
This commit is contained in:
commit
600a6b8ebc
7 changed files with 206 additions and 35 deletions
|
|
@ -855,7 +855,7 @@ void GuiPopUpMenuCtrlEx::sortID()
|
|||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
void GuiPopUpMenuCtrlEx::addEntry(const char *buf, S32 id, U32 scheme)
|
||||
void GuiPopUpMenuCtrlEx::addEntry(const char *buf, S32 id, U32 scheme, const bool& intented)
|
||||
{
|
||||
if( !buf )
|
||||
{
|
||||
|
|
@ -882,6 +882,7 @@ void GuiPopUpMenuCtrlEx::addEntry(const char *buf, S32 id, U32 scheme)
|
|||
dStrcpy( e.buf, buf, 256 );
|
||||
e.id = id;
|
||||
e.scheme = scheme;
|
||||
e.indented = intented;
|
||||
|
||||
// see if there is a shortcut key
|
||||
char * cp = dStrchr( e.buf, '~' );
|
||||
|
|
@ -1326,8 +1327,8 @@ void GuiPopUpMenuCtrlEx::closePopUp()
|
|||
mSelIndex = ( mRevNum >= mSelIndex && mSelIndex != -1 ) ? mRevNum - mSelIndex : mSelIndex;
|
||||
if ( mSelIndex != -1 )
|
||||
{
|
||||
if ( mReplaceText )
|
||||
setText(mTl->mList[mSelIndex].text);
|
||||
if (mReplaceText)
|
||||
setText(mEntries[mSelIndex].buf);
|
||||
|
||||
for(U32 i=0; i < mEntries.size(); i++)
|
||||
{
|
||||
|
|
@ -1465,7 +1466,12 @@ void GuiPopUpMenuCtrlEx::onAction()
|
|||
}
|
||||
else
|
||||
{
|
||||
mTl->addEntry(mEntries[j].id, mEntries[j].buf);
|
||||
String entryText = mEntries[j].buf;
|
||||
|
||||
if(mEntries[j].indented)
|
||||
entryText = String(" ") + entryText;
|
||||
|
||||
mTl->addEntry(mEntries[j].id, entryText.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,8 +86,9 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl
|
|||
S32 id;
|
||||
U16 ascii;
|
||||
U16 scheme;
|
||||
bool usesColorBox; // Added
|
||||
ColorI colorbox; // Added
|
||||
bool usesColorBox; // Added
|
||||
ColorI colorbox; // Added
|
||||
bool indented; // Added
|
||||
};
|
||||
|
||||
struct Scheme
|
||||
|
|
@ -156,7 +157,11 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl
|
|||
void setBitmap(const char *name); // Added
|
||||
void sort();
|
||||
void sortID(); // Added
|
||||
void addEntry(const char *buf, S32 id = -1, U32 scheme = 0);
|
||||
void addEntry(const char *buf, S32 id = -1, U32 scheme = 0, const bool& indented = false);
|
||||
void addCategory(const char *buf)
|
||||
{
|
||||
addEntry(buf, -2, 0);
|
||||
}
|
||||
void addScheme(U32 id, ColorI fontColor, ColorI fontColorHL, ColorI fontColorSEL);
|
||||
void onRender(Point2I offset, const RectI &updateRect);
|
||||
void onAction();
|
||||
|
|
@ -184,6 +189,7 @@ class GuiPopUpMenuCtrlEx : public GuiTextCtrl
|
|||
S32 getNumEntries() { return( mEntries.size() ); }
|
||||
void replaceText(S32);
|
||||
|
||||
void setCanSearch(const bool& canSearch) { mTextSearchItems = canSearch; }
|
||||
void setSearchText(String searchTxt) { mSearchText = String::ToLower(searchTxt); onAction(); }
|
||||
|
||||
DECLARE_CONOBJECT(GuiPopUpMenuCtrlEx);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue