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