GuiEditSetMasked: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{Client_function}} | {{Client_function}} | ||
__NOTOC__ | __NOTOC__ | ||
This function sets or removes masking (covering up the text being typed) for password text fields. | This function sets or removes masking (covering up the text being typed) for password text fields. | ||
Line 16: | Line 15: | ||
===Returns=== | ===Returns=== | ||
Returns ''true'' if the function is successful, ''false'' otherwise. | Returns ''true'' if the function is successful, ''false'' otherwise. | ||
==Example== | ==Example== | ||
This example creates an edit box and an OK button. The user types in his password, and it checks if the password was correct | |||
This example | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
-- | password = "cheeseman" --set our password | ||
-- | --create our button | ||
button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "OK", true ) | |||
--Create an edit box and define it as "editBox". | |||
editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true ) | |||
-- and attach our button to the outputEditBox function | |||
guiEditSetMasked ( editBox, true ) --ensure that it is masked. | |||
--setup our function to output the message to the chatbox | |||
function checkPassword () | |||
local text = guiGetText ( editBox )--get the text from the edit box | |||
if text == password then --if the text matches the password | |||
outputChatBox ( "Password Correct!" ) | |||
else | |||
outputChatBox ( "Password Incorrect!" ) | |||
end | |||
end | |||
addEventHandler ( "onClientClick", button, checkPassword ) | |||
</syntaxhighlight> | </syntaxhighlight> | ||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
Revision as of 14:59, 11 August 2007
This function sets or removes masking (covering up the text being typed) for password text fields.
Syntax
bool guiEditSetMasked ( element theElement, bool status )
Required Arguments
- theElement: The edit box to be changed.
- status: A boolean value indicating whether masking is to be enabled or disabled.
Returns
Returns true if the function is successful, false otherwise.
Example
This example creates an edit box and an OK button. The user types in his password, and it checks if the password was correct
password = "cheeseman" --set our password --create our button button = guiCreateButton( 0.7, 0.1, 0.2, 0.1, "OK", true ) --Create an edit box and define it as "editBox". editBox = guiCreateEdit( 0.3, 0.1, 0.4, 0.1, "", true ) -- and attach our button to the outputEditBox function guiEditSetMasked ( editBox, true ) --ensure that it is masked. --setup our function to output the message to the chatbox function checkPassword () local text = guiGetText ( editBox )--get the text from the edit box if text == password then --if the text matches the password outputChatBox ( "Password Correct!" ) else outputChatBox ( "Password Incorrect!" ) end end addEventHandler ( "onClientClick", button, checkPassword )
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