GuiEditIsReadOnly: Difference between revisions
Jump to navigation
Jump to search
(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...") |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Client function}} | {{Client function}} | ||
__NOTOC__ | __NOTOC__ | ||
{{New feature/item|3.0156|1.5.5|12419|This function | {{New feature/item|3.0156|1.5.5|12419|This function checks if an edit box is read-only.}} | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool guiEditIsReadOnly ( gui-edit | bool guiEditIsReadOnly ( gui-edit guiEdit ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP|||readOnly|guiEditSetReadOnly}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''guiEdit:''' The edit box to check read-only status of. | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if | Returns ''true'' if the edit box is read-only, ''false'' if not, ''nil'' if an invalid edit box was provided. | ||
==Example== | ==Example== | ||
{{Client function}} | {{Client function}} | ||
<syntaxhighlight lang="lua">myWebsite = "development.mtasa.com" -- define the text to be displayed in advert field | <syntaxhighlight lang="lua"> | ||
local myWebsite = "development.mtasa.com" -- define the text to be displayed in advert field | |||
function createAdvert( ) | function createAdvert( ) | ||
local advert = guiCreateEdit( 0.845, 0.94, 0.15, 0.05, myWebsite, true ) -- create edit | 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 | if advert then -- if it was successfully created | ||
guiEditSetReadOnly( advert, true ) -- make it read only | guiEditSetReadOnly( advert, true ) -- make it read-only | ||
end | end | ||
addCommandHandler("isReadOnly",function() | 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 | end | ||
addEventHandler ( "onClientResourceStart", | addEventHandler( "onClientResourceStart", resourceRoot, createAdvert )</syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
{{GUI_events}} | {{GUI_events}} |
Latest revision as of 20:57, 7 November 2018
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: guiEditSetReadOnly
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
- guiBringToFront
- getChatboxLayout
- getChatboxCharacterLimit
- guiCreateFont
- guiBlur
- guiFocus
- guiGetAlpha
- guiGetCursorType
- guiGetEnabled
- guiGetFont
- guiGetInputEnabled
- guiGetInputMode
- guiGetPosition
- guiGetProperties
- guiGetProperty
- guiGetScreenSize
- guiGetSize
- guiGetText
- guiGetVisible
- guiMoveToBack
- guiSetAlpha
- guiSetEnabled
- guiSetFont
- guiSetInputEnabled
- guiSetInputMode
- guiSetPosition
- guiSetProperty
- guiSetSize
- guiSetText
- guiSetVisible
- isChatBoxInputActive
- isConsoleActive
- isDebugViewActive
- isMainMenuActive
- isMTAWindowActive
- isTransferBoxActive
- setChatboxCharacterLimit
- setDebugViewActive
Browsers
Buttons
Checkboxes
Comboboxes
- guiCreateComboBox
- guiComboBoxAddItem
- guiComboBoxClear
- guiComboBoxGetItemCount
- guiComboBoxGetItemText
- guiComboBoxGetSelected
- guiComboBoxIsOpen
- guiComboBoxRemoveItem
- guiComboBoxSetItemText
- guiComboBoxSetOpen
- guiComboBoxSetSelected
Edit Boxes
- guiCreateEdit
- guiEditGetCaretIndex
- guiEditGetMaxLength
- guiEditIsMasked
- guiEditIsReadOnly
- guiEditSetCaretIndex
- guiEditSetMasked
- guiEditSetMaxLength
- guiEditSetReadOnly
Gridlists
- guiCreateGridList
- guiGridListAddColumn
- guiGridListAddRow
- guiGridListAutoSizeColumn
- guiGridListClear
- guiGridListGetColumnCount
- guiGridListGetColumnTitle
- guiGridListGetColumnWidth
- guiGridListGetHorizontalScrollPosition
- guiGridListGetItemColor
- guiGridListGetItemData
- guiGridListGetItemText
- guiGridListGetRowCount
- guiGridListGetSelectedCount
- guiGridListGetSelectedItem
- guiGridListGetSelectedItems
- guiGridListGetSelectionMode
- guiGridListIsSortingEnabled
- guiGridListGetVerticalScrollPosition
- guiGridListInsertRowAfter
- guiGridListRemoveColumn
- guiGridListRemoveRow
- guiGridListSetColumnTitle
- guiGridListSetColumnWidth
- guiGridListSetHorizontalScrollPosition
- guiGridListSetItemColor
- guiGridListSetItemData
- guiGridListSetItemText
- guiGridListSetScrollBars
- guiGridListSetSelectedItem
- guiGridListSetSelectionMode
- guiGridListSetSortingEnabled
- guiGridListSetVerticalScrollPosition
Memos
- guiCreateMemo
- guiMemoGetCaretIndex
- guiMemoGetVerticalScrollPosition
- guiMemoSetVerticalScrollPosition
- guiMemoIsReadOnly
- guiMemoSetCaretIndex
- guiMemoSetReadOnly
Progressbars
Radio Buttons
Scrollbars
Scrollpanes
- guiCreateScrollPane
- guiScrollPaneGetHorizontalScrollPosition
- guiScrollPaneGetVerticalScrollPosition
- guiScrollPaneSetHorizontalScrollPosition
- guiScrollPaneSetScrollBars
- guiScrollPaneSetVerticalScrollPosition
Static Images
Tab Panels
Tabs
Text Labels
- guiCreateLabel
- guiLabelGetColor
- guiLabelGetFontHeight
- guiLabelGetTextExtent
- guiLabelSetColor
- guiLabelSetHorizontalAlign
- guiLabelSetVerticalAlign
Windows
Input
GUI
- onClientGUIAccepted
- onClientGUIBlur
- onClientGUIChanged
- onClientGUIClick
- onClientGUIComboBoxAccepted
- onClientGUIDoubleClick
- onClientGUIFocus
- onClientGUIMouseDown
- onClientGUIMouseUp
- onClientGUIMove
- onClientGUIScroll
- onClientGUISize
- onClientGUITabSwitched
- onClientMouseEnter
- onClientMouseLeave
- onClientMouseMove
- onClientMouseWheel