GuiGetEnabled: Difference between revisions

From Multi Theft Auto: Wiki
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=== ...)
 
Line 15: Line 15:


==Example==
==Example==
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">function ChangeMyButtonEnabled ( )       
--Needs an example
        if ( guiGetEnabled ( MyButton ) == true ) then -- check if the element is enabled         
</syntaxhighlight>
                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>


==See Also==
==See Also==
{{GUI_functions}}
{{GUI_functions}}

Revision as of 04:59, 19 July 2009

This function determines if a GUI element is enabled.

Syntax

bool guiGetEnabled ( element guiElement )

Required Arguments

  • guiElement: the GUI element to be checked.

Returns

Returns true if the element is enabled, false otherwise.

Example

function 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

Browsers

Buttons

Checkboxes

Comboboxes

Edit Boxes

Gridlists

Memos

Progressbars

Radio Buttons

Scrollbars

Scrollpanes

Static Images

Tab Panels

Tabs

Text Labels

Windows