GuiGridListGetRowCount: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | {{Client function}} | ||
This function returns the number of rows in a | __NOTOC__ | ||
This function returns the number of rows in a grid list. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
int guiGridListGetRowCount ( element | int guiGridListGetRowCount ( element theList ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''theList:''' The grid list to get the number of rows from. | ||
===Returns=== | ===Returns=== | ||
Returns | Returns the number of rows if the function is successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example creates a gui grid list, fills it with | This example creates a gui grid list, fills it with the names of the connected players and prints the number of rows (players) in the chatbox. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function createPlayerList () | function createPlayerList () | ||
--Create the grid list element | -- Create the grid list element | ||
local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) | local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) | ||
--Create a players column in the list | -- Create a players column in the list | ||
local column = guiGridListAddColumn( playerList, "Player", 0.85 ) | local column = guiGridListAddColumn( playerList, "Player", 0.85 ) | ||
if ( column ) then --If the column has been created, fill it with players | if ( column ) then -- If the column has been created, fill it with players | ||
for id, | for id, playeritem in ipairs(getElementsByType("player")) do | ||
local row = guiGridListAddRow ( playerList ) | local row = guiGridListAddRow ( playerList ) | ||
guiGridListSetItemText ( playerList, row, column, getPlayerName ( | guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) | ||
end | end | ||
outputChatBox ( "Number of player list rows: "..guiGridListGetRowCount ( playerList ) ) | outputChatBox ( "Number of player list rows: " .. guiGridListGetRowCount ( playerList ) ) | ||
end | end | ||
end | end |
Revision as of 16:17, 18 August 2007
This function returns the number of rows in a grid list.
Syntax
int guiGridListGetRowCount ( element theList )
Required Arguments
- theList: The grid list to get the number of rows from.
Returns
Returns the number of rows if the function is successful, false otherwise.
Example
This example creates a gui grid list, fills it with the names of the connected players and prints the number of rows (players) in the chatbox.
function createPlayerList () -- Create the grid list element local playerList = guiCreateGridList ( 0.80, 0.10, 0.15, 0.60, true ) -- Create a players column in the list local column = guiGridListAddColumn( playerList, "Player", 0.85 ) if ( column ) then -- If the column has been created, fill it with players for id, playeritem in ipairs(getElementsByType("player")) do local row = guiGridListAddRow ( playerList ) guiGridListSetItemText ( playerList, row, column, getPlayerName ( playeritem ), false, false ) end outputChatBox ( "Number of player list rows: " .. guiGridListGetRowCount ( playerList ) ) end 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