DgsGetEnabled

From Multi Theft Auto: Wiki

This function determines if a DGS element is enabled.

Syntax

bool dgsGetEnabled ( element guiElement )

Required Arguments

  • guiElement: the DGS element to be checked.

Returns

Returns true if the element is enabled, false otherwise.

Example

Click to collapse [-]
Client
DGS = 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

Multi Language Supports

Animation

3D Interface

3D Text

Arrow List

Browser

Button

Check Box

Combo Box

Edit

Ellipse Detect Area

Detect Area

Grid List

Image

Memo

Label

Progress Bar

Radio Button

Scroll Bar

Scroll Pane

Switch Button

Tab Panel

Window

Plugin

Media Browser

Rounded Rectangle

Color Picker

Blur Box

Effect 3D