#include <YItemCustomStatus.h>
Public Member Functions | |
YItemCustomStatus (const std::string &iconName, const std::string &textIndicator, int nextStatus=-1) | |
const std::string & | iconName () const |
const std::string & | textIndicator () const |
int | nextStatus () const |
void | setNextStatus (int value) |
bool | hasNextStatus () const |
Protected Attributes | |
std::string | _iconName |
std::string | _textIndicator |
int | _nextStatus |
Class describing a non-binary status for an item.
This is an extension of normal boolean item states: Rather than just "on" or "off" like for check boxes or radio buttons, a status of this kind can have any nonnegative integer number. The number is implicitly the index of this status in the corresponding vector.
For symmetry with boolean states, a value of 0 is defined to have the same semantics as "off" / "unselected", 1 has the semantics of "on" / "fully selected", and all other values are purely application-defined.
|
inline |
Constructor.
|
inline |
Return 'true' if a next status to cylce to is defined for this status, 'false' if not.
|
inline |
The name of an icon to use in the widget in a graphical UI if an item has this status.
|
inline |
This returns the next status to cycle through if the user clicks on the status or cycles through status values with the corresponding shortcut key.
If no such value was specified, this returns -1. The application can then still choose to set a different status depending on other application data.
|
inline |
Set the next status. This should only be done once when the status transition map is evaluated.
|
inline |
A text representation of this status in a text-based UI if an item has this status, for example "[ ]", "[x]" or "[ ], "[ +]", "[a+]".
It is recommended to use the same character length for all states so all items line up properly, even if they have different states.