guiListBoxCtrl.cpp
Engine/source/gui/controls/guiListBoxCtrl.cpp
Public Variables
sGuiControlSetExtent1 ("@brief Adds an item to the control with the specific text.\n\n" "@param text Text item to add to the list.\n" "GuiListBoxCtrl", "void addItem( const char* text );")
Public Functions
ConsoleDocClass(GuiListBoxCtrl , "@brief A list of text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">items.\n\n</a>" "A list of text items where each individual entry can have its own text value, text color and associated <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SimObject.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a>(GuiMusicPlayerMusicList)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " allowMultipleSelections=\"true\";\n" " fitParentWidth = \"true\";\n" " mirrorSet = \"AnotherGuiListBoxCtrl\";\n" " makeNameCallback = \"\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " colorBullet = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " //Properties not specific <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> have been omitted from this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">example.\n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiCore\n</a>" )
DefineEngineMethod(GuiListBoxCtrl , addFilteredItem , void , (const char *newItem) , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is an item with the exact text of what is passed in, and <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">so\n</a>" "the item is removed from the list and adds that item 's data <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" " @param itemName Name of the item that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered item list of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiListBoxCtrl.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define the itemName that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% itemName)
DefineEngineMethod(GuiListBoxCtrl , addItem , S32 , (const char *newItem, const char *color) , ("") , "@brief Adds an item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the end of the list with an optional <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">color.\n\n</a>" "@param newItem New item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@param color Optional color parameter <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% newItem)
DefineEngineMethod(GuiListBoxCtrl , clearItemColor , void , (S32 index) , "@brief Removes any custom coloring from an item at the defined index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> clear any custom color <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , clearItems , void , () , "@brief Clears all the items in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">listbox.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Inform the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> clear all items from its <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "%thisGuiListBoxCtrl.clearItems();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/class/classguicontrol/">GuiControl</a>" )
DefineEngineMethod(GuiListBoxCtrl , clearSelection , void , () , "@brief Sets all currently selected items <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Inform the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set all of its items <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> unselected./<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%thisGuiListBoxCtrl.clearSelection();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/class/classguicontrol/">GuiControl</a>" )
DefineEngineMethod(GuiListBoxCtrl , deleteItem , void , (S32 itemIndex) , "@brief Removes the list entry at the requested index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> from the <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> and clears the memory associated with <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it.\n\n</a>" "@param itemIndex Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> location <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove the item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> we want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list\n</a>" "% itemIndex)
DefineEngineMethod(GuiListBoxCtrl , doMirror , void , () , "@brief Informs the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mirror the contents of the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> stored in the mirrorSet <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">field.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "\\ Inform the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mirror the object located at %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thisGuiListBox.mirrorSet\n</a>" "%thisGuiListBox.doMirror();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see GuiCore" )
DefineEngineMethod(GuiListBoxCtrl , findItemText , S32 , (const char *findText, bool bCaseSensitive) , (false) , "@brief Returns index of item with matching text or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> none <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">found.\n\n</a>" "@param findText Text in the list <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">find.\n</a>" "@param isCaseSensitive If true, the search will be case <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sensitive.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define the text we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> find in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% findText)
DefineEngineMethod(GuiListBoxCtrl , getItemCount , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getItemObject , const char * , (S32 index) , "@brief Returns the object associated with an item. This only makes sense <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> you are mirroring <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">simset.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> request the associated item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , getItemText , const char * , (S32 index) , "@brief Returns the text of the item at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> return the item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> entry <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> request the text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , getLastClickItem , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelCount , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelectedItem , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelectedItems , const char * , () )
DefineEngineMethod(GuiListBoxCtrl , insertItem , void , (const char *text, S32 index) , "@brief Inserts an item into the list at the specified index and returns the index assigned or -1 on <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">error.\n\n</a>" "@param text Text item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">add.\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> insert the list item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">at.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">insert\n</a>" "% text)
DefineEngineMethod(GuiListBoxCtrl , removeFilteredItem , void , (const char *itemName) , "@brief Removes an item of the entered name from the filtered items <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" "@param itemName Name of the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove from the filtered <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the itemName that you wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" "% itemName)
DefineEngineMethod(GuiListBoxCtrl , setCurSel , void , (S32 indexId) , "@brief Sets the currently selected item at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param indexId Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">select.\n</a>" "% selectId)
DefineEngineMethod(GuiListBoxCtrl , setCurSelRange , void , (S32 indexStart, S32 indexStop) , (999999) , "@brief Sets the current selection range from index start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> stop. If no stop is specified it sets from start index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the end of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list\n\n</a>" "@param indexStart Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> start <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selection.\n</a>" "@param indexStop Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> end <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selection.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Set start <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% indexStart)
DefineEngineMethod(GuiListBoxCtrl , setItemColor , void , (S32 index, LinearColorF color) , "@brief Sets the color of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> single list entry at the specified index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify the color of in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@param color Color <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the list entry <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setItemText , void , (S32 index, const char *newtext) , "@brief Sets the items text at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">at.\n</a>" "@param newtext Text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> change the list item at index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a>/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setItemTooltip , void , (S32 index, const char *text) , "@brief Set the tooltip text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> display <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the given list <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> change the tooltip <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">text\n</a>" "@param text Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tooltip.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setMultipleSelection , void , (bool allowMultSelections) , "@brief Enable or disable multiple selections <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param allowMultSelections Boolean variable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the use of multiple selections or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the multiple selection use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n</a>" "% allowMultSelections)
DefineEngineMethod(GuiListBoxCtrl , setSelected , void , (S32 index, bool setSelected) , (true) , "@brief Sets the item at the index specified <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> selected or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" "@param index <a href="/coding/class/classitem/">Item</a> index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set selected or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n</a>" "@param setSelected Boolean selection state <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the requested item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index\n</a>" "% index)
IMPLEMENT_CALLBACK(GuiListBoxCtrl , isObjectMirrored , bool , (const char *indexIdString) , (indexIdString) , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> list item at <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> defined index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> is mirrored, and returns the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">result.\n\n</a>" " @param indexIdString Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the list <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Engine has requested of the script level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> determine <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> list entry is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" "GuiListBoxCtrl::isObjectMirrored(%this, %indexIdString)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Perform code <a href="/coding/file/tsshapeconstruct_8cpp/#tsshapeconstruct_8cpp_1a21625ca11566389388a748ad1acc0990">required</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check and see <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the list item at the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" " return %isMirrored;\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @return A boolean <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> on <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the list item is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onClearSelection , void , () , () , "@brief Called whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cleared.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// A selected item is cleared, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onClearSelection(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cleared\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onDeleteKey , void , () , () , "@brief Called whenever the Delete key on the keyboard has been pressed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> in this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// The delete key on the keyboard has been pressed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> this <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> is in focus, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onDeleteKey(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> call whenever the delete key is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pressed\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onDoubleClick , void , () , () , "@brief Called whenever an item in the list has been double <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">clicked.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// An item in the list is double clicked, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onDoubleClick(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever an item in the <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> has been double <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">clicked\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onMouseDragged , void , () , () , "@brief Called whenever the mouse is dragged across the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Mouse is dragged across the control, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "<a href="/coding/class/classguilistboxctrl/#classguilistboxctrl_1a6b1866c001acdd50bafc5aab1b67bd5d">GuiListBoxCtrl::onMouseDragged</a>(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever the mouse is dragged across the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onMouseUp , void , (S32 itemHit, S32 mouseClickCount) , (itemHit, mouseClickCount) , "@brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n</a>" "If an item in the list was hit during the click cycle, then the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the clicked object along with how many clicks occured are <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">passed\n</a>" "into the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callback.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" " @param itemHit Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list item that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hit\n</a>" " @param mouseClickCount How many mouse clicks occured on this list <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Mouse was previously clicked down, and now has been released, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "<a href="/coding/class/classguilistboxctrl/#classguilistboxctrl_1a3b5b772fbfd15f78f8ff55beddac97d4">GuiListBoxCtrl::onMouseUp</a>(%this, %itemHit, %mouseClickCount)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> call whenever the mouse has been clicked and released on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onSelect , void , (S32 index, const char *itemText) , (index, itemText) , "@brief Called whenever an item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the item in the list that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n</a>" "@param itemText Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list item at the index that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// An item in the list is selected, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur\n</a>" "<a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1adfb6d6e76af82063022d153c28e5f7a8">GuiListBoxCtrl::onSelect</a>(%this, %index, %itemText)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever an item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onUnSelect , void , (S32 index, const char *itemText) , (index, itemText) , "@brief Called whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item in the list has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the item that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n</a>" "@param itemText Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list entry at the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// A selected item is unselected, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur\n</a>" "GuiListBoxCtrl::onUnSelect(%this, %indexId, %itemText)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected list item is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
Detailed Description
Public Variables
ConsoleDocFragment sGuiControlSetExtent1 ("@brief Adds an item to the control with the specific text.\n\n" "@param text Text item to add to the list.\n" "GuiListBoxCtrl", "void addItem( const char* text );")
Public Functions
ConsoleDocClass(GuiListBoxCtrl , "@brief A list of text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">items.\n\n</a>" "A list of text items where each individual entry can have its own text value, text color and associated <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">SimObject.\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "<a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a>(GuiMusicPlayerMusicList)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "{\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " allowMultipleSelections=\"true\";\n" " fitParentWidth = \"true\";\n" " mirrorSet = \"AnotherGuiListBoxCtrl\";\n" " makeNameCallback = \"\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " colorBullet = \"1\";\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " //Properties not specific <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> this <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> have been omitted from this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">example.\n</a>" "};\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" "@ingroup <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiCore\n</a>" )
DefineEngineMethod(GuiListBoxCtrl , addFilteredItem , void , (const char *newItem) , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> there is an item with the exact text of what is passed in, and <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">so\n</a>" "the item is removed from the list and adds that item 's data <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" " @param itemName Name of the item that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered item list of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiListBoxCtrl.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define the itemName that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the filtered item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% itemName)
DefineEngineMethod(GuiListBoxCtrl , addItem , S32 , (const char *newItem, const char *color) , ("") , "@brief Adds an item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the end of the list with an optional <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">color.\n\n</a>" "@param newItem New item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@param color Optional color parameter <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/tmm__on_8h/#tmm__on_8h_1a1ac41480eb2e4aadd52252ee550b630a">new</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> add <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% newItem)
DefineEngineMethod(GuiListBoxCtrl , clearItemColor , void , (S32 index) , "@brief Removes any custom coloring from an item at the defined index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> clear any custom color <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , clearItems , void , () , "@brief Clears all the items in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">listbox.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Inform the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> clear all items from its <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "%thisGuiListBoxCtrl.clearItems();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/class/classguicontrol/">GuiControl</a>" )
DefineEngineMethod(GuiListBoxCtrl , clearSelection , void , () , "@brief Sets all currently selected items <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Inform the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set all of its items <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> unselected./<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "%thisGuiListBoxCtrl.clearSelection();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see <a href="/coding/class/classguicontrol/">GuiControl</a>" )
DefineEngineMethod(GuiListBoxCtrl , deleteItem , void , (S32 itemIndex) , "@brief Removes the list entry at the requested index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> from the <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> and clears the memory associated with <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">it.\n\n</a>" "@param itemIndex Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> location <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove the item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> we want <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove from the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list\n</a>" "% itemIndex)
DefineEngineMethod(GuiListBoxCtrl , doMirror , void , () , "@brief Informs the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mirror the contents of the <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> stored in the mirrorSet <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">field.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "\\ Inform the object <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> mirror the object located at %<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">thisGuiListBox.mirrorSet\n</a>" "%thisGuiListBox.doMirror();\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" "@see GuiCore" )
DefineEngineMethod(GuiListBoxCtrl , findItemText , S32 , (const char *findText, bool bCaseSensitive) , (false) , "@brief Returns index of item with matching text or -1 <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> none <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">found.\n\n</a>" "@param findText Text in the list <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">find.\n</a>" "@param isCaseSensitive If true, the search will be case <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">sensitive.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Define the text we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> find in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "% findText)
DefineEngineMethod(GuiListBoxCtrl , getItemCount , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getItemObject , const char * , (S32 index) , "@brief Returns the object associated with an item. This only makes sense <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> you are mirroring <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">simset.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> request the associated item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , getItemText , const char * , (S32 index) , "@brief Returns the text of the item at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> return the item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> entry <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> request the text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">from\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , getLastClickItem , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelCount , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelectedItem , S32 , () )
DefineEngineMethod(GuiListBoxCtrl , getSelectedItems , const char * , () )
DefineEngineMethod(GuiListBoxCtrl , insertItem , void , (const char *text, S32 index) , "@brief Inserts an item into the list at the specified index and returns the index assigned or -1 on <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">error.\n\n</a>" "@param text Text item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">add.\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> insert the list item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">at.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">insert\n</a>" "% text)
DefineEngineMethod(GuiListBoxCtrl , removeFilteredItem , void , (const char *itemName) , "@brief Removes an item of the entered name from the filtered items <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n\n</a>" "@param itemName Name of the item <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> remove from the filtered <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the itemName that you wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">remove.\n</a>" "% itemName)
DefineEngineMethod(GuiListBoxCtrl , setCurSel , void , (S32 indexId) , "@brief Sets the currently selected item at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param indexId Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> that we wish <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">select.\n</a>" "% selectId)
DefineEngineMethod(GuiListBoxCtrl , setCurSelRange , void , (S32 indexStart, S32 indexStop) , (999999) , "@brief Sets the current selection range from index start <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> stop. If no stop is specified it sets from start index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> the end of the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list\n\n</a>" "@param indexStart Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> start <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selection.\n</a>" "@param indexStop Index Id <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> end <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selection.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Set start <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% indexStart)
DefineEngineMethod(GuiListBoxCtrl , setItemColor , void , (S32 index, LinearColorF color) , "@brief Sets the color of <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> single list entry at the specified index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> modify the color of in the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">list.\n</a>" "@param color Color <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the list entry <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">value\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setItemText , void , (S32 index, const char *newtext) , "@brief Sets the items text at the specified <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the item text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">at.\n</a>" "@param newtext Text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> change the list item at index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">to.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a>/<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setItemTooltip , void , (S32 index, const char *text) , "@brief Set the tooltip text <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> display <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the given list <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> change the tooltip <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">text\n</a>" "@param text Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tooltip.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the index <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">id\n</a>" "% index)
DefineEngineMethod(GuiListBoxCtrl , setMultipleSelection , void , (bool allowMultSelections) , "@brief Enable or disable multiple selections <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> this <a href="/coding/class/classguilistboxctrl/">GuiListBoxCtrl</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">object.\n\n</a>" "@param allowMultSelections Boolean variable <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the use of multiple selections or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the multiple selection use <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">state.\n</a>" "% allowMultSelections)
DefineEngineMethod(GuiListBoxCtrl , setSelected , void , (S32 index, bool setSelected) , (true) , "@brief Sets the item at the index specified <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> selected or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" "@param index <a href="/coding/class/classitem/">Item</a> index <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set selected or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n</a>" "@param setSelected Boolean selection state <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> set the requested item <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index.\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Define the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">index\n</a>" "% index)
IMPLEMENT_CALLBACK(GuiListBoxCtrl , isObjectMirrored , bool , (const char *indexIdString) , (indexIdString) , "@brief Checks <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> list item at <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> defined index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> is mirrored, and returns the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">result.\n\n</a>" " @param indexIdString Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the list <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">check.\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Engine has requested of the script level <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> determine <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> list entry is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" "GuiListBoxCtrl::isObjectMirrored(%this, %indexIdString)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Perform code <a href="/coding/file/tsshapeconstruct_8cpp/#tsshapeconstruct_8cpp_1a21625ca11566389388a748ad1acc0990">required</a> <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> check and see <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the list item at the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n</a>" " return %isMirrored;\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @return A boolean <a href="/coding/file/pointer_8h/#pointer_8h_1a32aff7c6c4cd253fdf6563677afab5ce">value</a> on <a href="/coding/file/tsmeshintrinsics_8cpp/#tsmeshintrinsics_8cpp_1a4e4fa7e3399708e0777b5308db01278c">if</a> the list item is mirrored or <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">not.\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onClearSelection , void , () , () , "@brief Called whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cleared.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// A selected item is cleared, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onClearSelection(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">cleared\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onDeleteKey , void , () , () , "@brief Called whenever the Delete key on the keyboard has been pressed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> in this <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// The delete key on the keyboard has been pressed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a0e48c1f64b558d03d870367324920354">while</a> this <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> is in focus, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onDeleteKey(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> call whenever the delete key is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">pressed\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onDoubleClick , void , () , () , "@brief Called whenever an item in the list has been double <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">clicked.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// An item in the list is double clicked, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "GuiListBoxCtrl::onDoubleClick(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever an item in the <a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1abb04e3738c4c5a96b3ade6fa47013a6c">control</a> has been double <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">clicked\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onMouseDragged , void , () , () , "@brief Called whenever the mouse is dragged across the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// Mouse is dragged across the control, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "<a href="/coding/class/classguilistboxctrl/#classguilistboxctrl_1a6b1866c001acdd50bafc5aab1b67bd5d">GuiListBoxCtrl::onMouseDragged</a>(%this)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever the mouse is dragged across the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onMouseUp , void , (S32 itemHit, S32 mouseClickCount) , (itemHit, mouseClickCount) , "@brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control.\n</a>" "If an item in the list was hit during the click cycle, then the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the clicked object along with how many clicks occured are <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">passed\n</a>" "into the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">callback.\n\n</a>" "Detailed <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">description\n\n</a>" " @param itemHit Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list item that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">hit\n</a>" " @param mouseClickCount How many mouse clicks occured on this list <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">item\n\n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "//Mouse was previously clicked down, and now has been released, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur.\n</a>" "<a href="/coding/class/classguilistboxctrl/#classguilistboxctrl_1a3b5b772fbfd15f78f8ff55beddac97d4">GuiListBoxCtrl::onMouseUp</a>(%this, %itemHit, %mouseClickCount)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> call whenever the mouse has been clicked and released on the <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">control\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onSelect , void , (S32 index, const char *itemText) , (index, itemText) , "@brief Called whenever an item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the item in the list that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n</a>" "@param itemText Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list item at the index that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected.\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// An item in the list is selected, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur\n</a>" "<a href="/coding/file/guieditctrl_8cpp/#guieditctrl_8cpp_1adfb6d6e76af82063022d153c28e5f7a8">GuiListBoxCtrl::onSelect</a>(%this, %index, %itemText)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever an item in the list is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">selected\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CALLBACK(GuiListBoxCtrl , onUnSelect , void , (S32 index, const char *itemText) , (index, itemText) , "@brief Called whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected item in the list has been <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected.\n\n</a>" "@param index Index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> of the item that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n</a>" "@param itemText Text <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1a2732ab74fa0237854c2ba0f75f88a624">for</a> the list entry at the index <a href="/coding/file/win32cursorcontroller_8cpp/#win32cursorcontroller_8cpp_1ab38592509822a5f4674447022cc62efe">id</a> that was <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n\n</a>" "@<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">tsexample\n</a>" "// A selected item is unselected, causing the callback <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">occur\n</a>" "GuiListBoxCtrl::onUnSelect(%this, %indexId, %itemText)\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " {\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" "//Code <a href="/coding/file/cmdgram_8cpp/#cmdgram_8cpp_1a5bafda9519252aa2d0fd038153f77dca">to</a> run whenever <a href="/coding/file/pointer_8h/#pointer_8h_1aeeddce917cf130d62c370b8f216026dd">a</a> selected list item is <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">unselected\n</a>" " }\<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">n</a>" " @<a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">endtsexample\n\n</a>" " @see <a href="/coding/file/cmdscan_8cpp/#cmdscan_8cpp_1aeab71244afb687f16d8c4f5ee9d6ef0e">GuiControl\n\n</a>" )
IMPLEMENT_CONOBJECT(GuiListBoxCtrl )
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23#include "gui/controls/guiListBoxCtrl.h" 24#include "gfx/gfxDrawUtil.h" 25#include "console/engineAPI.h" 26 27IMPLEMENT_CONOBJECT(GuiListBoxCtrl); 28 29ConsoleDocClass( GuiListBoxCtrl, 30 "@brief A list of text items.\n\n" 31 32 "A list of text items where each individual entry can have its own text value, text color and associated SimObject.\n\n" 33 34 "@tsexample\n" 35 "new GuiListBoxCtrl(GuiMusicPlayerMusicList)\n" 36 "{\n" 37 " allowMultipleSelections = \"true\";\n" 38 " fitParentWidth = \"true\";\n" 39 " mirrorSet = \"AnotherGuiListBoxCtrl\";\n" 40 " makeNameCallback = \"\";\n" 41 " colorBullet = \"1\";\n" 42 " //Properties not specific to this control have been omitted from this example.\n" 43 "};\n" 44 "@endtsexample\n\n" 45 46 "@see GuiControl\n\n" 47 48 "@ingroup GuiCore\n" 49); 50 51IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseDragged, void, (),(), 52 "@brief Called whenever the mouse is dragged across the control.\n\n" 53 "@tsexample\n" 54 "// Mouse is dragged across the control, causing the callback to occur.\n" 55 "GuiListBoxCtrl::onMouseDragged(%this)\n" 56 " {\n" 57 " // Code to run whenever the mouse is dragged across the control\n" 58 " }\n" 59 "@endtsexample\n\n" 60 "@see GuiControl\n\n" 61); 62 63IMPLEMENT_CALLBACK( GuiListBoxCtrl, onClearSelection, void, (),(), 64 "@brief Called whenever a selected item in the list is cleared.\n\n" 65 "@tsexample\n" 66 "// A selected item is cleared, causing the callback to occur.\n" 67 "GuiListBoxCtrl::onClearSelection(%this)\n" 68 " {\n" 69 " // Code to run whenever a selected item is cleared\n" 70 " }\n" 71 "@endtsexample\n\n" 72 "@see GuiControl\n\n" 73); 74 75IMPLEMENT_CALLBACK( GuiListBoxCtrl, onUnSelect, void, ( S32 index, const char* itemText),( index, itemText ), 76 "@brief Called whenever a selected item in the list has been unselected.\n\n" 77 "@param index Index id of the item that was unselected\n" 78 "@param itemText Text for the list entry at the index id that was unselected\n\n" 79 "@tsexample\n" 80 "// A selected item is unselected, causing the callback to occur\n" 81 "GuiListBoxCtrl::onUnSelect(%this, %indexId, %itemText)\n" 82 " {\n" 83 " // Code to run whenever a selected list item is unselected\n" 84 " }\n" 85 "@endtsexample\n\n" 86 "@see GuiControl\n\n" 87); 88 89IMPLEMENT_CALLBACK( GuiListBoxCtrl, onSelect, void, ( S32 index , const char* itemText ),( index, itemText ), 90 "@brief Called whenever an item in the list is selected.\n\n" 91 "@param index Index id for the item in the list that was selected.\n" 92 "@param itemText Text for the list item at the index that was selected.\n\n" 93 "@tsexample\n" 94 "// An item in the list is selected, causing the callback to occur\n" 95 "GuiListBoxCtrl::onSelect(%this, %index, %itemText)\n" 96 " {\n" 97 " // Code to run whenever an item in the list is selected\n" 98 " }\n" 99 "@endtsexample\n\n" 100 "@see GuiControl\n\n" 101); 102 103IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDoubleClick, void, (),(), 104 "@brief Called whenever an item in the list has been double clicked.\n\n" 105 "@tsexample\n" 106 "// An item in the list is double clicked, causing the callback to occur.\n" 107 "GuiListBoxCtrl::onDoubleClick(%this)\n" 108 " {\n" 109 " // Code to run whenever an item in the control has been double clicked\n" 110 " }\n" 111 "@endtsexample\n\n" 112 "@see GuiControl\n\n" 113); 114 115IMPLEMENT_CALLBACK( GuiListBoxCtrl, onMouseUp, void, ( S32 itemHit, S32 mouseClickCount ),( itemHit,mouseClickCount ), 116 "@brief Called whenever the mouse has previously been clicked down (onMouseDown) and has now been raised on the control.\n" 117 "If an item in the list was hit during the click cycle, then the index id of the clicked object along with how many clicks occured are passed\n" 118 "into the callback.\n\n" 119 "Detailed description\n\n" 120 "@param itemHit Index id for the list item that was hit\n" 121 "@param mouseClickCount How many mouse clicks occured on this list item\n\n" 122 "@tsexample\n" 123 "// Mouse was previously clicked down, and now has been released, causing the callback to occur.\n" 124 "GuiListBoxCtrl::onMouseUp(%this, %itemHit, %mouseClickCount)\n" 125 " {\n" 126 " // Code to call whenever the mouse has been clicked and released on the control\n" 127 " }\n" 128 "@endtsexample\n\n" 129 "@see GuiControl\n\n" 130); 131 132IMPLEMENT_CALLBACK( GuiListBoxCtrl, onDeleteKey, void, (),(), 133 "@brief Called whenever the Delete key on the keyboard has been pressed while in this control.\n\n" 134 "@tsexample\n" 135 "// The delete key on the keyboard has been pressed while this control is in focus, causing the callback to occur.\n" 136 "GuiListBoxCtrl::onDeleteKey(%this)\n" 137 " {\n" 138 " // Code to call whenever the delete key is pressed\n" 139 " }\n" 140 "@endtsexample\n\n" 141 "@see GuiControl\n\n" 142); 143 144IMPLEMENT_CALLBACK( GuiListBoxCtrl, isObjectMirrored, bool, ( const char* indexIdString ),( indexIdString ), 145 "@brief Checks if a list item at a defined index id is mirrored, and returns the result.\n\n" 146 "@param indexIdString Index id of the list to check.\n" 147 "@tsexample\n" 148 "// Engine has requested of the script level to determine if a list entry is mirrored or not.\n" 149 "GuiListBoxCtrl::isObjectMirrored(%this, %indexIdString)\n" 150 " {\n" 151 " // Perform code required to check and see if the list item at the index id is mirrored or not.\n" 152 " return %isMirrored;\n" 153 " }\n" 154 "@endtsexample\n\n" 155 "@return A boolean value on if the list item is mirrored or not.\n\n" 156 "@see GuiControl\n\n" 157); 158 159 160GuiListBoxCtrl::GuiListBoxCtrl() 161{ 162 mItems.clear(); 163 mSelectedItems.clear(); 164 mMultipleSelections = true; 165 mFitParentWidth = true; 166 mColorBullet = true; 167 mItemSize = Point2I(10,20); 168 mLastClickItem = NULL; 169 170 mRenderTooltipDelegate.bind( this, &GuiListBoxCtrl::renderTooltip ); 171} 172 173GuiListBoxCtrl::~GuiListBoxCtrl() 174{ 175 clearItems(); 176} 177 178void GuiListBoxCtrl::initPersistFields() 179{ 180 addField( "allowMultipleSelections", TypeBool, Offset( mMultipleSelections, GuiListBoxCtrl), "If true, will allow the selection of multiple items in the listbox.\n"); 181 addField( "fitParentWidth", TypeBool, Offset( mFitParentWidth, GuiListBoxCtrl), "If true, the width of the listbox will match the width of its parent control.\n"); 182 addField( "colorBullet", TypeBool, Offset( mColorBullet, GuiListBoxCtrl), "If true, colored items will render a colored rectangular bullet next to the item text.\n"); 183 184 addField( "mirrorSet", TypeRealString, Offset( mMirrorSetName, GuiListBoxCtrl ), "If populated with the name of another GuiListBoxCtrl, then this list box will mirror the contents of the mirrorSet listbox.\n"); 185 addField( "makeNameCallback", TypeRealString, Offset( mMakeNameCallback, GuiListBoxCtrl ), "A script snippet to control what is displayed in the list for a SimObject. Within this snippet, $ThisControl is bound to the guiListBoxCtrl and $ThisObject to the contained object in question.\n"); 186 187 Parent::initPersistFields(); 188} 189 190bool GuiListBoxCtrl::onWake() 191{ 192 if( !Parent::onWake() ) 193 return false; 194 195 updateSize(); 196 197 return true; 198} 199 200//----------------------------------------------------------------------------- 201// Item Accessors 202//----------------------------------------------------------------------------- 203 204DefineEngineMethod( GuiListBoxCtrl, setMultipleSelection, void, (bool allowMultSelections),, 205 "@brief Enable or disable multiple selections for this GuiListBoxCtrl object.\n\n" 206 "@param allowMultSelections Boolean variable to set the use of multiple selections or not.\n" 207 "@tsexample\n" 208 "// Define the multiple selection use state.\n" 209 "%allowMultSelections = \"true\";\n\n" 210 "// Set the allow multiple selection state on the GuiListBoxCtrl object.\n" 211 "%thisGuiListBoxCtrl.setMultipleSelection(%allowMultSelections);\n" 212 "@endtsexample\n\n" 213 "@see GuiControl\n") 214{ 215 object->setMultipleSelection( allowMultSelections ); 216} 217 218DefineEngineMethod( GuiListBoxCtrl, clearItems, void, (),, 219 "@brief Clears all the items in the listbox.\n\n" 220 "@tsexample\n" 221 "// Inform the GuiListBoxCtrl object to clear all items from its list.\n" 222 "%thisGuiListBoxCtrl.clearItems();\n" 223 "@endtsexample\n\n" 224 "@see GuiControl") 225{ 226 object->clearItems(); 227} 228 229void GuiListBoxCtrl::clearItems() 230{ 231 // Free item list allocated memory 232 while( mItems.size() ) 233 deleteItem( 0 ); 234 235 // Free our vector lists 236 mItems.clear(); 237 mSelectedItems.clear(); 238 mFilteredItems.clear(); 239} 240 241DefineEngineMethod( GuiListBoxCtrl, clearSelection, void, (),, 242 "@brief Sets all currently selected items to unselected.\n\n" 243 "Detailed description\n\n" 244 "@tsexample\n" 245 "// Inform the GuiListBoxCtrl object to set all of its items to unselected./n" 246 "%thisGuiListBoxCtrl.clearSelection();\n" 247 "@endtsexample\n\n" 248 "@see GuiControl") 249{ 250 object->clearSelection(); 251} 252 253void GuiListBoxCtrl::clearSelection() 254{ 255 if( !mSelectedItems.size() ) 256 return; 257 258 VectorPtr<LBItem*>::iterator i = mSelectedItems.begin(); 259 for( ; i != mSelectedItems.end(); i++ ) 260 (*i)->isSelected = false; 261 262 mSelectedItems.clear(); 263 264 onClearSelection_callback(); 265} 266 267DefineEngineMethod( GuiListBoxCtrl, setSelected, void, (S32 index, bool setSelected), (true), 268 "@brief Sets the item at the index specified to selected or not.\n\n" 269 "Detailed description\n\n" 270 "@param index Item index to set selected or unselected.\n" 271 "@param setSelected Boolean selection state to set the requested item index.\n" 272 "@tsexample\n" 273 "// Define the index\n" 274 "%index = \"5\";\n\n" 275 "// Define the selection state\n" 276 "%selected = \"true\"\n\n" 277 "// Inform the GuiListBoxCtrl object of the new selection state for the requested index entry.\n" 278 "%thisGuiListBoxCtrl.setSelected(%index,%selected);\n" 279 "@endtsexample\n\n" 280 "@see GuiControl") 281{ 282 if( setSelected == true ) 283 object->addSelection( index ); 284 else 285 object->removeSelection( index ); 286} 287 288void GuiListBoxCtrl::removeSelection( S32 index ) 289{ 290 // Range Check 291 if( index >= mItems.size() || index < 0 ) 292 { 293 Con::warnf("GuiListBoxCtrl::removeSelection - index out of range!" ); 294 return; 295 } 296 297 removeSelection( mItems[index], index ); 298} 299void GuiListBoxCtrl::removeSelection( LBItem *item, S32 index ) 300{ 301 if( !mSelectedItems.size() ) 302 return; 303 304 if( !item ) 305 return; 306 307 for( S32 i = 0 ; i < mSelectedItems.size(); i++ ) 308 { 309 if( mSelectedItems[i] == item ) 310 { 311 mSelectedItems.erase( &mSelectedItems[i] ); 312 item->isSelected = false; 313 onUnSelect_callback(index, item->itemText); 314 return; 315 } 316 } 317} 318 319void GuiListBoxCtrl::addSelection( S32 index ) 320{ 321 // Range Check 322 if( index >= mItems.size() || index < 0 ) 323 { 324 Con::warnf("GuiListBoxCtrl::addSelection- index out of range!" ); 325 return; 326 } 327 328 addSelection( mItems[index], index ); 329 330} 331void GuiListBoxCtrl::addSelection( LBItem *item, S32 index ) 332{ 333 if( !mMultipleSelections ) 334 { 335 if( !mSelectedItems.empty() ) 336 { 337 LBItem* selItem = mSelectedItems.front(); 338 if( selItem != item ) 339 clearSelection(); 340 else 341 return; 342 } 343 } 344 else 345 { 346 if( !mSelectedItems.empty() ) 347 { 348 for( S32 i = 0; i < mSelectedItems.size(); i++ ) 349 { 350 if( mSelectedItems[ i ] == item ) 351 return; 352 } 353 } 354 } 355 356 item->isSelected = true; 357 mSelectedItems.push_front( item ); 358 359 onSelect_callback(index, item->itemText); 360} 361 362S32 GuiListBoxCtrl::getItemIndex( LBItem *item ) 363{ 364 if( mItems.empty() ) 365 return -1; 366 367 // Lookup the index of an item in our list, by the pointer to the item 368 for( S32 i = 0; i < mItems.size(); i++ ) 369 if( mItems[i] == item ) 370 return i; 371 372 return -1; 373} 374 375DefineEngineMethod( GuiListBoxCtrl, getItemCount, S32, (),, 376 "@brief Returns the number of items in the list.\n\n" 377 "@tsexample\n" 378 "// Request the number of items in the list of the GuiListBoxCtrl object.\n" 379 "%listItemCount = %thisGuiListBoxCtrl.getItemCount();\n" 380 "@endtsexample\n\n" 381 "@return The number of items in the list.\n\n" 382 "@see GuiControl") 383{ 384 return object->getItemCount(); 385} 386 387S32 GuiListBoxCtrl::getItemCount() 388{ 389 return mItems.size(); 390} 391 392DefineEngineMethod( GuiListBoxCtrl, getSelCount, S32, (),, 393 "@brief Returns the number of items currently selected.\n\n" 394 "@tsexample\n" 395 "// Request the number of currently selected items\n" 396 "%selectedItemCount = %thisGuiListBoxCtrl.getSelCount();\n" 397 "@endtsexample\n\n" 398 "@return Number of currently selected items.\n\n" 399 "@see GuiControl") 400{ 401 return object->getSelCount(); 402} 403 404S32 GuiListBoxCtrl::getSelCount() 405{ 406 return mSelectedItems.size(); 407} 408 409DefineEngineMethod( GuiListBoxCtrl, getSelectedItem, S32, (),, 410 "@brief Returns the selected items index or -1 if none selected. If multiple selections exist it returns the first selected item. \n\n" 411 "@tsexample\n" 412 "// Request the index id of the currently selected item\n" 413 "%selectedItemId = %thisGuiListBoxCtrl.getSelectedItem();\n" 414 "@endtsexample\n\n" 415 "@return The selected items index or -1 if none selected.\n\n" 416 "@see GuiControl") 417{ 418 return object->getSelectedItem(); 419} 420 421S32 GuiListBoxCtrl::getSelectedItem() 422{ 423 if( mSelectedItems.empty() || mItems.empty() ) 424 return -1; 425 426 for( S32 i = 0 ; i < mItems.size(); i++ ) 427 if( mItems[i]->isSelected ) 428 return i; 429 430 return -1; 431} 432 433DefineEngineMethod( GuiListBoxCtrl, getSelectedItems, const char*, (),, 434 "@brief Returns a space delimited list of the selected items indexes in the list.\n\n" 435 "@tsexample\n" 436 "// Request a space delimited list of the items in the GuiListBoxCtrl object.\n" 437 "%selectionList = %thisGuiListBoxCtrl.getSelectedItems();\n" 438 "@endtsexample\n\n" 439 "@return Space delimited list of the selected items indexes in the list\n\n" 440 "@see GuiControl") 441{ 442 S32 selCount = object->getSelCount(); 443 if( selCount == -1 || selCount == 0 ) 444 return StringTable->lookup("-1"); 445 else if( selCount == 1 ) 446 return Con::getIntArg(object->getSelectedItem()); 447 448 Vector<S32> selItems; 449 object->getSelectedItems( selItems ); 450 451 if( selItems.empty() ) 452 return StringTable->lookup("-1"); 453 454 static const U32 bufSize = selItems.size() * 4; 455 UTF8 *retBuffer = Con::getReturnBuffer( bufSize ); 456 dMemset( retBuffer, 0, bufSize ); 457 Vector<S32>::iterator i = selItems.begin(); 458 for( ; i != selItems.end(); i++ ) 459 { 460 UTF8 retFormat[12]; 461 dSprintf( retFormat, 12, "%d ", (*i) ); 462 dStrcat( retBuffer, retFormat, 12 ); 463 } 464 465 return retBuffer; 466} 467 468void GuiListBoxCtrl::getSelectedItems( Vector<S32> &Items ) 469{ 470 // Clear our return vector 471 Items.clear(); 472 473 // If there are no selected items, return an empty vector 474 if( mSelectedItems.empty() ) 475 return; 476 477 for( S32 i = 0; i < mItems.size(); i++ ) 478 if( mItems[i]->isSelected ) 479 Items.push_back( i ); 480} 481 482DefineEngineMethod( GuiListBoxCtrl, findItemText, S32, (const char* findText, bool bCaseSensitive), (false), 483 "@brief Returns index of item with matching text or -1 if none found.\n\n" 484 "@param findText Text in the list to find.\n" 485 "@param isCaseSensitive If true, the search will be case sensitive.\n" 486 "@tsexample\n" 487 "// Define the text we wish to find in the list.\n" 488 "%findText = \"Hickory Smoked Gideon\"/n/n" 489 "// Define if this is a case sensitive search or not.\n" 490 "%isCaseSensitive = \"false\";\n\n" 491 "// Ask the GuiListBoxCtrl object what item id in the list matches the requested text.\n" 492 "%matchingId = %thisGuiListBoxCtrl.findItemText(%findText,%isCaseSensitive);\n" 493 "@endtsexample\n\n" 494 "@return Index id of item with matching text or -1 if none found.\n\n" 495 "@see GuiControl") 496{ 497 return object->findItemText( findText, bCaseSensitive ); 498} 499 500S32 GuiListBoxCtrl::findItemText( StringTableEntry text, bool caseSensitive ) 501{ 502 // Check Proper Arguments 503 if( !text || !text[0] || text == StringTable->lookup("") ) 504 { 505 Con::warnf("GuiListBoxCtrl::findItemText - No Text Specified!"); 506 return -1; 507 } 508 509 // Check Items Exist. 510 if( mItems.empty() ) 511 return -1; 512 513 // Lookup the index of an item in our list, by the pointer to the item 514 for( S32 i = 0; i < mItems.size(); i++ ) 515 { 516 // Case Sensitive Compare? 517 if( caseSensitive && ( String::compare( mItems[i]->itemText, text ) == 0 ) ) 518 return i; 519 else if (!caseSensitive && ( dStricmp( mItems[i]->itemText, text ) == 0 )) 520 return i; 521 } 522 523 // Not Found! 524 return -1; 525} 526 527DefineEngineMethod( GuiListBoxCtrl, setCurSel, void, (S32 indexId),, 528 "@brief Sets the currently selected item at the specified index.\n\n" 529 "@param indexId Index Id to set selected.\n" 530 "@tsexample\n" 531 "// Define the index id that we wish to select.\n" 532 "%selectId = \"4\";\n\n" 533 "// Inform the GuiListBoxCtrl object to set the requested index as selected.\n" 534 "%thisGuiListBoxCtrl.setCurSel(%selectId);\n" 535 "@endtsexample\n\n" 536 "@see GuiControl") 537{ 538 object->setCurSel( indexId ); 539} 540void GuiListBoxCtrl::setCurSel( S32 index ) 541{ 542 // Range Check 543 if( index >= mItems.size() ) 544 { 545 Con::warnf("GuiListBoxCtrl::setCurSel - index out of range!" ); 546 return; 547 } 548 549 // If index -1 is specified, we clear the selection 550 if( index == -1 ) 551 { 552 mSelectedItems.clear(); 553 return; 554 } 555 556 // Add the selection 557 addSelection( mItems[ index ], index ); 558 559} 560 561DefineEngineMethod( GuiListBoxCtrl, setCurSelRange, void, (S32 indexStart, S32 indexStop), (999999), 562 "@brief Sets the current selection range from index start to stop. If no stop is specified it sets from start index to the end of the list\n\n" 563 "@param indexStart Index Id to start selection.\n" 564 "@param indexStop Index Id to end selection.\n" 565 "@tsexample\n" 566 "// Set start id\n" 567 "%indexStart = \"3\";\n\n" 568 "// Set end id\n" 569 "%indexEnd = \"6\";\n\n" 570 "// Request the GuiListBoxCtrl object to select the defined range.\n" 571 "%thisGuiListBoxCtrl.setCurSelRange(%indexStart,%indexEnd);\n" 572 "@endtsexample\n\n" 573 "@see GuiControl") 574{ 575 object->setCurSelRange( indexStart , indexStop ); 576} 577 578void GuiListBoxCtrl::setCurSelRange( S32 start, S32 stop ) 579{ 580 // Verify Selection Range 581 if( start < 0 ) 582 start = 0; 583 else if( start > mItems.size() ) 584 start = mItems.size(); 585 586 if( stop < 0 ) 587 stop = 0; 588 else if( stop > mItems.size() ) 589 stop = mItems.size(); 590 591 S32 iterStart = ( start < stop ) ? start : stop; 592 S32 iterStop = ( start < stop ) ? stop : start; 593 594 for( ; iterStart <= iterStop; iterStart++ ) 595 addSelection( mItems[iterStart], iterStart ); 596} 597 598DefineEngineMethod( GuiListBoxCtrl, addItem, S32, (const char* newItem, const char* color), ( "" ), 599 "@brief Adds an item to the end of the list with an optional color.\n\n" 600 "@param newItem New item to add to the list.\n" 601 "@param color Optional color parameter to add to the new item.\n" 602 "@tsexample\n" 603 "// Define the item to add to the list.\n" 604 "%newItem = \"Gideon's Blue Coat\";\n\n" 605 "// Define the optional color for the new list item.\n" 606 "%color = \"0.0 0.0 1.0\";\n\n" 607 "// Inform the GuiListBoxCtrl object to add the item to the end of the list with the defined color.\n" 608 "%thisGuiListBoxCtrl.addItem(%newItem,%color);\n" 609 "@endtsexample\n\n" 610 "@return If not void, return value and description\n\n" 611 "@see GuiControl\n" 612 "@hide") 613{ 614 if(dStricmp(color,"") == 0) 615 { 616 return object->addItem( newItem ); 617 } 618 else 619 { 620 U32 elementCount = GuiListBoxCtrl::getStringElementCount(color); 621 622 if(elementCount == 3) 623 { 624 F32 red, green, blue; 625 626 red = dAtof(GuiListBoxCtrl::getStringElement( color, 0 )); 627 green = dAtof(GuiListBoxCtrl::getStringElement( color, 1 )); 628 blue = dAtof(GuiListBoxCtrl::getStringElement( color, 2 )); 629 630 return object->addItemWithColor( newItem, LinearColorF(red, green, blue) ); 631 } 632 else if(elementCount == 1) 633 { 634 U32 objId = dAtoi( color ); 635 return object->addItem( newItem, (void*)(uintptr_t)objId ); 636 } 637 else 638 { 639 Con::warnf("GuiListBoxCtrl::addItem() - Invalid number of parameters for the color!"); 640 return -1; 641 } 642 } 643} 644 645 static ConsoleDocFragment sGuiControlSetExtent1( 646 "@brief Adds an item to the control with the specific text.\n\n" 647 "@param text Text item to add to the list.\n" 648 "GuiListBoxCtrl", // The class to place the method in; use NULL for functions. 649 "void addItem( const char* text );" ); 650 651 652S32 GuiListBoxCtrl::addItem( StringTableEntry text, void *itemData ) 653{ 654 // This just calls insert item at the end of the list 655 return insertItem( mItems.size(), text, itemData ); 656} 657 658S32 GuiListBoxCtrl::addItemWithColor( StringTableEntry text, LinearColorF color, void *itemData ) 659{ 660 // This just calls insert item at the end of the list 661 return insertItemWithColor( mItems.size(), text, color, itemData ); 662} 663 664DefineEngineMethod( GuiListBoxCtrl, setItemColor, void, (S32 index, LinearColorF color),, 665 "@brief Sets the color of a single list entry at the specified index id.\n\n" 666 "@param index Index id to modify the color of in the list.\n" 667 "@param color Color value to set the list entry to.\n" 668 "@tsexample\n" 669 "// Define the index id value\n" 670 "%index = \"5\";\n\n" 671 "// Define the color value\n" 672 "%color = \"1.0 0.0 0.0\";\n\n" 673 "// Inform the GuiListBoxCtrl object to change the color of the requested index\n" 674 "%thisGuiListBoxCtrl.setItemColor(%index,%color);\n" 675 "@endtsexample\n\n" 676 "@see GuiControl") 677{ 678 object->setItemColor( index, color ); 679} 680 681void GuiListBoxCtrl::setItemColor(S32 index, const LinearColorF& color) 682{ 683 if ((index >= mItems.size()) || index < 0) 684 { 685 Con::warnf("GuiListBoxCtrl::setItemColor - invalid index"); 686 return; 687 } 688 689 LBItem* item = mItems[index]; 690 item->hasColor = true; 691 item->color = color; 692} 693 694DefineEngineMethod( GuiListBoxCtrl, clearItemColor, void, (S32 index),, 695 "@brief Removes any custom coloring from an item at the defined index id in the list.\n\n" 696 "@param index Index id for the item to clear any custom color from.\n" 697 "@tsexample\n" 698 "// Define the index id\n" 699 "%index = \"4\";\n\n" 700 "// Request the GuiListBoxCtrl object to remove any custom coloring from the defined index entry\n" 701 "%thisGuiListBoxCtrl.clearItemColor(%index);\n" 702 "@endtsexample\n\n" 703 "@see GuiControl") 704{ 705 object->clearItemColor(index); 706} 707 708void GuiListBoxCtrl::clearItemColor( S32 index ) 709{ 710 if ((index >= mItems.size()) || index < 0) 711 { 712 Con::warnf("GuiListBoxCtrl::setItemColor - invalid index"); 713 return; 714 } 715 716 LBItem* item = mItems[index]; 717 item->hasColor = false; 718} 719 720DefineEngineMethod( GuiListBoxCtrl, insertItem, void, (const char* text, S32 index),, 721 "@brief Inserts an item into the list at the specified index and returns the index assigned or -1 on error.\n\n" 722 "@param text Text item to add.\n" 723 "@param index Index id to insert the list item text at.\n" 724 "@tsexample\n" 725 "// Define the text to insert\n" 726 "%text = \"Secret Agent Gideon\";\n\n" 727 "// Define the index entry to insert the text at\n" 728 "%index = \"14\";\n\n" 729 "// In form the GuiListBoxCtrl object to insert the text at the defined index.\n" 730 "%assignedId = %thisGuiListBoxCtrl.insertItem(%text,%index);\n" 731 "@endtsexample\n\n" 732 "@return If successful will return the index id assigned. If unsuccessful, will return -1.\n\n" 733 "@see GuiControl") 734{ 735 object->insertItem( index, text ); 736} 737 738S32 GuiListBoxCtrl::insertItem( S32 index, StringTableEntry text, void *itemData ) 739{ 740 // If the index is greater than our list size, insert it at the end 741 if( index >= mItems.size() ) 742 index = mItems.size(); 743 744 // Sanity checking 745 if( !text ) 746 { 747 Con::warnf("GuiListBoxCtrl::insertItem - cannot add NULL string" ); 748 return -1; 749 } 750 751 LBItem *newItem = new LBItem; 752 753 // Assign item data 754 newItem->itemText = StringTable->insert(text, true); 755 newItem->itemData = itemData; 756 newItem->isSelected = false; 757 newItem->hasColor = false; 758 759 // Add to list 760 mItems.insert(index); 761 mItems[index] = newItem; 762 763 // Resize our list to fit our items 764 updateSize(); 765 766 // Return our index in list (last) 767 return index; 768 769} 770 771S32 GuiListBoxCtrl::insertItemWithColor( S32 index, StringTableEntry text, LinearColorF color, void *itemData ) 772{ 773 // If the index is greater than our list size, insert it at the end 774 if( index >= mItems.size() ) 775 index = mItems.size(); 776 777 // Sanity checking 778 if( !text ) 779 { 780 Con::warnf("GuiListBoxCtrl::insertItem - cannot add NULL string" ); 781 return -1; 782 } 783 784 if( color == LinearColorF(-1, -1, -1) ) 785 { 786 Con::warnf("GuiListBoxCtrl::insertItem - cannot add NULL color" ); 787 return -1; 788 } 789 790 LBItem *newItem = new LBItem; 791 792 // Assign item data 793 newItem->itemText = StringTable->insert(text, true); 794 newItem->itemData = itemData; 795 newItem->isSelected = false; 796 newItem->hasColor = true; 797 newItem->color = color; 798 799 // Add to list 800 mItems.insert(index); 801 mItems[index] = newItem; 802 803 // Resize our list to fit our items 804 updateSize(); 805 806 // Return our index in list (last) 807 return index; 808 809} 810 811DefineEngineMethod( GuiListBoxCtrl, deleteItem, void, (S32 itemIndex),, 812 "@brief Removes the list entry at the requested index id from the control and clears the memory associated with it.\n\n" 813 "@param itemIndex Index id location to remove the item from.\n" 814 "@tsexample\n" 815 "// Define the index id we want to remove from the list\n" 816 "%itemIndex = \"8\";\n\n" 817 "// Inform the GuiListBoxCtrl object to remove the item at the defined index id.\n" 818 "%thisGuiListBoxCtrl.deleteItem(%itemIndex);\n" 819 "@endtsexample\n\n" 820 "@see References") 821{ 822 object->deleteItem( itemIndex ); 823} 824 825void GuiListBoxCtrl::deleteItem( S32 index ) 826{ 827 // Range Check 828 if( index >= mItems.size() || index < 0 ) 829 { 830 Con::warnf("GuiListBoxCtrl::deleteItem - index out of range!" ); 831 return; 832 } 833 834 // Grab our item 835 LBItem* item = mItems[ index ]; 836 if( !item ) 837 { 838 Con::warnf("GuiListBoxCtrl::deleteItem - Bad Item Data!" ); 839 return; 840 } 841 842 // Remove it from the selected list. 843 if( item->isSelected ) 844 { 845 for( VectorPtr<LBItem*>::iterator i = mSelectedItems.begin(); i != mSelectedItems.end(); i++ ) 846 { 847 if( item == *i ) 848 { 849 mSelectedItems.erase_fast( i ); 850 break; 851 } 852 } 853 } 854 855 // Remove it from the list 856 mItems.erase( &mItems[ index ] ); 857 858 // Free the memory associated with it 859 delete item; 860} 861 862DefineEngineMethod( GuiListBoxCtrl, getItemText, const char*, (S32 index),, 863 "@brief Returns the text of the item at the specified index.\n\n" 864 "@param index Index id to return the item text from.\n" 865 "@tsexample\n" 866 "// Define the index id entry to request the text from\n" 867 "%index = \"12\";\n\n" 868 "// Request the item id text from the GuiListBoxCtrl object.\n" 869 "%text = %thisGuiListBoxCtrl.getItemText(%index);\n" 870 "@endtsexample\n\n" 871 "@return The text of the requested index id.\n\n" 872 "@see GuiControl") 873{ 874 return object->getItemText( index ); 875} 876 877StringTableEntry GuiListBoxCtrl::getItemText( S32 index ) 878{ 879 // Range Checking 880 if( index > mItems.size() || index < 0 ) 881 { 882 Con::warnf( "GuiListBoxCtrl::getItemText - index out of range!" ); 883 return StringTable->lookup(""); 884 } 885 886 return mItems[ index ]->itemText; 887} 888 889DefineEngineMethod( GuiListBoxCtrl, getItemObject, const char*, (S32 index),, 890 "@brief Returns the object associated with an item. This only makes sense if you are mirroring a simset.\n\n" 891 "@param index Index id to request the associated item from.\n" 892 "@tsexample\n" 893 "// Define the index id\n" 894 "%index = \"12\";\n\n" 895 "// Request the item from the GuiListBoxCtrl object\n" 896 "%object = %thisGuiListBoxCtrl.getItemObject(%index);\n" 897 "@endtsexample\n\n" 898 "@return The object associated with the item in the list.\n\n" 899 "@see References") 900{ 901 SimObject *outObj = object->getItemObject( index ); 902 if ( !outObj ) 903 return NULL; 904 905 return outObj->getIdString(); 906} 907 908SimObject* GuiListBoxCtrl::getItemObject( S32 index ) 909{ 910 // Range Checking 911 if( index > mItems.size() || index < 0 ) 912 { 913 Con::warnf( "GuiListBoxCtrl::getItemObject - index out of range!" ); 914 return NULL; 915 } 916 917 SimObject *outObj; 918 Sim::findObject( (SimObjectId)(uintptr_t)(mItems[ index ]->itemData), outObj ); 919 920 return outObj; 921} 922 923DefineEngineMethod( GuiListBoxCtrl, setItemText, void, (S32 index, const char* newtext),, 924 "@brief Sets the items text at the specified index.\n\n" 925 "@param index Index id to set the item text at.\n" 926 "@param newtext Text to change the list item at index id to.\n" 927 "@tsexample\n" 928 "// Define the index id/n" 929 "%index = \"12\";\n\n" 930 "// Define the text to set the list item to\n" 931 "%newtext = \"Gideon's Fancy Goggles\";\n\n" 932 "// Inform the GuiListBoxCtrl object to change the text at the requested index\n" 933 "%thisGuiListBoxCtrl.setItemText(%index,%newText);\n" 934 "@endtsexample\n\n" 935 "@see GuiControl") 936{ 937 object->setItemText(index, newtext ); 938} 939 940void GuiListBoxCtrl::setItemText( S32 index, StringTableEntry text ) 941{ 942 // Sanity Checking 943 if( !text ) 944 { 945 Con::warnf("GuiListBoxCtrl::setItemText - Invalid Text Specified!" ); 946 return; 947 } 948 // Range Checking 949 if( index > mItems.size() || index < 0 ) 950 { 951 Con::warnf( "GuiListBoxCtrl::getItemText - index out of range!" ); 952 return; 953 } 954 955 mItems[ index ]->itemText = StringTable->insert( text, true ); 956} 957 958DefineEngineMethod( GuiListBoxCtrl, setItemTooltip, void, (S32 index, const char* text),, 959 "@brief Set the tooltip text to display for the given list item.\n\n" 960 "@param index Index id to change the tooltip text\n" 961 "@param text Text for the tooltip.\n" 962 "@tsexample\n" 963 "// Define the index id\n" 964 "%index = \"12\";\n\n" 965 "// Define the tooltip text\n" 966 "%tooltip = \"Gideon's goggles can see through space and time.\"\n\n" 967 "// Inform the GuiListBoxCtrl object to set the tooltop for the item at the defined index id\n" 968 "%thisGuiListBoxCtrl.setItemToolTip(%index,%tooltip);\n" 969 "@endtsexample\n\n" 970 "@see GuiControl") 971{ 972 if( index > object->mItems.size() || index < 0 ) 973 { 974 Con::errorf( "GuiListBoxCtrl::setItemTooltip - index '%i' out of range", index ); 975 return; 976 } 977 978 object->mItems[ index ]->itemTooltip = text; 979} 980 981DefineEngineMethod( GuiListBoxCtrl, getLastClickItem, S32, (),, 982 "@brief Request the item index for the item that was last clicked.\n\n" 983 "@tsexample\n" 984 "// Request the item index for the last clicked item in the list\n" 985 "%lastClickedIndex = %thisGuiListBoxCtrl.getLastClickItem();\n" 986 "@endtsexample\n\n" 987 "@return Index id for the last clicked item in the list.\n\n" 988 "@see GuiControl") 989{ 990 GuiListBoxCtrl::LBItem *lastItem = object->mLastClickItem; 991 if ( !lastItem ) 992 return -1; 993 994 return object->getItemIndex( lastItem ); 995} 996 997//----------------------------------------------------------------------------- 998// Sizing Functions 999//----------------------------------------------------------------------------- 1000void GuiListBoxCtrl::updateSize() 1001{ 1002 if( !mProfile || !mProfile->mFont ) 1003 return; 1004 1005 GFont *font = mProfile->mFont; 1006 GuiScrollCtrl* parent = dynamic_cast<GuiScrollCtrl *>(getParent()); 1007 1008 if ( mFitParentWidth && parent ) 1009 mItemSize.x = parent->getContentExtent().x; 1010 else 1011 { 1012 // Find the maximum width cell: 1013 S32 maxWidth = 1; 1014 for ( U32 i = 0; i < mItems.size(); i++ ) 1015 { 1016 S32 width = font->getStrWidth( mItems[i]->itemText ); 1017 if( width > maxWidth ) 1018 maxWidth = width; 1019 } 1020 mItemSize.x = maxWidth + 6; 1021 } 1022 1023 mItemSize.y = font->getHeight() + 2; 1024 1025 Point2I newExtent( mItemSize.x, mItemSize.y * mItems.size() ); 1026 setExtent( newExtent ); 1027 1028} 1029 1030void GuiListBoxCtrl::parentResized(const RectI &oldParentRect, const RectI &newParentRect) 1031{ 1032 Parent::parentResized( oldParentRect, newParentRect ); 1033 1034 updateSize(); 1035} 1036 1037//----------------------------------------------------------------------------- 1038// Overrides 1039//----------------------------------------------------------------------------- 1040void GuiListBoxCtrl::onRender( Point2I offset, const RectI &updateRect ) 1041{ 1042 RectI clipRect(updateRect.point, updateRect.extent); 1043 1044 if( !mProfile ) 1045 return; 1046 1047 _mirror(); 1048 1049 // Save our original clip rect 1050 RectI oldClipRect = clipRect; 1051 1052 for ( S32 i = 0; i < mItems.size(); i++) 1053 { 1054 S32 colorBoxSize = 0; 1055 ColorI boxColor = ColorI(0, 0, 0); 1056 // Only render visible items 1057 if ((i + 1) * mItemSize.y + offset.y < updateRect.point.y) 1058 continue; 1059 1060 // Break our once we're no longer in visible item range 1061 if( i * mItemSize.y + offset.y >= updateRect.point.y + updateRect.extent.y) 1062 break; 1063 1064 // Render color box if needed 1065 if(mColorBullet && mItems[i]->hasColor) 1066 { 1067 // Set the size of the color box to be drawn next to the item text 1068 colorBoxSize = 3; 1069 boxColor = ColorI(mItems[i]->color.toColorI()); 1070 // Draw the box first 1071 ColorI black = ColorI(0, 0, 0); 1072 drawBox( Point2I(offset.x + mProfile->mTextOffset.x + colorBoxSize, offset.y + ( i * mItemSize.y ) + 8), colorBoxSize, black, boxColor ); 1073 } 1074 1075 RectI itemRect = RectI( offset.x + mProfile->mTextOffset.x + (colorBoxSize * 3), offset.y + ( i * mItemSize.y ), mItemSize.x, mItemSize.y ); 1076 1077 // Render our item 1078 onRenderItem( itemRect, mItems[i] ); 1079 } 1080 1081 GFX->setClipRect( oldClipRect ); 1082} 1083 1084void GuiListBoxCtrl::onRenderItem(const RectI& itemRect, LBItem *item) 1085{ 1086 if( item->isSelected ) 1087 GFX->getDrawUtil()->drawRectFill( itemRect, mProfile->mFillColorSEL ); 1088 1089 GFX->getDrawUtil()->setBitmapModulation( item->hasColor ? item->color.toColorI() : mProfile->mFontColor); 1090 renderJustifiedText(itemRect.point + Point2I( 2, 0 ), itemRect.extent, item->itemText); 1091} 1092 1093void GuiListBoxCtrl::drawBox(const Point2I &box, S32 size, ColorI &outlineColor, ColorI &boxColor) 1094{ 1095 RectI r(box.x - size, box.y - size, 2 * size + 1, 2 * size + 1); 1096 r.inset(1, 1); 1097 GFX->getDrawUtil()->drawRectFill(r, boxColor); 1098 r.inset(-1, -1); 1099 GFX->getDrawUtil()->drawRect(r, outlineColor); 1100} 1101 1102bool GuiListBoxCtrl::renderTooltip( const Point2I &hoverPos, const Point2I& cursorPos, const char* tipText ) 1103{ 1104 S32 hitItemIndex; 1105 if( hitTest( hoverPos, hitItemIndex ) ) 1106 tipText = mItems[ hitItemIndex ]->itemTooltip; 1107 1108 return defaultTooltipRender( hoverPos, cursorPos, tipText ); 1109} 1110 1111//----------------------------------------------------------------------------- 1112// Hit Detection 1113//----------------------------------------------------------------------------- 1114 1115bool GuiListBoxCtrl::hitTest( const Point2I& point, S32& outItem ) 1116{ 1117 Point2I localPoint = globalToLocalCoord( point ); 1118 1119 S32 itemHit = ( localPoint.y < 0 ) ? -1 : (S32)mFloor( (F32)localPoint.y / (F32)mItemSize.y ); 1120 if ( itemHit >= mItems.size() || itemHit == -1 ) 1121 return false; 1122 1123 LBItem *hitItem = mItems[ itemHit ]; 1124 if ( hitItem == NULL ) 1125 return false; 1126 1127 outItem = itemHit; 1128 return true; 1129} 1130 1131//----------------------------------------------------------------------------- 1132// Mouse Events 1133//----------------------------------------------------------------------------- 1134 1135void GuiListBoxCtrl::onMouseDragged(const GuiEvent &event) 1136{ 1137 Parent::onMouseDragged(event); 1138 1139 onMouseDragged_callback(); 1140} 1141 1142void GuiListBoxCtrl::onMouseDown( const GuiEvent &event ) 1143{ 1144 S32 itemHit; 1145 if( !hitTest( event.mousePoint, itemHit ) ) 1146 return; 1147 1148 LBItem* hitItem = mItems[ itemHit ]; 1149 1150 // If we're not a multiple selection listbox, we simply select/unselect an item 1151 if( !mMultipleSelections ) 1152 { 1153 // No current selection? Just select the cell and move on 1154 S32 selItem = getSelectedItem(); 1155 1156 if ( selItem != itemHit && selItem != -1 ) 1157 clearSelection(); 1158 1159 // Set the current selection 1160 setCurSel( itemHit ); 1161 1162 if( itemHit == selItem && event.mouseClickCount == 2 ) 1163 onDoubleClick_callback(); 1164 1165 // Store the clicked item 1166 mLastClickItem = hitItem; 1167 1168 // Evaluate the console command if we clicked the same item twice 1169 if( selItem == itemHit && event.mouseClickCount > 1 ) 1170 execAltConsoleCallback(); 1171 1172 return; 1173 1174 } 1175 1176 // Deal with multiple selections 1177 if( event.modifier & SI_MULTISELECT) 1178 { 1179 // Ctrl-Click toggles selection 1180 if( hitItem->isSelected ) 1181 { 1182 removeSelection( hitItem, itemHit ); 1183 1184 // We return here when we deselect an item because we don't store last clicked when we deselect 1185 return; 1186 } 1187 else 1188 addSelection( hitItem, itemHit ); 1189 } 1190 else if( event.modifier & SI_RANGESELECT ) 1191 { 1192 if( !mLastClickItem ) 1193 addSelection( hitItem, itemHit ); 1194 else 1195 setCurSelRange( getItemIndex( mLastClickItem ), itemHit ); 1196 } 1197 else 1198 { 1199 if( getSelCount() != 0 ) 1200 { 1201 S32 selItem = getSelectedItem(); 1202 if( selItem != -1 && mItems[selItem] != hitItem ) 1203 clearSelection(); 1204 } 1205 addSelection( hitItem, itemHit ); 1206 } 1207 1208 if( hitItem == mLastClickItem && event.mouseClickCount == 2 ) 1209 onDoubleClick_callback(); 1210 1211 mLastClickItem = hitItem; 1212} 1213 1214void GuiListBoxCtrl::onMouseUp( const GuiEvent& event ) 1215{ 1216 S32 itemHit = -1; 1217 if( hitTest( event.mousePoint, itemHit ) ) 1218 onMouseUp_callback( itemHit, event.mouseClickCount ); 1219 1220 // Execute console command 1221 execConsoleCallback(); 1222 1223 Parent::onMouseUp( event ); 1224} 1225 1226bool GuiListBoxCtrl::onKeyDown( const GuiEvent &event ) 1227{ 1228 if ( event.keyCode == KEY_DELETE ) 1229 { 1230 onDeleteKey_callback(); 1231 return true; 1232 } 1233 1234 return Parent::onKeyDown( event ); 1235} 1236 1237U32 GuiListBoxCtrl::getStringElementCount( const char* inString ) 1238{ 1239 // Non-whitespace chars. 1240 static const char* set = " \t\n"; 1241 1242 // End of string. 1243 if ( *inString == 0 ) 1244 return 0; 1245 1246 U32 wordCount = 0; 1247 U8 search = 0; 1248 1249 // Search String. 1250 while( *inString ) 1251 { 1252 // Get string element. 1253 search = *inString; 1254 1255 // End of string? 1256 if ( search == 0 ) 1257 break; 1258 1259 // Move to next element. 1260 inString++; 1261 1262 // Search for seperators. 1263 for( U32 i = 0; set[i]; i++ ) 1264 { 1265 // Found one? 1266 if( search == set[i] ) 1267 { 1268 // Yes... 1269 search = 0; 1270 break; 1271 } 1272 } 1273 1274 // Found a seperator? 1275 if ( search == 0 ) 1276 continue; 1277 1278 // We've found a non-seperator. 1279 wordCount++; 1280 1281 // Search for end of non-seperator. 1282 while( 1 ) 1283 { 1284 // Get string element. 1285 search = *inString; 1286 1287 // End of string? 1288 if ( search == 0 ) 1289 break; 1290 1291 // Move to next element. 1292 inString++; 1293 1294 // Search for seperators. 1295 for( U32 i = 0; set[i]; i++ ) 1296 { 1297 // Found one? 1298 if( search == set[i] ) 1299 { 1300 // Yes... 1301 search = 0; 1302 break; 1303 } 1304 } 1305 1306 // Found Seperator? 1307 if ( search == 0 ) 1308 break; 1309 } 1310 1311 // End of string? 1312 if ( *inString == 0 ) 1313 { 1314 // Bah! 1315 break; 1316 } 1317 } 1318 1319 // We've finished. 1320 return wordCount; 1321} 1322 1323//------------------------------------------------------------------------------ 1324// Get String Element. 1325//------------------------------------------------------------------------------ 1326const char* GuiListBoxCtrl::getStringElement( const char* inString, const U32 index ) 1327{ 1328 // Non-whitespace chars. 1329 static const char* set = " \t\n"; 1330 1331 U32 wordCount = 0; 1332 U8 search = 0; 1333 const char* pWordStart = NULL; 1334 1335 // End of string? 1336 if ( *inString != 0 ) 1337 { 1338 // No, so search string. 1339 while( *inString ) 1340 { 1341 // Get string element. 1342 search = *inString; 1343 1344 // End of string? 1345 if ( search == 0 ) 1346 break; 1347 1348 // Move to next element. 1349 inString++; 1350 1351 // Search for seperators. 1352 for( U32 i = 0; set[i]; i++ ) 1353 { 1354 // Found one? 1355 if( search == set[i] ) 1356 { 1357 // Yes... 1358 search = 0; 1359 break; 1360 } 1361 } 1362 1363 // Found a seperator? 1364 if ( search == 0 ) 1365 continue; 1366 1367 // Found are word? 1368 if ( wordCount == index ) 1369 { 1370 // Yes, so mark it. 1371 pWordStart = inString-1; 1372 } 1373 1374 // We've found a non-seperator. 1375 wordCount++; 1376 1377 // Search for end of non-seperator. 1378 while( 1 ) 1379 { 1380 // Get string element. 1381 search = *inString; 1382 1383 // End of string? 1384 if ( search == 0 ) 1385 break; 1386 1387 // Move to next element. 1388 inString++; 1389 1390 // Search for seperators. 1391 for( U32 i = 0; set[i]; i++ ) 1392 { 1393 // Found one? 1394 if( search == set[i] ) 1395 { 1396 // Yes... 1397 search = 0; 1398 break; 1399 } 1400 } 1401 1402 // Found Seperator? 1403 if ( search == 0 ) 1404 break; 1405 } 1406 1407 // Have we found our word? 1408 if ( pWordStart ) 1409 { 1410 // Yes, so we've got our word... 1411 1412 // Result Buffer. 1413 static char buffer[4096]; 1414 1415 // Calculate word length. 1416 const U32 length = inString - pWordStart - ((*inString)?1:0); 1417 1418 // Copy Word. 1419 dStrncpy( buffer, pWordStart, length); 1420 buffer[length] = '\0'; 1421 1422 // Return Word. 1423 return buffer; 1424 } 1425 1426 // End of string? 1427 if ( *inString == 0 ) 1428 { 1429 // Bah! 1430 break; 1431 } 1432 } 1433 } 1434 1435 // Sanity! 1436 AssertFatal( false, "t2dSceneObject::getStringElement() - Couldn't find specified string element!" ); 1437 // Didn't find it 1438 return " "; 1439} 1440 1441void GuiListBoxCtrl::_mirror() 1442{ 1443 SimSet *mirrorSet; 1444 if ( !Sim::findObject( mMirrorSetName, mirrorSet ) ) 1445 return; 1446 1447 // Allow script to filter out objects if desired. 1448 1449 Vector<SimObjectId> workingSet; 1450 1451 // If the method is not defined we assume user wants us to add 1452 // all objects. 1453 bool isObjMirroredDefined = isMethod( "isObjectMirrored" ); 1454 1455 for ( S32 i = 0; i < mirrorSet->size(); i++ ) 1456 { 1457 bool addObj = true; 1458 1459 if ( isObjMirroredDefined ) 1460 addObj = isObjectMirrored_callback(mirrorSet->at(i)->getIdString()); 1461 1462 if ( addObj ) 1463 workingSet.push_back( mirrorSet->at(i)->getId() ); 1464 } 1465 1466 1467 // Remove existing items that are no longer in the SimSet. 1468 // Or are no longer valid objects. 1469 1470 SimObjectId curId; 1471 SimObject *curObj; 1472 1473 for ( U32 i = 0; i < mItems.size(); i++ ) 1474 { 1475 curId = (SimObjectId)(uintptr_t)mItems[i]->itemData; 1476 1477 Sim::findObject( curId, curObj ); 1478 1479 bool keep = false; 1480 1481 if ( curObj ) 1482 { 1483 if ( workingSet.contains( curId ) ) 1484 { 1485 mItems[i]->itemText = _makeMirrorItemName( curObj ); 1486 keep = true; 1487 } 1488 } 1489 1490 if ( !keep ) 1491 { 1492 deleteItem( i ); 1493 i--; 1494 } 1495 } 1496 1497 1498 // Add items that are in the SimSet but not yet in the list. 1499 1500 for ( U32 i = 0; i < workingSet.size(); i++ ) 1501 { 1502 curId = workingSet[i]; 1503 Sim::findObject( curId, curObj ); 1504 1505 bool found = false; 1506 1507 for ( U32 j = 0; j < mItems.size(); j++ ) 1508 { 1509 if ( (SimObjectId)(uintptr_t)(mItems[j]->itemData) == curId ) 1510 { 1511 found = true; 1512 break; 1513 } 1514 } 1515 1516 for ( U32 j = 0; j < mFilteredItems.size(); j++ ) 1517 { 1518 if ( (SimObjectId)(uintptr_t)(mFilteredItems[j]->itemData) == curId ) 1519 { 1520 found = true; 1521 break; 1522 } 1523 } 1524 1525 if ( !found ) 1526 { 1527 addItem( _makeMirrorItemName( curObj ), (void*)(uintptr_t)curId ); 1528 } 1529 } 1530} 1531 1532StringTableEntry GuiListBoxCtrl::_makeMirrorItemName( SimObject *inObj ) 1533{ 1534 StringTableEntry outName = StringTable->EmptyString(); 1535 1536 if ( mMakeNameCallback.isNotEmpty() ) 1537 { 1538 Con::setIntVariable( "$ThisControl", getId() ); 1539 Con::setIntVariable( "$ThisObject", inObj->getId() ); 1540 1541 outName = StringTable->insert( Con::evaluate( mMakeNameCallback ), true ); 1542 } 1543 else if ( inObj->getName() ) 1544 outName = StringTable->insert( inObj->getName() ); 1545 1546 if ( !outName || !outName[0] ) 1547 outName = StringTable->insert( "(no name)" ); 1548 1549 return outName; 1550} 1551 1552DefineEngineMethod( GuiListBoxCtrl, doMirror, void, (),, 1553 "@brief Informs the GuiListBoxCtrl object to mirror the contents of the GuiListBoxCtrl stored in the mirrorSet field.\n\n" 1554 "@tsexample\n" 1555 "\\ Inform the object to mirror the object located at %thisGuiListBox.mirrorSet\n" 1556 "%thisGuiListBox.doMirror();\n" 1557 "@endtsexample\n\n" 1558 "@see GuiCore") 1559{ 1560 object->_mirror(); 1561} 1562 1563DefineEngineMethod( GuiListBoxCtrl, addFilteredItem, void, (const char* newItem),, 1564 "@brief Checks if there is an item with the exact text of what is passed in, and if so\n" 1565 "the item is removed from the list and adds that item's data to the filtered list.\n\n" 1566 "@param itemName Name of the item that we wish to add to the filtered item list of the GuiListBoxCtrl.\n" 1567 "@tsexample\n" 1568 "// Define the itemName that we wish to add to the filtered item list.\n" 1569 "%itemName = \"This Item Name\";\n\n" 1570 "// Add the item name to the filtered item list.\n" 1571 "%thisGuiListBoxCtrl.addFilteredItem(%filteredItemName);\n" 1572 "@endtsexample\n\n" 1573 "@see GuiControl") 1574{ 1575 String item(newItem); 1576 if( item == String::EmptyString ) 1577 return; 1578 1579 object->addFilteredItem( item ); 1580} 1581 1582void GuiListBoxCtrl::addFilteredItem( String item ) 1583{ 1584 // Delete from selected items list 1585 for ( S32 i = 0; i < mSelectedItems.size(); i++ ) 1586 { 1587 String itemText = mSelectedItems[i]->itemText; 1588 if ( String::compare( itemText.c_str(), item.c_str() ) == 0 ) 1589 { 1590 mSelectedItems.erase_fast( i ); 1591 break; 1592 } 1593 } 1594 1595 for ( S32 i = 0; i < mItems.size(); i++ ) 1596 { 1597 String itemText = mItems[i]->itemText; 1598 if( String::compare( itemText.c_str(), item.c_str() ) == 0 ) 1599 { 1600 mItems[i]->isSelected = false; 1601 mFilteredItems.push_front( mItems[i] ); 1602 mItems.erase( &mItems[i] ); 1603 break; 1604 } 1605 } 1606} 1607 1608DefineEngineMethod( GuiListBoxCtrl, removeFilteredItem, void, ( const char* itemName ),, 1609 "@brief Removes an item of the entered name from the filtered items list.\n\n" 1610 "@param itemName Name of the item to remove from the filtered list.\n" 1611 "@tsexample\n" 1612 "// Define the itemName that you wish to remove.\n" 1613 "%itemName = \"This Item Name\";\n\n" 1614 "// Remove the itemName from the GuiListBoxCtrl\n" 1615 "%thisGuiListBoxCtrl.removeFilteredItem(%itemName);\n" 1616 "@endtsexample\n\n" 1617 "@see GuiControl") 1618{ 1619 String item(itemName); 1620 if( item == String::EmptyString ) 1621 return; 1622 1623 object->removeFilteredItem( item ); 1624} 1625 1626void GuiListBoxCtrl::removeFilteredItem( String item ) 1627{ 1628 for ( S32 i = 0; i < mFilteredItems.size(); i++ ) 1629 { 1630 String itemText = mFilteredItems[i]->itemText; 1631 if( String::compare( itemText.c_str(), item.c_str() ) == 0 ) 1632 { 1633 mItems.push_front( mFilteredItems[i] ); 1634 mFilteredItems.erase( &mFilteredItems[i] ); 1635 break; 1636 } 1637 } 1638} 1639