GuiGridListGetSelectedCount: Difference between revisions
Jump to navigation
Jump to search
(New page: {{Client function}} __NOTOC__ This function returns the amount of options selected in the specified grid list. ==Syntax== <syntaxhighlight lang="lua"> int guiGridListGetSelecte...) |
(OOP syntax) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
int guiGridListGetSelectedCount ( element gridList ) | int guiGridListGetSelectedCount ( element gridList ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Element/GUI/Gridlist|GuiGridList]]:getSelectedCount|selectedCount}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 15: | Line 16: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | This example creates a gridlist filled with players names then check who has the letter "a" in their name, after it selects everyone who has the letter "a" then it outputs the selected rows. TESTED! | ||
<syntaxhighlight lang="lua"> 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 | |||
for b=0, guiGridListGetRowCount(gridlist)do | |||
if(string.find(guiGridListGetItemText(gridlist,b,1),"a",1,true))then | |||
guiGridListSetSelectedItem(gridlist,b,1) | |||
end | |||
end | |||
outputChatBox("The number of Players with 'a' in their name: "..guiGridListGetSelectedCount(gridlist)..".") | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{GUI functions}} | {{GUI functions}} | ||
{{GUI_events}} |
Latest revision as of 21:15, 7 November 2018
This function returns the amount of options selected in the specified grid list.
Syntax
int guiGridListGetSelectedCount ( element gridList )
OOP Syntax Help! I don't understand this!
- Method: GuiGridList:getSelectedCount(...)
- Variable: .selectedCount
Required Arguments
- gridList: The grid list which amount of selected items you want to retrieve.
Returns
Returns an integer representing the amount of selected options if everything was successful or false if invalid arguments were passed.
Example
This example creates a gridlist filled with players names then check who has the letter "a" in their name, after it selects everyone who has the letter "a" then it outputs the selected rows. TESTED!
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 for b=0, guiGridListGetRowCount(gridlist)do if(string.find(guiGridListGetItemText(gridlist,b,1),"a",1,true))then guiGridListSetSelectedItem(gridlist,b,1) end end outputChatBox("The number of Players with 'a' in their name: "..guiGridListGetSelectedCount(gridlist)..".")
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
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel