GuiGridListInsertRowAfter: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This allows you to insert a new row after a specified row. Good for inserting new rows in the middle of existing rows. | This allows you to insert a new row after a specified row, and simultaneously set text. Good for inserting new rows in the middle of existing rows. | ||
==Syntax== | ==Syntax== | ||
Line 8: | Line 8: | ||
int guiGridListInsertRowAfter ( element gridList, int rowIndex ) | int guiGridListInsertRowAfter ( element gridList, int rowIndex ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{New feature/item|3.0153|1.5.3|| | |||
<syntaxhighlight lang="lua"> | |||
int guiGridListInsertRowAfter ( element gridList, int rowIndex, int/string itemText1, int/string itemText2, ... ) | |||
</syntaxhighlight> | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''gridList:''' The grid list you want to add a row to | *'''gridList:''' The grid list you want to add a row to | ||
*'''rowIndex:''' Row ID of the row you want to insert the '''new row''' after. | *'''rowIndex:''' Row ID of the row you want to insert the '''new row''' after. | ||
===Optional Arguments=== | |||
{{New feature/item|3.0153|1.5.3|| | |||
*'''itemText1:''' The text for the first column item in the row. Either a string or a number can be passed (use numbers for sorting purposes). | |||
*'''itemText2:''' The text for the second column item in the row. Either a string or a number can be passed (use numbers for sorting purposes). | |||
*'''...:''' Item text for any other columns | |||
}} | |||
===Returns=== | ===Returns=== |
Revision as of 12:18, 3 July 2016
This allows you to insert a new row after a specified row, and simultaneously set text. Good for inserting new rows in the middle of existing rows.
Syntax
int guiGridListInsertRowAfter ( element gridList, int rowIndex )
int guiGridListInsertRowAfter ( element gridList, int rowIndex, int/string itemText1, int/string itemText2, ... )
Required Arguments
- gridList: The grid list you want to add a row to
- rowIndex: Row ID of the row you want to insert the new row after.
Optional Arguments
- itemText1: The text for the first column item in the row. Either a string or a number can be passed (use numbers for sorting purposes).
- itemText2: The text for the second column item in the row. Either a string or a number can be passed (use numbers for sorting purposes).
- ...: Item text for any other columns
Returns
Returns true if the row was successfully added, false otherwise.
Example
This example would create a gridlist then add the current players in the server and if anyone joins, it would insert a row at the bottom.
gridlist = guiCreateGridList(100,100,200,100,false) guiGridListAddColumn(gridlist,"Players",0.50) for i,v in ipairs(getElementsByType("player"))do guiGridListSetItemText(gridlist,guiGridListAddRow(gridlist),1,getPlayerName(v),false,false) end addEventHandler("onClientPlayerJoin",root,function() guiGridListSetItemText(gridlist,guiGridListInsertRowAfter(gridlist,guiGridListGetRowCount(gridlist)),1,getPlayerName(source),false,false)--Add row at the bottom of the gridlist and name it the players name end)
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