Update
This commit is contained in:
95
ui/Button.lua
Normal file
95
ui/Button.lua
Normal file
@@ -0,0 +1,95 @@
|
||||
---@meta
|
||||
|
||||
---@class Button : Frame
|
||||
Button = {
|
||||
--- Clicks the button programmatically.
|
||||
--- @param button? string Optional. The mouse button to simulate ("LeftButton", "RightButton", "MiddleButton").
|
||||
--- @param down? boolean Optional. Whether the button is being pressed down.
|
||||
--- @example
|
||||
--- myButton:Click()
|
||||
Click = function(self, button, down) end,
|
||||
|
||||
--- Gets the button state.
|
||||
--- @return string state The button state ("PUSHED", "NORMAL").
|
||||
--- @example
|
||||
--- local state = myButton:GetButtonState()
|
||||
GetButtonState = function(self) end,
|
||||
|
||||
--- Gets the text displayed on the button.
|
||||
--- @return string text The button text.
|
||||
--- @example
|
||||
--- local text = myButton:GetText()
|
||||
GetText = function(self) end,
|
||||
|
||||
--- Gets the texture for the specified state.
|
||||
--- @param stateIndex number The state index.
|
||||
--- @return Texture texture The state texture.
|
||||
--- @example
|
||||
--- local texture = myButton:GetTextureStateTexture(1)
|
||||
GetTextureStateTexture = function(self, stateIndex) end,
|
||||
|
||||
--- Enables or disables the button.
|
||||
--- @param enabled boolean True to enable the button.
|
||||
--- @example
|
||||
--- myButton:Enable()
|
||||
Enable = function(self, enabled) end,
|
||||
|
||||
--- Disables the button.
|
||||
--- @example
|
||||
--- myButton:Disable()
|
||||
Disable = function(self) end,
|
||||
|
||||
--- Returns whether the button is enabled.
|
||||
--- @return boolean enabled True if the button is enabled.
|
||||
--- @example
|
||||
--- local enabled = myButton:IsEnabled()
|
||||
IsEnabled = function(self) end,
|
||||
|
||||
--- Sets whether the button is locked.
|
||||
--- @param locked boolean True to lock the button.
|
||||
--- @example
|
||||
--- myButton:LockHighlight(true)
|
||||
LockHighlight = function(self, locked) end,
|
||||
|
||||
--- Registers the button for drag events.
|
||||
--- @param ... string The mouse buttons to register ("LeftButton", "RightButton", "MiddleButton").
|
||||
--- @example
|
||||
--- myButton:RegisterForDrag("LeftButton", "RightButton")
|
||||
RegisterForDrag = function(self, ...) end,
|
||||
|
||||
--- Sets the button state.
|
||||
--- @param state string The state to set ("PUSHED", "NORMAL").
|
||||
--- @example
|
||||
--- myButton:SetButtonState("PUSHED")
|
||||
SetButtonState = function(self, state) end,
|
||||
|
||||
--- Sets whether the button is enabled.
|
||||
--- @param enabled boolean True to enable the button.
|
||||
--- @example
|
||||
--- myButton:SetEnabled(true)
|
||||
SetEnabled = function(self, enabled) end,
|
||||
|
||||
--- Sets the font string used for the button text.
|
||||
--- @param fontString FontString The font string to use.
|
||||
--- @example
|
||||
--- myButton:SetFontString(myFontString)
|
||||
SetFontString = function(self, fontString) end,
|
||||
|
||||
--- Sets the button text.
|
||||
--- @param text string The text to display.
|
||||
--- @example
|
||||
--- myButton:SetText("Click Me")
|
||||
SetText = function(self, text) end,
|
||||
|
||||
--- Sets the texture for a button state.
|
||||
--- @param texture Texture|string The texture or texture path.
|
||||
--- @param stateIndex number The state index.
|
||||
--- @example
|
||||
--- myButton:SetTextureStateTexture(myTexture, 1)
|
||||
SetTextureStateTexture = function(self, texture, stateIndex) end,
|
||||
|
||||
--- Unlocks the button highlight.
|
||||
--- @example
|
||||
--- myButton:UnlockHighlight()
|
||||
UnlockHighlight = function(self) end,
|
||||
}
|
Reference in New Issue
Block a user