|
|
using | StateContract = spk::StatefulObject<bool>::Contract |
| | Contract type for state change subscriptions.
|
|
using | StateJob = spk::StatefulObject<bool>::Job |
| | Job type invoked when state changes.
|
| enum class | State { Released
, Pressed
, Hovered
, Both
} |
| | Visual state of the button.
|
|
using | Contract = spk::TContractProvider<>::Contract |
| | Contract type for click subscriptions.
|
|
using | Job = spk::TContractProvider<>::Job |
| | Job type invoked on clicks.
|
| enum class | FocusType { Keyboard = 0
, Mouse = 1
} |
| | Types of focus a widget can own.
|
|
using | Contract = StatefulObject<ActivationStatus>::Contract |
| | Subscription handle controlling callback lifetime.
|
|
using | Job = StatefulObject<ActivationStatus>::Job |
| | Callback signature executed on activation state changes.
|
|
using | Contract |
| | Handle allowing subscribers to manage callback lifetimes.
|
|
using | Job |
| | Callable invoked when the object transitions to a state.
|
|
| | CheckableIconButton (const std::wstring &p_name, spk::Widget *p_parent) |
| | Builds a checkable icon button.
|
| bool | checked () const |
| | Returns whether the button is checked.
|
| void | setChecked (bool p_checked) |
| | Sets the checked state.
|
|
void | toggle () |
| | Toggles the checked state.
|
| void | setCheckedIconSpriteID (const spk::Vector2UInt &p_spriteID) |
| | Sets the sprite ID used when checked.
|
| StateContract | addStateCallback (bool p_state, const StateJob &p_callback) |
| | Adds a callback for a specific state value.
|
| | IconButton (const std::wstring &p_name, spk::Widget *p_parent) |
| | Builds an icon button widget.
|
| void | setVisualState (const State &p_state) |
| | Sets the current visual state.
|
| void | toggle (State p_state=State::Both) |
| | Toggles icon visibility for a state.
|
| bool | isIconVisible (State p_state=State::Released) const |
| | Returns icon visibility for a state.
|
| Contract | subscribe (const Job &p_job) |
| | Subscribes to click events.
|
| void | setTexture (const spk::SpriteSheet *p_spriteSheet, State p_state=State::Both) |
| | Sets the background texture for a state.
|
| void | setCornerSize (const spk::Vector2UInt &p_cornerSize, State p_state=State::Both) |
| | Sets the background corner size for a state.
|
| void | setIconTexture (const spk::SpriteSheet &p_spriteSheet, State p_state=State::Both) |
| | Sets the icon texture from a sprite sheet reference.
|
| void | setIconTexture (const spk::SpriteSheet *p_spriteSheet, State p_state=State::Both) |
| | Sets the icon texture from a sprite sheet pointer.
|
| void | setIconSpriteID (const spk::Vector2UInt &p_spriteID, State p_state=State::Both) |
| | Sets the icon sprite ID for a state.
|
| void | setIconPadding (const spk::Vector2UInt &p_padding, State p_state=State::Both) |
| | Sets icon padding for a state.
|
| const spk::SpriteSheet * | texture (State p_state=State::Both) const |
| | Returns the background texture for a state.
|
| const spk::Vector2UInt & | cornerSize (State p_state=State::Both) const |
| | Returns the background corner size for a state.
|
| const spk::SpriteSheet * | iconTexture (State p_state=State::Both) const |
| | Returns the icon texture for a state.
|
| const spk::Vector2UInt & | iconSpriteID (State p_state=State::Both) const |
| | Returns the icon sprite ID for a state.
|
| const spk::Vector2UInt & | iconPadding (State p_state=State::Both) const |
| | Returns the icon padding for a state.
|
| void | takeFocus (FocusType p_focusType) |
| | Grants this widget ownership of the requested focus type.
|
| void | releaseFocus (FocusType p_focusType) |
| | Releases a previously acquired focus type.
|
| bool | hasFocus (FocusType p_focusType) const |
| | Checks if this widget currently owns a focus type.
|
|
void | takeAllFocus () |
| | Acquires both keyboard and mouse focus.
|
|
void | releaseAllFocus () |
| | Releases both keyboard and mouse focus types.
|
| | Widget (const std::wstring &p_name, Widget *p_parent) |
| | Builds a widget optionally attached to a parent.
|
| void | addChild (Widget *p_child) override |
| | Adds a child widget and sorts the hierarchy by layer.
|
| const float & | layer () const |
| | Current rendering layer of the widget.
|
| void | setLayer (const float &p_newLayer) |
| | Updates the widget layer and propagates relative offsets to children.
|
| const std::wstring & | name () const |
| | Retrieves the widget name.
|
| void | setName (const std::wstring &p_name) |
| | Sets the widget name.
|
| void | setGeometry (const spk::Extend2D &p_geometry) override |
| | Requests a specific viewport and scissor region for the widget.
|
| const spk::Extend2D & | geometry () const |
| | Returns the current widget geometry.
|
| const spk::OpenGL::ViewRegion & | viewRegion () const |
| | Accesses the computed view region.
|
| const spk::OpenGL::FrameBufferObject & | frameBufferObject () const |
| | Returns the frame buffer object used for widget rendering.
|
| const spk::OpenGL::FrameBufferObject & | fbo () const |
| | Alias for frameBufferObject().
|
|
void | requireGeometryChange () |
| | Marks the widget view region as needing recomputation.
|
| virtual void | removeChild (Widget *p_child) |
| | Removes a child from this node.
|
| Widget * | parent () const |
| | Returns the parent pointer.
|
| virtual std::vector< Widget * > & | children () |
| | Returns the children vector.
|
|
void | clearChildren () |
| | Clears the children list and resets each child's parent pointer.
|
|
| ActivableObject () |
| | Builds a deactivated object.
|
| | ActivableObject (ActivationStatus p_initial) |
| | Builds with a custom initial activation state.
|
|
void | activate () |
| | Sets the state to Activated.
|
|
void | deactivate () |
| | Sets the state to Deactivated.
|
|
void | toggle () |
| | Toggles between activated and deactivated states.
|
| bool | isActive () const |
| | Checks whether the object is currently activated.
|
| Contract | addActivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object activates.
|
| Contract | addDeactivationCallback (const Job &p_callback) |
| | Registers a callback executed when the object deactivates.
|
| | StatefulObject (const ActivationStatus &p_initialState) |
| | Builds with an initial state.
|
|
StatefulObject & | operator= (const StatefulObject &p_other)=delete |
| void | setState (const ActivationStatus &p_newState) |
| | Sets a new state and triggers callbacks registered for it.
|
| ActivationStatus | state () const |
| | Returns the current state.
|
| Contract | addCallback (const ActivationStatus &p_state, const Job &p_callback) |
| | Subscribes a callback for a specific state.
|
| SizeHint & | sizeHint () |
| | Returns mutable size hint data.
|
| const SizeHint & | sizeHint () const |
| | Returns const size hint data.
|
Icon button that toggles a checked state.
- See also
- IconButton
button.setChecked(true);
Widget * parent() const
Definition spk_inherence_object.hpp:85