cwImageButton panelclient
Panel defined in core/derma/cl_imagebutton.lua
Defines cwImageButton, a DImage that works as a button with hovered, depressed and disabled states.
Has FadeIn and FadeOut animations that play the theme's click and rollover sounds, and SetCallback to set the
click handler.
Summary
Methods
DoClick when the left button is released over an enabled button.Methods
Shows the button and fades it in, playing the click sound.
Parameters
- speed Number Length of the fade in seconds
- Callback Function optional, defaults to
nilCalled once the button is fully visible
Fades the button out and hides it, playing the rollover sound.
Parameters
- speed Number Length of the fade in seconds
- Callback Function optional, defaults to
nilCalled once the button is hidden
Returns whether the button is held down.
Returns
- Boolean Whether the button is held down
Returns whether the button is disabled.
Returns
- Boolean Whether the button is disabled
Returns whether the button is hovered.
Returns
- Boolean Whether the button is hovered
Marks the button as hovered unless it is disabled.
Clears the button's hovered state.
Captures the mouse and marks the button as held down.
Parameters
- code
Releases the mouse and calls DoClick when the left button is released over an enabled button.
Parameters
- code
Sets the function called when the button is clicked, playing the click sound first.
Parameters
- Callback Function Called with the button
Sets whether the button is held down.
Parameters
- depressed Boolean
truewhile the mouse button is held on it
Sets whether the button ignores hovering and clicks.
Parameters
- disabled Boolean
trueto disable the button
Sets whether the button is hovered.
Parameters
- hovered Boolean
truewhile the cursor is over it
Runs the fade animation.