180 lines
5.6 KiB
Lua
180 lines
5.6 KiB
Lua
---@meta
|
|
|
|
---@class EditBox : Frame, FontInstance
|
|
EditBox = {
|
|
--- Adds a history line to the edit box.
|
|
--- @param text string The text to add to history.
|
|
--- @example
|
|
--- myEditBox:AddHistoryLine("Previous entry")
|
|
AddHistoryLine = function(self, text) end,
|
|
|
|
--- Clears the focus from the edit box.
|
|
--- @example
|
|
--- myEditBox:ClearFocus()
|
|
ClearFocus = function(self) end,
|
|
|
|
--- Clears the history of the edit box.
|
|
--- @example
|
|
--- myEditBox:ClearHistory()
|
|
ClearHistory = function(self) end,
|
|
|
|
--- Gets the cursor position.
|
|
--- @return number position The cursor position.
|
|
--- @example
|
|
--- local position = myEditBox:GetCursorPosition()
|
|
GetCursorPosition = function(self) end,
|
|
|
|
--- Gets the maximum number of bytes allowed.
|
|
--- @return number maxBytes The maximum number of bytes.
|
|
--- @example
|
|
--- local maxBytes = myEditBox:GetMaxBytes()
|
|
GetMaxBytes = function(self) end,
|
|
|
|
--- 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 maximum number of history lines.
|
|
--- @return number maxLines The maximum number of history lines.
|
|
--- @example
|
|
--- local maxLines = myEditBox:GetMaxLines()
|
|
GetMaxLines = function(self) end,
|
|
|
|
--- 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 text displayed in the edit box.
|
|
--- @return string text The edit box text.
|
|
--- @example
|
|
--- local text = myEditBox:GetText()
|
|
GetText = function(self) end,
|
|
|
|
--- 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,
|
|
|
|
--- 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,
|
|
|
|
--- Returns whether the text is highlighted.
|
|
--- @return boolean isHighlighted True if text is highlighted.
|
|
--- @example
|
|
--- local isHighlighted = myEditBox:IsHighlighted()
|
|
IsHighlighted = function(self) end,
|
|
|
|
--- Returns whether the edit box is in numeric mode.
|
|
--- @return boolean isNumeric True if in numeric mode.
|
|
--- @example
|
|
--- local isNumeric = myEditBox:IsNumeric()
|
|
IsNumeric = function(self) end,
|
|
|
|
--- Returns whether the edit box is password input.
|
|
--- @return boolean isPassword True if password input.
|
|
--- @example
|
|
--- local isPassword = myEditBox:IsPassword()
|
|
IsPassword = function(self) end,
|
|
|
|
--- Sets the cursor position.
|
|
--- @param position number The cursor position.
|
|
--- @example
|
|
--- myEditBox:SetCursorPosition(5)
|
|
SetCursorPosition = function(self, position) end,
|
|
|
|
--- Sets whether the edit box has focus.
|
|
--- @param focus boolean True to set focus.
|
|
--- @example
|
|
--- myEditBox:SetFocus(true)
|
|
SetFocus = function(self, focus) end,
|
|
|
|
--- Sets the history lines.
|
|
--- @param ... string The history lines.
|
|
--- @example
|
|
--- myEditBox:SetHistoryLines("Line 1", "Line 2")
|
|
SetHistoryLines = function(self, ...) end,
|
|
|
|
--- Sets the maximum number of bytes allowed.
|
|
--- @param maxBytes number The maximum number of bytes.
|
|
--- @example
|
|
--- myEditBox:SetMaxBytes(256)
|
|
SetMaxBytes = function(self, maxBytes) end,
|
|
|
|
--- Sets the maximum number of characters allowed.
|
|
--- @param maxLetters number The maximum number of characters.
|
|
--- @example
|
|
--- myEditBox:SetMaxLetters(50)
|
|
SetMaxLetters = function(self, maxLetters) end,
|
|
|
|
--- Sets the maximum number of history lines.
|
|
--- @param maxLines number The maximum number of history lines.
|
|
--- @example
|
|
--- myEditBox:SetMaxLines(100)
|
|
SetMaxLines = function(self, maxLines) end,
|
|
|
|
--- Sets whether the edit box is in numeric mode.
|
|
--- @param isNumeric boolean True to set numeric mode.
|
|
--- @example
|
|
--- myEditBox:SetNumeric(true)
|
|
SetNumeric = function(self, isNumeric) end,
|
|
|
|
--- Sets whether the edit box is password input.
|
|
--- @param isPassword boolean True to set password input.
|
|
--- @example
|
|
--- myEditBox:SetPassword(true)
|
|
SetPassword = function(self, isPassword) end,
|
|
|
|
--- Sets the text displayed in the edit box.
|
|
--- @param text string The text to display.
|
|
--- @example
|
|
--- myEditBox:SetText("New text")
|
|
SetText = function(self, text) end,
|
|
|
|
--- 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, 2, 2)
|
|
SetTextInsets = function(self, left, right, top, bottom) end,
|
|
|
|
--- 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,
|
|
}
|