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;
Special case for widgets that can have multiple shortcuts based on items (like YDumbTab)
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.
YItemShortcut(YWidget *widget, YItem *item)
Constructor.
virtual ~YItemShortcut()
Destructor.
YItem * item() const
Return the associated item.
Simple item class for SelectionBox, ComboBox, MultiSelectionBox etc.
Helper class for shortcut management: This class holds data about the shortcut for one single widget.
char preferred()
The preferred shortcut character, i.e.
static char normalized(char c)
Return the normalized version of shortcut character 'c', i.e.
YShortcut(YWidget *shortcut_widget)
Constructor.
virtual std::string getShortcutString()
Obtain the the shortcut property of this shortcut's widget - the string that contains "&" to designat...
void setConflict(bool newConflictState=true)
Set or unset the internal 'conflict' marker.
int distinctShortcutChars()
Obtain the number of distinct valid shortcut characters in the shortcut string, i....
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,...
const char * widgetClass() const
Returns the textual representation of the widget class of the widget this shortcut data belongs to.
bool isButton() const
Returns 'true' if the widget that is associated with this shortcut is a button (derived from YPushBut...
bool hasValidShortcutChar()
Return true if this shortcut contains any character that would be valid as a shortcut character.
YWidget * widget() const
Returns the YWidget this shortcut data belong to.
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.
std::string shortcutString()
Returns the complete shortcut string (which may or may not contain "&"), i.e.
bool conflict()
Query the internal 'conflict' marker.
virtual ~YShortcut()
Destructor.
static char shortcutMarker()
Static function: Returns the character used for marking keyboard shortcuts.
virtual void setShortcut(char newShortcut)
Set (override) the shortcut character.
static bool isValid(char c)
Returns 'true' if 'c' is a valid shortcut character, i.e.
void clearShortcut()
Clear the shortcut: Override the shortcut character with nothing.
std::string cleanShortcutString()
Returns the shortcut string ( from the widget's shortcut property ) without any "&" markers.
bool isWizardButton() const
Returns 'true' if the widget that is associated with this shortcut is a wizard button (one of the nav...
char shortcut()
The actual shortcut character.