GuiGetProperty: Difference between revisions
Jump to navigation
Jump to search
(New page: {{Client function}} __NOTOC__ This function gets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the [http://www.cegui.org.uk/wiki...) |
m (→See Also) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function gets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the [http://static.cegui.org.uk/static/WindowsLookProperties.html CEGUI properties page]. | |||
This function gets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the [http:// | |||
==Syntax== | ==Syntax== | ||
Line 8: | Line 7: | ||
string guiGetProperty ( element guiElement, string property ) | string guiGetProperty ( element guiElement, string property ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[GUI widgets|GuiElement]]:getProperty||guiSetProperty}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 19: | Line 19: | ||
This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable). | This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable). | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
addEventHandler("onClientResourceStart", | addEventHandler("onClientResourceStart", getResourceRootElement(), | ||
function() | function() | ||
button = guiCreateButton(20, 200, 150, 30, "Test", false) | button = guiCreateButton(20, 200, 150, 30, "Test", false) | ||
Line 36: | Line 36: | ||
) | ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | |||
{{GUI functions}} | |||
{{GUI_events}} |
Latest revision as of 17:17, 21 November 2018
This function gets the value of a specific CEGUI property of a GUI element. For a list of properties and their meaning, see the CEGUI properties page.
Syntax
string guiGetProperty ( element guiElement, string property )
OOP Syntax Help! I don't understand this!
- Method: GuiElement:getProperty(...)
- Counterpart: guiSetProperty
Required Arguments
- guiElement: the GUI element you wish to get a property of.
- property: the name of of property you want the value of.
Returns
If the function succeeds, it returns a string with the value of the property. If it fails, it returns false.
Example
This example creates a button when the resource starts and defines a console command that toggles it between enabled (clickable) and disabled (not clickable).
addEventHandler("onClientResourceStart", getResourceRootElement(), function() button = guiCreateButton(20, 200, 150, 30, "Test", false) end ) addCommandHandler("togglebtn", function() local currentState = guiGetProperty(button, "Disabled") if currentState == "False" then guiSetProperty(button, "Disabled", "True") else guiSetProperty(button, "Disabled", "False") 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
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel