GuiGridListSetSelectedItem: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP syntax)
 
(3 intermediate revisions by 3 users not shown)
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool guiGridListSetSelectedItem ( element gridList, int rowIndex, int columnIndex )
bool guiGridListSetSelectedItem ( element gridList, int rowIndex, int columnIndex [, bool bReset = true ] )
</syntaxhighlight>  
</syntaxhighlight>
{{OOP||[[Element/GUI/Gridlist|GuiGridList]]:setSelectedItem}}


===Required Arguments===  
===Required Arguments===  
Line 12: Line 13:
*'''rowIndex:''' the row you want to select (index 0 is the first row)
*'''rowIndex:''' the row you want to select (index 0 is the first row)
*'''columnIndex:''' the column you want to select (index 1 is the first column)
*'''columnIndex:''' the column you want to select (index 1 is the first column)
{{New feature|3.0111|1.1.1|
==Optional Arguments==
{{OptionalArg}}
*'''bReset:''' set to false for multiple selections
}}


===Returns===
===Returns===
Line 23: Line 29:
==See Also==
==See Also==
{{GUI functions}}
{{GUI functions}}
{{GUI_events}}

Latest revision as of 21:20, 7 November 2018

This function selects an item from a gridlist. If you wish to deselect whatever item is selected, pass 0 as both the rowIndex and columnIndex arguments.

Syntax

bool guiGridListSetSelectedItem ( element gridList, int rowIndex, int columnIndex [, bool bReset = true ] )

OOP Syntax Help! I don't understand this!

Method: GuiGridList:setSelectedItem(...)


Required Arguments

  • gridList: the grid list you want to select an item from
  • rowIndex: the row you want to select (index 0 is the first row)
  • columnIndex: the column you want to select (index 1 is the first column)

Optional Arguments

NOTE: When using optional arguments, you might need to supply all arguments before the one you wish to use. For more information on optional arguments, see optional arguments.

  • bReset: set to false for multiple selections

Returns

Returns true if the passed arguments are correct and the item has been selected, false otherwise.

Example

guiGridListSetSelectedItem ( spawnScreenGridList, 0, 0) -- resets selection to zero

See Also

General functions

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows

Input

GUI