GuiEditIsMasked: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
(Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0156|1.5.5||This function checks if an edit field is masked.}} ==Syntax== <syntaxhighlight lang="lua"> bool guiEditIsMaske...")
 
m (Undo revision 71069 by Toliak (talk). Due to https://github.com/multitheftauto/mtasa-blue/blob/c58c3678f263d810f61eb5aecba48e6c4b4dce0c/Client/mods/deathmatch/logic/luadefs/CLuaGUIDefs.cpp#L326 I cannot provide the method name, and therefore, the class name)
Tag: Undo
 
(5 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{Client function}}
{{Client function}}
__NOTOC__
__NOTOC__
{{New feature/item|3.0156|1.5.5||This function checks if an edit field is masked.}}
{{New feature/item|3.0156|1.5.5|13814|This function checks if an edit box is masked.}}


==Syntax==  
==Syntax==  
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
bool guiEditIsMasked ( gui-edit editField )
bool guiEditIsMasked ( gui-edit guiEdit )
</syntaxhighlight>  
</syntaxhighlight>
{{OOP|||masked|guiEditSetMasked}}


===Required Arguments===  
===Required Arguments===  
*'''editField:''' The gui-edit to check masked flag of.
*'''guiEdit:''' the edit box to check masked flag of.


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


==Example==  
==Example==  
Line 18: Line 19:
<syntaxhighlight lang="lua">
<syntaxhighlight lang="lua">
function createPasswordEdit( )
function createPasswordEdit( )
     local password = guiCreateEdit( 0.845, 0.94, 0.15, 0.05, "password", true ) -- create edit field for the advert
     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
     if password then -- if it was successfully created
         guiEditSetMasked( password, true ) -- make it masked
         guiEditSetMasked( password, true ) -- make it masked
Line 24: Line 25:
     addCommandHandler( "isMasked",
     addCommandHandler( "isMasked",
         function( )
         function( )
             local masked = guiEditIsMasked( advert ) -- check edit field masked flag
             local masked = guiEditIsMasked( password ) -- check the edit box masked flag
             outputChatBox( "Edit field is " .. ( masked and "masked" or "not masked" ) ) -- show info about edit field
             outputChatBox( "Edit field is " .. ( masked and "masked" or "not masked" ) ) -- show info about edit box
         end
         end
     )
     )

Latest revision as of 16:44, 14 May 2021

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