GuiRadioButtonSetSelected: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ This function selects or unselects a radio buttom. ==Syntax== <syntaxhighlight lang="lua"> bool guiCheckBoxSetSelected ( element guiRadioButton, bool state ) </syntaxhighlight> ===Required Arguments=...) |
m (typo) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | {{Client function}} | ||
This function selects or unselects a radio | __NOTOC__ | ||
This function selects or unselects a radio button. | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool guiRadioButtonSetSelected ( element guiRadioButton, bool state ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[Element/GUI/Radio button|GuiRadioButton]]:setSelected|selected|guiRadioButtonGetSelected}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 15: | Line 17: | ||
==Example== | ==Example== | ||
This | This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!) | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua">hi = guiCreateRadioButton(243,204,36,16,"Hi",false) | ||
guiRadioButtonSetSelected(hi,true) | |||
bye = guiCreateRadioButton(243,224,41,16,"Bye",false) | |||
if(guiRadioButtonGetSelected(hi))then | |||
outputChatBox("Hi "..getPlayerName(localPlayer)) | |||
guiRadioButtonSetSelected(bye,true) | |||
else | |||
outputChatBox("Bye "..getPlayerName(localPlayer)) | |||
guiRadioButtonSetSelected(hi,true) | |||
end | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
{{GUI_events}} |
Latest revision as of 19:31, 6 September 2021
This function selects or unselects a radio button.
Syntax
bool guiRadioButtonSetSelected ( element guiRadioButton, bool state )
OOP Syntax Help! I don't understand this!
- Method: GuiRadioButton:setSelected(...)
- Variable: .selected
- Counterpart: guiRadioButtonGetSelected
Required Arguments
- guiRadioButton: The GUI radio button in which you wish to change the selection state of
- state: The state of the radio button, where true indicates selected, and false indicates unselected.
Returns
Returns true if the radio button's selection state was successfully set, false otherwise.
Example
This example creates a radio button then checks if one is selected and if it is, then it's output the title and sets the next radio button selected. (TESTED!)
hi = guiCreateRadioButton(243,204,36,16,"Hi",false) guiRadioButtonSetSelected(hi,true) bye = guiCreateRadioButton(243,224,41,16,"Bye",false) if(guiRadioButtonGetSelected(hi))then outputChatBox("Hi "..getPlayerName(localPlayer)) guiRadioButtonSetSelected(bye,true) else outputChatBox("Bye "..getPlayerName(localPlayer)) guiRadioButtonSetSelected(hi,true) 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
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel