136 void setConflict(
bool newConflictState =
true ) { _conflict = newConflictState; }
163 static std::string::size_type
findShortcutPos(
const std::string & str, std::string::size_type start_pos = 0 );
171 static char findShortcut(
const std::string & str, std::string::size_type start_pos = 0 );
204 std::string _shortcutString;
205 bool _shortcutStringCached;
207 std::string _cleanShortcutString;
208 bool _cleanShortcutStringCached;
215 bool _isWizardButton;
216 int _distinctShortcutChars;
267 typedef std::vector<YShortcut *> YShortcutList;
268 typedef YShortcutList::iterator YShortcutListIterator;
271 #endif // YShortcut_h virtual ~YShortcut()
Destructor.
char preferred()
The preferred shortcut character, i.e.
virtual void setShortcut(char newShortcut)
Set (override) the shortcut character.
const char * widgetClass() const
Returns the textual representation of the widget class of the widget this shortcut data belongs to...
YItem * item() const
Return the associated item.
Helper class for shortcut management: This class holds data about the shortcut for one single widget...
virtual std::string getShortcutString()
Obtain the the shortcut property of this shortcut's widget - the string that contains "&" to designat...
virtual void setShortcut(char newShortcut)
Set (override) the shortcut character.
static char normalized(char c)
Return the normalized version of shortcut character 'c', i.e.
virtual std::string getShortcutString()
Obtain the the shortcut property of this shortcut's widget - the string that contains "&" to designat...
virtual ~YItemShortcut()
Destructor.
void setConflict(bool newConflictState=true)
Set or unset the internal 'conflict' marker.
Special case for widgets that can have multiple shortcuts based on items (like YDumbTab) ...
static char shortcutMarker()
Static function: Returns the character used for marking keyboard shortcuts.
std::string shortcutString()
Returns the complete shortcut string (which may or may not contain "&"), i.e.
bool isButton() const
Returns 'true' if the widget that is associated with this shortcut is a button (derived from YPushBut...
std::string cleanShortcutString()
Returns the shortcut string ( from the widget's shortcut property ) without any "&" markers...
bool conflict()
Query the internal 'conflict' marker.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
static char findShortcut(const std::string &str, std::string::size_type start_pos=0)
Static function: Find the next shortcut marker in a string, beginning at starting position start_pos...
void clearShortcut()
Clear the shortcut: Override the shortcut character with nothing.
int distinctShortcutChars()
Obtain the number of distinct valid shortcut characters in the shortcut string, i.e.
static std::string::size_type findShortcutPos(const std::string &str, std::string::size_type start_pos=0)
Static function: Find the next occurrence of the shortcut marker ('&') in a string, beginning at starting position start_pos.
bool hasValidShortcutChar()
Return true if this shortcut contains any character that would be valid as a shortcut character...
YItemShortcut(YWidget *widget, YItem *item)
Constructor.
YWidget * widget() const
Returns the YWidget this shortcut data belong to.
char shortcut()
The actual shortcut character.
bool isWizardButton() const
Returns 'true' if the widget that is associated with this shortcut is a wizard button (one of the nav...
YShortcut(YWidget *shortcut_widget)
Constructor.
static bool isValid(char c)
Returns 'true' if 'c' is a valid shortcut character, i.e.