mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 07:04:36 +00:00
Updates the field types used in the editor to utilize the GuiPopUpMenuCtrlEx to make them support categories and be able to search filter them
Updates the dataBlock field type to properly present categorized listings Expands the datablock Field to have an edit and add buttons on the field to make the workflow simpler Adds utility functions to GuiPopUpMenuCtrlEx to control indentation, categories and searchability Expands datablock editor functionality to be able to create a datablock of a type to pre-set the inheritFrom param of the process early(used for the add new button on DB fields to carry-through the current DB to the creation process of a derivative)
This commit is contained in:
parent
efffabae06
commit
d952722811
7 changed files with 205 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