Update
This commit is contained in:
223
ui/EditBox.lua
223
ui/EditBox.lua
@@ -2,210 +2,177 @@
|
||||
|
||||
---@class EditBox : Frame, FontInstance
|
||||
EditBox = {
|
||||
--- Adds text to the edit history.
|
||||
--- @param text string The text to add to the history.
|
||||
--- Adds a history line to the edit box.
|
||||
--- @param text string The text to add to history.
|
||||
--- @example
|
||||
--- myEditBox:AddHistoryLine("Previous input")
|
||||
--- myEditBox:AddHistoryLine("Previous entry")
|
||||
AddHistoryLine = function(self, text) end,
|
||||
|
||||
--- Removes text input focus from this edit box.
|
||||
--- Clears the focus from the edit box.
|
||||
--- @example
|
||||
--- myEditBox:ClearFocus()
|
||||
ClearFocus = function(self) end,
|
||||
|
||||
--- Returns the value of the ignoreArrows attribute.
|
||||
--- @return boolean ignoreArrows True if arrow keys are ignored.
|
||||
--- Clears the history of the edit box.
|
||||
--- @example
|
||||
--- local ignoreArrows = myEditBox:GetAltArrowKeyMode()
|
||||
GetAltArrowKeyMode = function(self) end,
|
||||
--- myEditBox:ClearHistory()
|
||||
ClearHistory = function(self) end,
|
||||
|
||||
--- Returns the blink speed of the cursor.
|
||||
--- @return number blinkSpeed The blink speed of the cursor.
|
||||
--- Gets the cursor position.
|
||||
--- @return number position The cursor position.
|
||||
--- @example
|
||||
--- local blinkSpeed = myEditBox:GetBlinkSpeed()
|
||||
GetBlinkSpeed = function(self) end,
|
||||
--- local position = myEditBox:GetCursorPosition()
|
||||
GetCursorPosition = function(self) end,
|
||||
|
||||
--- Gets the number of history lines for this edit box.
|
||||
--- @return number historyLines The number of history lines.
|
||||
--- @example
|
||||
--- local historyLines = myEditBox:GetHistoryLines()
|
||||
GetHistoryLines = function(self) end,
|
||||
|
||||
--- Gets the input language (locale based, not in-game).
|
||||
--- @return string inputLanguage The current input language.
|
||||
--- @example
|
||||
--- local inputLanguage = myEditBox:GetInputLanguage()
|
||||
GetInputLanguage = function(self) end,
|
||||
|
||||
--- Returns the maximum byte size for entered text.
|
||||
--- @return number maxBytes The maximum byte size.
|
||||
--- Gets the maximum number of bytes allowed.
|
||||
--- @return number maxBytes The maximum number of bytes.
|
||||
--- @example
|
||||
--- local maxBytes = myEditBox:GetMaxBytes()
|
||||
GetMaxBytes = function(self) end,
|
||||
|
||||
--- Returns the maximum number of letters for entered text.
|
||||
--- @return number maxLetters The maximum number of letters.
|
||||
--- Gets the maximum number of characters allowed.
|
||||
--- @return number maxLetters The maximum number of characters.
|
||||
--- @example
|
||||
--- local maxLetters = myEditBox:GetMaxLetters()
|
||||
GetMaxLetters = function(self) end,
|
||||
|
||||
--- Gets the number of letters in the box.
|
||||
--- @return number numLetters The number of letters.
|
||||
--- Gets the maximum number of history lines.
|
||||
--- @return number maxLines The maximum number of history lines.
|
||||
--- @example
|
||||
--- local numLetters = myEditBox:GetNumLetters()
|
||||
GetNumLetters = function(self) end,
|
||||
--- local maxLines = myEditBox:GetMaxLines()
|
||||
GetMaxLines = function(self) end,
|
||||
|
||||
--- Returns the number entered in the edit box, or 0 if the text is not a number.
|
||||
--- @return number number The number entered.
|
||||
--- Gets the number of history lines.
|
||||
--- @return number numLines The number of history lines.
|
||||
--- @example
|
||||
--- local numLines = myEditBox:GetNumHistory()
|
||||
GetNumHistory = function(self) end,
|
||||
|
||||
--- Gets the numeric value of the edit box text.
|
||||
--- @return number number The numeric value.
|
||||
--- @example
|
||||
--- local number = myEditBox:GetNumber()
|
||||
GetNumber = function(self) end,
|
||||
|
||||
--- Gets the current text contained in the edit box.
|
||||
--- @return string text The current text.
|
||||
--- Gets the text displayed in the edit box.
|
||||
--- @return string text The edit box text.
|
||||
--- @example
|
||||
--- local text = myEditBox:GetText()
|
||||
GetText = function(self) end,
|
||||
|
||||
--- Returns the text insets for the edit box.
|
||||
--- @return number left The left inset.
|
||||
--- @return number right The right inset.
|
||||
--- @return number top The top inset.
|
||||
--- @return number bottom The bottom inset.
|
||||
--- Gets the text insets.
|
||||
--- @return number left, number right, number top, number bottom The inset values.
|
||||
--- @example
|
||||
--- local left, right, top, bottom = myEditBox:GetTextInsets()
|
||||
GetTextInsets = function(self) end,
|
||||
|
||||
--- Returns true if the edit box has focus.
|
||||
--- Highlights the text in the edit box.
|
||||
--- @param start number The starting position.
|
||||
--- @param end_ number The ending position.
|
||||
--- @example
|
||||
--- myEditBox:HighlightText(0, 5)
|
||||
HighlightText = function(self, start, end_) end,
|
||||
|
||||
--- Inserts text at the cursor position.
|
||||
--- @param text string The text to insert.
|
||||
--- @example
|
||||
--- myEditBox:Insert("New text")
|
||||
Insert = function(self, text) end,
|
||||
|
||||
--- Returns whether the edit box has focus.
|
||||
--- @return boolean hasFocus True if the edit box has focus.
|
||||
--- @example
|
||||
--- local hasFocus = myEditBox:HasFocus()
|
||||
HasFocus = function(self) end,
|
||||
|
||||
--- Sets the highlight to all or some of the edit box text.
|
||||
--- @param startPos number? Optional. The start position of the highlight.
|
||||
--- @param endPos number? Optional. The end position of the highlight.
|
||||
--- Returns whether the text is highlighted.
|
||||
--- @return boolean isHighlighted True if text is highlighted.
|
||||
--- @example
|
||||
--- myEditBox:HighlightText(1, 5) -- Highlight first 5 characters
|
||||
HighlightText = function(self, startPos, endPos) end,
|
||||
--- local isHighlighted = myEditBox:IsHighlighted()
|
||||
IsHighlighted = function(self) end,
|
||||
|
||||
--- Inserts text into the edit box.
|
||||
--- @param text string The text to insert.
|
||||
--- Returns whether the edit box is in numeric mode.
|
||||
--- @return boolean isNumeric True if in numeric mode.
|
||||
--- @example
|
||||
--- myEditBox:Insert("Hello")
|
||||
Insert = function(self, text) end,
|
||||
|
||||
--- Returns true if the edit box is set to auto focus.
|
||||
--- @return boolean autoFocus True if auto focus is enabled.
|
||||
--- @example
|
||||
--- local autoFocus = myEditBox:IsAutoFocus()
|
||||
IsAutoFocus = function(self) end,
|
||||
|
||||
--- Returns true if the edit box is multi-line.
|
||||
--- @return boolean multiLine True if multi-line is enabled.
|
||||
--- @example
|
||||
--- local multiLine = myEditBox:IsMultiLine()
|
||||
IsMultiLine = function(self) end,
|
||||
|
||||
--- Returns true if the edit box is numeric.
|
||||
--- @return boolean numeric True if numeric input is enabled.
|
||||
--- @example
|
||||
--- local numeric = myEditBox:IsNumeric()
|
||||
--- local isNumeric = myEditBox:IsNumeric()
|
||||
IsNumeric = function(self) end,
|
||||
|
||||
--- Returns true if the edit box is a password field.
|
||||
--- @return boolean password True if password input is enabled.
|
||||
--- Returns whether the edit box is password input.
|
||||
--- @return boolean isPassword True if password input.
|
||||
--- @example
|
||||
--- local password = myEditBox:IsPassword()
|
||||
--- local isPassword = myEditBox:IsPassword()
|
||||
IsPassword = function(self) end,
|
||||
|
||||
--- Sets the mode for the Alt arrow key.
|
||||
--- @param ignoreArrows boolean True to ignore arrow keys.
|
||||
--- Sets the cursor position.
|
||||
--- @param position number The cursor position.
|
||||
--- @example
|
||||
--- myEditBox:SetAltArrowKeyMode(true)
|
||||
SetAltArrowKeyMode = function(self, ignoreArrows) end,
|
||||
--- myEditBox:SetCursorPosition(5)
|
||||
SetCursorPosition = function(self, position) end,
|
||||
|
||||
--- Sets the auto focus mode for the edit box.
|
||||
--- @param autoFocus boolean True to enable auto focus.
|
||||
--- Sets whether the edit box has focus.
|
||||
--- @param focus boolean True to set focus.
|
||||
--- @example
|
||||
--- myEditBox:SetAutoFocus(true)
|
||||
SetAutoFocus = function(self, autoFocus) end,
|
||||
--- myEditBox:SetFocus(true)
|
||||
SetFocus = function(self, focus) end,
|
||||
|
||||
--- Sets the blink speed of the cursor.
|
||||
--- @param blinkSpeed number The blink speed to set.
|
||||
--- Sets the history lines.
|
||||
--- @param ... string The history lines.
|
||||
--- @example
|
||||
--- myEditBox:SetBlinkSpeed(0.5)
|
||||
SetBlinkSpeed = function(self, blinkSpeed) end,
|
||||
--- myEditBox:SetHistoryLines("Line 1", "Line 2")
|
||||
SetHistoryLines = function(self, ...) end,
|
||||
|
||||
--- Sets focus to the edit box.
|
||||
--- Sets the maximum number of bytes allowed.
|
||||
--- @param maxBytes number The maximum number of bytes.
|
||||
--- @example
|
||||
--- myEditBox:SetFocus()
|
||||
SetFocus = function(self) end,
|
||||
|
||||
--- Sets the number of history lines to remember.
|
||||
--- @param historyLines number The number of history lines.
|
||||
--- @example
|
||||
--- myEditBox:SetHistoryLines(10)
|
||||
SetHistoryLines = function(self, historyLines) end,
|
||||
|
||||
--- Sets the maximum byte size for entered text.
|
||||
--- @param maxBytes number The maximum byte size.
|
||||
--- @example
|
||||
--- myEditBox:SetMaxBytes(255)
|
||||
--- myEditBox:SetMaxBytes(256)
|
||||
SetMaxBytes = function(self, maxBytes) end,
|
||||
|
||||
--- Sets the maximum number of letters for entered text.
|
||||
--- @param maxLetters number The maximum number of letters.
|
||||
--- Sets the maximum number of characters allowed.
|
||||
--- @param maxLetters number The maximum number of characters.
|
||||
--- @example
|
||||
--- myEditBox:SetMaxLetters(100)
|
||||
--- myEditBox:SetMaxLetters(50)
|
||||
SetMaxLetters = function(self, maxLetters) end,
|
||||
|
||||
--- Sets the edit box to multi-line mode.
|
||||
--- @param multiLine boolean True to enable multi-line.
|
||||
--- Sets the maximum number of history lines.
|
||||
--- @param maxLines number The maximum number of history lines.
|
||||
--- @example
|
||||
--- myEditBox:SetMultiLine(true)
|
||||
SetMultiLine = function(self, multiLine) end,
|
||||
--- myEditBox:SetMaxLines(100)
|
||||
SetMaxLines = function(self, maxLines) end,
|
||||
|
||||
--- Sets the number in the edit box.
|
||||
--- @param number number The number to set.
|
||||
--- @example
|
||||
--- myEditBox:SetNumber(42)
|
||||
SetNumber = function(self, number) end,
|
||||
|
||||
--- Sets the edit box to numeric mode.
|
||||
--- @param numeric boolean True to enable numeric input.
|
||||
--- Sets whether the edit box is in numeric mode.
|
||||
--- @param isNumeric boolean True to set numeric mode.
|
||||
--- @example
|
||||
--- myEditBox:SetNumeric(true)
|
||||
SetNumeric = function(self, numeric) end,
|
||||
SetNumeric = function(self, isNumeric) end,
|
||||
|
||||
--- Sets the edit box to password mode.
|
||||
--- @param password boolean True to enable password input.
|
||||
--- Sets whether the edit box is password input.
|
||||
--- @param isPassword boolean True to set password input.
|
||||
--- @example
|
||||
--- myEditBox:SetPassword(true)
|
||||
SetPassword = function(self, password) end,
|
||||
SetPassword = function(self, isPassword) end,
|
||||
|
||||
--- Sets the spacing between multiple lines.
|
||||
--- @param spacing number The spacing value to set.
|
||||
--- Sets the text displayed in the edit box.
|
||||
--- @param text string The text to display.
|
||||
--- @example
|
||||
--- myEditBox:SetSpacing(2)
|
||||
SetSpacing = function(self, spacing) end,
|
||||
|
||||
--- Sets the text contained in the edit box.
|
||||
--- @param text string The text to set.
|
||||
--- @example
|
||||
--- myEditBox:SetText("Hello World")
|
||||
--- myEditBox:SetText("New text")
|
||||
SetText = function(self, text) end,
|
||||
|
||||
--- Sets the text insets for the edit box.
|
||||
--- Sets the text insets.
|
||||
--- @param left number The left inset.
|
||||
--- @param right number The right inset.
|
||||
--- @param top number The top inset.
|
||||
--- @param bottom number The bottom inset.
|
||||
--- @example
|
||||
--- myEditBox:SetTextInsets(5, 5, 5, 5)
|
||||
--- myEditBox:SetTextInsets(5, 5, 2, 2)
|
||||
SetTextInsets = function(self, left, right, top, bottom) end,
|
||||
|
||||
--- Toggles the input language for the edit box.
|
||||
--- Sets whether the edit box text can be changed.
|
||||
--- @param enabled boolean True to enable text changes.
|
||||
--- @example
|
||||
--- myEditBox:SetEnabled(true)
|
||||
SetEnabled = function(self, enabled) end,
|
||||
|
||||
--- Toggles whether the edit box has focus.
|
||||
--- @example
|
||||
--- myEditBox:ToggleInputLanguage()
|
||||
ToggleInputLanguage = function(self) end,
|
||||
|
||||
Reference in New Issue
Block a user