DgsGetEnabled: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
m (Thisdp moved page DgsDxGUIGetEnabled to DgsGetEnabled)
No edit summary
Line 5: Line 5:
==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool dgsDxGUIGetEnabled ( element guiElement )
bool dgsGetEnabled ( element guiElement )
</syntaxhighlight>  
</syntaxhighlight>  


Line 19: Line 19:
DGS = exports.dgs
DGS = exports.dgs
function ChangeMyButtonEnabled ( )         
function ChangeMyButtonEnabled ( )         
         if ( DGS:dgsDxGUIGetEnabled ( MyButton ) == true ) then -- check if the element is enabled           
         if ( DGS:dgsGetEnabled ( MyButton ) == true ) then -- check if the element is enabled           
                 DGS:dgsDxGUISetEnabled ( MyButton, false ) -- if it is, we disable it
                 DGS:dgsSetEnabled ( MyButton, false ) -- if it is, we disable it
         else               
         else               
                 DGS:dgsDxGUISetEnabled ( MyButton, true ) -- if not, we make it enabled
                 DGS:dgsSetEnabled ( MyButton, true ) -- if not, we make it enabled
         end
         end
end
end


MyGuiWindow = DGS:dgsDxCreateWindow(254,206,478,306,"Awesome dgs Window",false) -- Your dgs window
MyGuiWindow = DGS:dgsCreateWindow(254,206,478,306,"Awesome dgs Window",false) -- Your dgs window
MyButton = DGS:dgsDxCreateButton(0.477,0.8268,0.1946,0.0784,"Hello World!",true,MyGuiWindow) -- Creates a button in your dgs window</syntaxhighlight></section>
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==
==See Also==
{{DGSFUNCTIONS}}
{{DGSFUNCTIONS}}

Revision as of 15:36, 16 January 2018

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

Custom Cursor Functions

Multi Language Supports

Animation

3D Element

3D Interface

3D Line

3D Image

3D Text

Browser

Button

Check Box

Combo Box

Custom Renderer

Edit

Detect Area

Drag'N Drop

Grid List

Image

Memo

Menu

Label

Layout

Line

Progress Bar

Radio Button

Scale Pane

Scroll Bar

Scroll Pane

Selector

Style

Switch Button

Tab Panel

Window

Basic Shape Plugins

Circle

Quadrilateral

Rounded Rectangle

Other Plugins

Blur Box

Canvas

Chart

Color Picker

Effect 3D

Gradient

Mask

Media Browser

Nine Slice

Object Preview Supports

Paste Handler

QRCode

Remote Image

Screen Source

SVG

Tooltips