GuiEditIsMasked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(OOP syntax)
Line 6: Line 6:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool guiEditIsMasked ( gui-edit guiEdit )
bool guiEditIsMasked ( gui-edit guiEdit )
</syntaxhighlight>  
</syntaxhighlight>
{{OOP|||masked|guiEditSetMasked}}


===Required Arguments===  
===Required Arguments===  

Revision as of 20:55, 7 November 2018

This function checks if an edit box is masked.

Syntax

bool guiEditIsMasked ( gui-edit guiEdit )

OOP Syntax Help! I don't understand this!

Variable: .masked
Counterpart: guiEditSetMasked


Required Arguments

  • guiEdit: the edit box to check masked flag of.

Returns

Returns true if the edit box is masked, false if not, nil if an invalid edit box was provided.

Example

function createPasswordEdit( )
    local password = guiCreateEdit( 0.845, 0.94, 0.15, 0.05, "password", true ) -- create edit box for a password
    if password then -- if it was successfully created
        guiEditSetMasked( password, true ) -- make it masked
    end
    addCommandHandler( "isMasked",
        function( )
            local masked = guiEditIsMasked( password ) -- check the edit box masked flag
            outputChatBox( "Edit field is " .. ( masked and "masked" or "not masked" ) ) -- show info about edit box
        end
    )
end
addEventHandler( "onClientResourceStart", resourceRoot, createPasswordEdit )

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

Input

GUI