mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 08:34:40 +00:00
Addition to guiTreeViewCtrl - ability to find what item in the tree is under a given position.
This commit is contained in:
parent
66f522668b
commit
6563f46242
2 changed files with 23 additions and 0 deletions
|
|
@ -2501,6 +2501,19 @@ const char * GuiTreeViewCtrl::getItemValue(S32 itemId)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
S32 GuiTreeViewCtrl::getItemAtPosition(Point2I position)
|
||||||
|
{
|
||||||
|
BitSet32 hitFlags = 0;
|
||||||
|
Item* item;
|
||||||
|
|
||||||
|
if (_hitTest(position, item, hitFlags))
|
||||||
|
return item->mId;
|
||||||
|
else
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool GuiTreeViewCtrl::editItem( S32 itemId, const char* newText, const char* newValue )
|
bool GuiTreeViewCtrl::editItem( S32 itemId, const char* newText, const char* newValue )
|
||||||
{
|
{
|
||||||
Item* item = getItem( itemId );
|
Item* item = getItem( itemId );
|
||||||
|
|
@ -5550,3 +5563,11 @@ DefineEngineMethod( GuiTreeViewCtrl, clearFilterText, void, (),,
|
||||||
{
|
{
|
||||||
object->clearFilterText();
|
object->clearFilterText();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiTreeViewCtrl, getItemAtPosition, S32, (Point2I position), (Point2I::Zero),
|
||||||
|
"Get the tree item at the passed in position.\n\n"
|
||||||
|
"@param position The position to check for what item is below it.\n"
|
||||||
|
"@return The id of the item under the position.")
|
||||||
|
{
|
||||||
|
return object->getItemAtPosition(position);
|
||||||
|
}
|
||||||
|
|
@ -514,6 +514,8 @@ class GuiTreeViewCtrl : public GuiArrayCtrl
|
||||||
|
|
||||||
bool markItem( S32 itemId, bool mark );
|
bool markItem( S32 itemId, bool mark );
|
||||||
|
|
||||||
|
S32 getItemAtPosition(Point2I position);
|
||||||
|
|
||||||
bool isItemSelected( S32 itemId );
|
bool isItemSelected( S32 itemId );
|
||||||
|
|
||||||
// insertion/removal
|
// insertion/removal
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue