GuiMemoSetCaretIndex: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} This function sets the current position of the caret (the text cursor) within the memo. ==Syntax== <syntaxhighlight lang="lua"> bool guiMemoSetCaretIndex ( gui-memo theMe...) |
(Add missing OOP info) |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 7: | Line 7: | ||
bool guiMemoSetCaretIndex ( gui-memo theMemo, int index ) | bool guiMemoSetCaretIndex ( gui-memo theMemo, int index ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
{{OOP||[[GuiMemo]]:setCaretIndex|caretIndex|guiMemoGetCaretIndex}} | |||
===Required Arguments=== | ===Required Arguments=== | ||
*'''theMemo:''' The memo edit box where the caret position is to be changed. | *'''theMemo:''' The memo edit box where the caret position is to be changed. | ||
*'''index:''' An integer referring to the desired position within the box. | *'''index:''' An integer referring to the desired character position within the box. 0 would be before the first character in the box, 1 before the second, etc. | ||
===Returns=== | ===Returns=== | ||
Line 16: | Line 17: | ||
==Example== | ==Example== | ||
This example would create a memo and set the caret before the "H" in "Hi". | |||
<syntaxhighlight lang="lua">local memo = guiCreateMemo(100,100,200,100,"Hi",false) | |||
guiMemoSetCaretIndex(memo,0)--sets the caret before H | |||
</syntaxhighlight> | |||
==See Also== | ==See Also== | ||
{{GUI_functions}} | {{GUI_functions}} | ||
{{GUI_events}} |
Latest revision as of 13:54, 10 August 2021
This function sets the current position of the caret (the text cursor) within the memo.
Syntax
bool guiMemoSetCaretIndex ( gui-memo theMemo, int index )
OOP Syntax Help! I don't understand this!
- Method: GuiMemo:setCaretIndex(...)
- Variable: .caretIndex
- Counterpart: guiMemoGetCaretIndex
Required Arguments
- theMemo: The memo edit box where the caret position is to be changed.
- index: An integer referring to the desired character position within the box. 0 would be before the first character in the box, 1 before the second, etc.
Returns
Returns true if the caret was successfully moved, false otherwise.
Example
This example would create a memo and set the caret before the "H" in "Hi".
local memo = guiCreateMemo(100,100,200,100,"Hi",false) guiMemoSetCaretIndex(memo,0)--sets the caret before H
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