#include <YShortcut.h>
Public Member Functions | |
YShortcut (YWidget *shortcut_widget) | |
virtual | ~YShortcut () |
YWidget * | widget () |
const char * | widgetClass () |
string | shortcutString () |
string | cleanShortcutString () |
char | preferred () |
char | shortcut () |
void | setShortcut (char new_shortcut) |
bool | conflict () |
void | setConflict (bool newConflictState=true) |
int | distinctShortcutChars () |
Static Public Member Functions | |
string | cleanShortcutString (string shortcutString) |
char | shortcutMarker () |
string::size_type | findShortcutPos (const string &str, string::size_type start_pos=0) |
char | findShortcut (const string &str, string::size_type start_pos=0) |
bool | isValid (char c) |
char | normalized (char c) |
string | getShortcutString (YWidget *widget) |
Protected Member Functions | |
string | getShortcutString () |
Protected Attributes | |
YWidget * | _widget |
string | _shortcut_string |
bool | _shortcut_string_chached |
string | _clean_shortcut_string |
bool | _clean_shortcut_string_chached |
int | _preferred |
int | _shortcut |
bool | _conflict |
int | _distinctShortcutChars |
|
Constructor |
|
Destructor |
|
Static version of the above for general use: Returns the specified string without any "& " markers. |
|
Returns the shortcut string ( from the widget's shortcut property ) without any "& " markers. |
|
Query the internal 'conflict' marker. This class doesn't care about that flag, it just stores it for the convenience of higher-level classes. |
|
Obtain the number of distinct valid shortcut characters in the shortcut string, i.e. how many different shortcuts that widget could get. |
|
Static function: Find the next shortcut marker in a string, beginning at starting position start_pos. Returns the shortcut character or 0 if none found. |
|
Static function: Find the next occurrence of the shortcut marker ( '& ' ) in a string, beginning at starting position start_pos. Returns string::npos if not found or the position of the shortcut marker ( ! ) if found. |
|
Obtain the the shortcut property of this shortcut's widget - the string that contains "& " to designate a shortcut. |
|
Obtain a widget's shortcut property - the string that contains "& " to designate a shortcut. |
|
Returns 'true' if 'c' is a valid shortcut character, i.e. [a-zA-Z0-9], 'false' otherwise. |
|
Return the normalized version of shortcut character 'c', i.e. a lowercase letter or a digit [a-z0-9]. Returns 0 if 'c' is invalid. |
|
The preferred shortcut character, i.e. the character that had been preceded by "& " before checking / resolving conflicts began. |
|
Set or unset the internal 'conflict' marker. |
|
Set ( override ) the shortcut character. |
|
The actual shortcut character. This may be different from preferred() if it is overridden. |
|
Static function: Returns the character used for marking keyboard shortcuts. |
|
Returns the complete shortcut string ( which may or may not contain "& " ), i.e. the value of the widget's shortcut property. For PushButtons, this is the label on the button ( e.g., "& Details..." ), for other widgets usually the caption above it. This value is chached, i.e. this isn't a too expensive operation. |
|
Returns the YWidget this shortcut data belong to. |
|
Returns the textual representation of the widget class of the widget this shortcut data belongs to. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|