GuiGetEnabled: Difference between revisions
Jump to navigation
Jump to search
(New page: {{Client function}} __NOTOC__ This function determines if a GUI element is enabled. ==Syntax== <syntaxhighlight lang="lua"> bool guiGetEnabled ( element guiElement ) </syntaxhighlight> ===Required Arguments=== ...) |
m (→See Also) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 6: | Line 6: | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool guiGetEnabled ( element guiElement ) | bool guiGetEnabled ( element guiElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[GUI widgets|GuiElement]]:getEnabled|enabled|guiSetEnabled}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 15: | Line 16: | ||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <section name="Client" class="client" show="true"> | ||
-- | <syntaxhighlight lang="lua">function ChangeMyButtonEnabled ( ) | ||
</syntaxhighlight> | if ( guiGetEnabled ( MyButton ) == true ) then -- check if the element is enabled | ||
guiSetEnabled ( MyButton, false ) -- if it is, we disable it | |||
else | |||
guiSetEnabled ( MyButton, true ) -- if not, we make it enabled | |||
end | |||
end | |||
MyGuiWindow = guiCreateWindow(254,206,478,306,"Awesome Gui Window",false) -- Your gui window | |||
MyButton = guiCreateButton(0.477,0.8268,0.1946,0.0784,"Hello World!",true,MyGuiWindow) -- Creates a button in your gui window</syntaxhighlight></section> | |||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
{{GUI_events}} |
Latest revision as of 17:16, 21 November 2018
This function determines if a GUI element is enabled.
Syntax
bool guiGetEnabled ( element guiElement )
OOP Syntax Help! I don't understand this!
- Method: GuiElement:getEnabled(...)
- Variable: .enabled
- Counterpart: guiSetEnabled
Required Arguments
- guiElement: the GUI element to be checked.
Returns
Returns true if the element is enabled, false otherwise.
Example
Click to collapse [-]
Clientfunction ChangeMyButtonEnabled ( ) if ( guiGetEnabled ( MyButton ) == true ) then -- check if the element is enabled guiSetEnabled ( MyButton, false ) -- if it is, we disable it else guiSetEnabled ( MyButton, true ) -- if not, we make it enabled end end MyGuiWindow = guiCreateWindow(254,206,478,306,"Awesome Gui Window",false) -- Your gui window MyButton = guiCreateButton(0.477,0.8268,0.1946,0.0784,"Hello World!",true,MyGuiWindow) -- Creates a button in your gui window
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