GuiEditIsReadOnly

From Multi Theft Auto: Wiki
Revision as of 20:57, 7 November 2018 by StrixG (talk | contribs) (OOP syntax)
Jump to navigation Jump to search

This function checks if an edit box is read-only.

Syntax

bool guiEditIsReadOnly ( gui-edit guiEdit )

OOP Syntax Help! I don't understand this!

Variable: .readOnly
Counterpart: guiEditIsReadOnly


Required Arguments

  • guiEdit: The edit box to check read-only status of.

Returns

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

Example

local myWebsite = "development.mtasa.com" -- define the text to be displayed in advert field
function createAdvert( )
    local advert = guiCreateEdit( 0.845, 0.94, 0.15, 0.05, myWebsite, true ) -- create edit box for the advert
    if advert then -- if it was successfully created
        guiEditSetReadOnly( advert, true ) -- make it read-only
    end
    addCommandHandler( "isReadOnly",
        function( )
            local readOnly = guiEditIsReadOnly( advert ) -- check edit box status
            outputChatBox( "Edit box is " .. ( readOnly and "read-only" or "not read-only" ) ) -- show info about edit box
        end
    )
end
addEventHandler( "onClientResourceStart", resourceRoot, createAdvert )

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