GuiGridListGetItemData: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
With this function you can retrieve the string data associated with an item in a grid list. This is not the text that is displayed on the item, but an internal string that you can use to hold extra information about the item. | With this function you can retrieve the [[string]] data associated with an item in a [[Element/GUI/Gridlist|grid list]]. This is not the text that is displayed on the item, but an internal string that you can use to hold extra information about the item. | ||
==Syntax== | ==Syntax== | ||
Line 14: | Line 14: | ||
===Returns=== | ===Returns=== | ||
Returns a string with the item data of the specified item if succesful, ''false'' if one of the arguments was invalid. | Returns a [[string]] with the item data of the specified item if succesful, ''false'' if one of the arguments was invalid. | ||
==Example== | ==Example== | ||
This example displays a random item data from the gridlist. | |||
<syntaxhighlight lang="lua"> | |||
This example displays a random item data from the gridlist | function clientsideResourceStart () | ||
<syntaxhighlight lang="lua">function clientsideResourceStart () | |||
local numberList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) | local numberList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) | ||
local column = guiGridListAddColumn( numberList, "Column Title", 0.85 ) | local column = guiGridListAddColumn ( numberList, "Column Title", 0.85 ) | ||
if ( column ) then | if ( column ) then | ||
row = guiGridListAddRow ( numberList ) | local row = guiGridListAddRow ( numberList ) | ||
myItem = guiGridListSetItemText ( numberList, row, column, tostring(math.random(0, 10) ^ 100), false, false ) | local myItem = guiGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ), false, false ) | ||
myItemData = guiGridListGetItemData ( numberList, row, column ) | local myItemData = guiGridListGetItemData ( numberList, row, column ) | ||
outputChatBox ( "My gridlist item data: " .. myItemData ) | |||
end | end | ||
end | end | ||
Line 34: | Line 33: | ||
==See Also== | ==See Also== | ||
{{GUI functions}} | {{GUI functions}} | ||
Revision as of 20:41, 25 March 2009
With this function you can retrieve the string data associated with an item in a grid list. This is not the text that is displayed on the item, but an internal string that you can use to hold extra information about the item.
Syntax
string guiGridListGetItemData ( element gridList, int rowIndex, int columnIndex )
Required Arguments
- gridList: the grid list containing the item you're interested in
- rowIndex: the row index of the item
- columnIndex: the column index of the item
Returns
Returns a string with the item data of the specified item if succesful, false if one of the arguments was invalid.
Example
This example displays a random item data from the gridlist.
function clientsideResourceStart () local numberList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) local column = guiGridListAddColumn ( numberList, "Column Title", 0.85 ) if ( column ) then local row = guiGridListAddRow ( numberList ) local myItem = guiGridListSetItemText ( numberList, row, column, tostring( math.random(0, 10) ^ 100 ), false, false ) local myItemData = guiGridListGetItemData ( numberList, row, column ) outputChatBox ( "My gridlist item data: " .. myItemData ) end end addEventHandler ( "onClientResourceStart", getRootElement(), clientsideResourceStart )
See Also
General functions
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign