GuiEditIsReadOnly

From Multi Theft Auto: Wiki
Revision as of 12:11, 13 July 2018 by FileEX (talk | contribs) (Created page with "{{Client function}} __NOTOC__ {{New feature/item|3.0156|1.5.5|12419|This function checking if edit field is read only or no.}} ==Syntax== <syntaxhighlight lang="lua"> bool...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This function checking if edit field is read only or no.

Syntax

bool guiEditIsReadOnly ( gui-edit editField )

Required Arguments

  • editField: The gui-edit to check read-only status of.

Returns

Returns true if editField is read only, false if editField isn't read only, nil otherwise.

Example

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 field 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 editField status
        outputChatBox("Edit readOnly: "..readOnly) -- show info about editField
    end)
end
addEventHandler ( "onClientResourceStart", getResourceRootElement( getThisResource() ), 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