|
RADLib
RADical C++ application framework
|
Backend-neutral command/action model for buttons, menus, and toolbars. More...
#include <RADWidgets.h>
Inheritance diagram for RADUi::Action:
Collaboration diagram for RADUi::Action:Public Member Functions | |
| Action ()=default | |
| Creates an empty enabled action. More... | |
| Action (std::string text) | |
| Creates an enabled action with display text. More... | |
| const std::string & | text () const |
| Returns the action display text. More... | |
| void | setText (std::string text) |
| Updates the action display text. More... | |
| bool | isEnabled () const |
| Returns true when the action can be triggered. More... | |
| void | setEnabled (bool enabled) |
| Enables or disables the action. More... | |
| bool | isCheckable () const |
| Returns true when the action has a checked state. More... | |
| void | setCheckable (bool checkable) |
| Enables or disables checkable behavior. More... | |
| bool | isChecked () const |
| Returns true when a checkable action is checked. More... | |
| void | setChecked (bool checked) |
| Sets the checked state for checkable actions. More... | |
| void | trigger () |
| Emits triggered when enabled. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void() > | changed |
| Raised when text, enabled state, checkable state, or checked state changes. More... | |
| RADCore::Event< void() > | triggered |
| Raised when trigger() is called on an enabled action. More... | |
Backend-neutral command/action model for buttons, menus, and toolbars.
|
default |
Creates an empty enabled action.
|
explicit |
Creates an enabled action with display text.
| bool RADUi::Action::isCheckable | ( | ) | const |
Returns true when the action has a checked state.
| bool RADUi::Action::isChecked | ( | ) | const |
Returns true when a checkable action is checked.
| bool RADUi::Action::isEnabled | ( | ) | const |
Returns true when the action can be triggered.
| void RADUi::Action::setCheckable | ( | bool | checkable | ) |
Enables or disables checkable behavior.
| void RADUi::Action::setChecked | ( | bool | checked | ) |
Sets the checked state for checkable actions.
| void RADUi::Action::setEnabled | ( | bool | enabled | ) |
Enables or disables the action.
| void RADUi::Action::setText | ( | std::string | text | ) |
Updates the action display text.
| const std::string& RADUi::Action::text | ( | ) | const |
Returns the action display text.
| void RADUi::Action::trigger | ( | ) |
Emits triggered when enabled.
| RADCore::Event<void () > RADUi::Action::changed |
Raised when text, enabled state, checkable state, or checked state changes.
| RADCore::Event<void () > RADUi::Action::triggered |
Raised when trigger() is called on an enabled action.