DgsGetEnabled: Difference between revisions
Jump to navigation
Jump to search
(Created page with "{{Client function}} __NOTOC__ This function determines if a DGS element is enabled. ==Syntax== <syntaxhighlight lang="lua"> bool dgsDxGUIGetEnabled ( element guiElement ) </...") |
m (DGS OOP Syntax changing) |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool | bool dgsGetEnabled ( element guiElement ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{DGS/OOP| | |||
Method = DGSElement:getEnabled| | |||
Variable = enabled| | |||
Counterpart = dgsSetEnabled | |||
}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
Line 19: | Line 24: | ||
DGS = exports.dgs | DGS = exports.dgs | ||
function ChangeMyButtonEnabled ( ) | function ChangeMyButtonEnabled ( ) | ||
if ( DGS: | if ( DGS:dgsGetEnabled ( MyButton ) == true ) then -- check if the element is enabled | ||
DGS: | DGS:dgsSetEnabled ( MyButton, false ) -- if it is, we disable it | ||
else | else | ||
DGS: | DGS:dgsSetEnabled ( MyButton, true ) -- if not, we make it enabled | ||
end | end | ||
end | end | ||
MyGuiWindow = DGS: | MyGuiWindow = DGS:dgsCreateWindow(254,206,478,306,"Awesome dgs Window",false) -- Your dgs window | ||
MyButton = DGS: | MyButton = DGS:dgsCreateButton(0.477,0.8268,0.1946,0.0784,"Hello World!",true,MyGuiWindow) -- Creates a button in your dgs window</syntaxhighlight></section> | ||
=See Also= | |||
{{ | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Functions</span>== | |||
{{DGS General Functions}} | |||
==<span style="color:#eb3f00;text-shadow:0.05em 0.05em 0.2em #00000099;">General Events</span>== | |||
{{DGS Events/General}} |
Latest revision as of 21:11, 3 May 2021
This function determines if a DGS element is enabled.
Syntax
bool dgsGetEnabled ( element guiElement )
DGS OOP Syntax Help! I don't understand this!
- Method: DGSElement:getEnabled(...)
- Variable: .enabled
- Counterpart: dgsSetEnabled
Required Arguments
- guiElement: the DGS element to be checked.
Returns
Returns true if the element is enabled, false otherwise.
Example
Click to collapse [-]
ClientDGS = exports.dgs function ChangeMyButtonEnabled ( ) if ( DGS:dgsGetEnabled ( MyButton ) == true ) then -- check if the element is enabled DGS:dgsSetEnabled ( MyButton, false ) -- if it is, we disable it else DGS:dgsSetEnabled ( MyButton, true ) -- if not, we make it enabled end end MyGuiWindow = DGS:dgsCreateWindow(254,206,478,306,"Awesome dgs Window",false) -- Your dgs window MyButton = DGS:dgsCreateButton(0.477,0.8268,0.1946,0.0784,"Hello World!",true,MyGuiWindow) -- Creates a button in your dgs window
See Also
General Functions
- dgsGetPosition
- dgsSetPosition
- dgsSetParent
- dgsGetParent
- dgsGetChild
- dgsGetChildren
- dgsGetSize
- dgsSetSize
- dgsGetType
- dgsSetLayer
- dgsGetLayer
- dgsSetCurrentLayerIndex
- dgsGetCurrentLayerIndex
- dgsGetLayerElements
- dgsGetProperty
- dgsSetProperty
- dgsSetPropertyInherit
- dgsGetProperties
- dgsSetProperties
- dgsGetVisible
- dgsSetVisible
- dgsGetEnabled
- dgsSetEnabled
- dgsGetPositionAlignment
- dgsSetPositionAlignment
- dgsGetAlpha
- dgsSetAlpha
- dgsGetFont
- dgsSetFont
- dgsGetText
- dgsSetText
- dgsGetPostGUI
- dgsSetPostGUI
- dgsGetInputEnabled
- dgsSetInputEnabled
- dgsGetInputMode
- dgsSetInputMode
- dgsAttachToAutoDestroy
- dgsDetachFromAutoDestroy
- dgsFocus
- dgsBlur
- dgsCreateFont
- dgsBringToFront
- dgsMoveToBack
- dgsGetScreenSize
- dgsGetCursorPosition
- dgsGetMouseEnterGUI
- dgsGetMouseLeaveGUI
- dgsIsMouseWithinGUI
- dgsSetSystemFont
- dgsGetSystemFont
- dgsGetElementsInLayer
- dgsGetElementsFromResource
- dgsGetFocusedGUI
- dgsImportFunction
- dgsImportOOPClass
- dgsG2DLoadHooker
- dgsSetRenderSetting
- dgsGetRenderSetting
- dgsSimulateClick
- dgsGetRootElement
- dgsAddMoveHandler
- dgsRemoveMoveHandler
- dgsIsMoveHandled
- dgsAddSizeHandler
- dgsRemoveSizeHandler
- dgsIsSizeHandled
- dgsAttachElements
- dgsDetachElements
- dgsElementIsAttached
- dgsAddPropertyListener
- dgsRemovePropertyListener
- dgsGetListenedProperties
- dgsSetMultiClickInterval
- dgsGetMultiClickInterval
- dgsSetMouseStayDelay
- dgsGetMouseStayDelay
- dgsCenterElement
- dgsSetElementKeeperEnabled
- dgsGetElementKeeperEnabled
- dgsSetClickingSound
- dgsGetClickingSound
- dgsSetClickingSoundVolume
- dgsGetClickingSoundVolume
General Events
- onDgsBlur
- onDgsCreate
- onDgsCursorTypeChange
- onDgsCursorStateChange
- onDgsDestroy
- onDgsElementRender
- onDgsElementMove
- onDgsElementSize
- onDgsElementEnter
- onDgsElementLeave
- onDgsFocus
- onDgsKey
- onDgsPositionChange
- onDgsPreRender
- onDgsRender
- onDgsElementScroll
- onDgsSizeChange
- onDgsTextChange
- onDgsWindowClose
- onDgsPropertyChange