libyui
3.3.2
|
A wizard is a more complex frame typically used for multi-step workflows: More...
#include <YWizard.h>
Public Member Functions | |
virtual | ~YWizard () |
Destructor. | |
virtual const char * | widgetClass () const |
Returns a descriptive name of this widget class for logging, debugging etc. | |
YWizardMode | wizardMode () const |
Return the wizard mode (what kind of wizard this is): YWizardMode_Standard, YWizardMode_Steps, YWizardMode_Tree, YWizardMode_TitleOnLeft. | |
virtual YPushButton * | backButton () const =0 |
Return the wizard buttons or 0 if there is no such button. More... | |
virtual YPushButton * | abortButton () const =0 |
virtual YPushButton * | nextButton () const =0 |
virtual YReplacePoint * | contentsReplacePoint () const =0 |
Return the internal contents ReplacePoint. More... | |
void | protectNextButton (bool protect) |
Protect the wizard's "Next" button against disabling. | |
bool | nextButtonIsProtected () const |
Check if the wizard's "Next" button is currently protected against disabling. | |
virtual void | setButtonLabel (YPushButton *button, const std::string &newLabel) |
Set the label of one of the wizard buttons (backButton(), abortButton(), nextButton() ) if that button is non-null. More... | |
virtual void | setHelpText (const std::string &helpText)=0 |
Set the help text. | |
virtual void | setDialogIcon (const std::string &iconName)=0 |
Set the dialog icon. More... | |
virtual void | setDialogTitle (const std::string &titleText)=0 |
Set the dialog title shown in the window manager's title bar. More... | |
virtual void | setDialogHeading (const std::string &headingText)=0 |
Set the dialog heading. | |
virtual void | addStep (const std::string &text, const std::string &id)=0 |
Add a step for the steps panel on the side bar. More... | |
virtual void | addStepHeading (const std::string &text)=0 |
Add a step heading for the steps panel on the side bar. More... | |
virtual void | deleteSteps ()=0 |
Delete all steps and step headings from the internal lists. More... | |
virtual void | setCurrentStep (const std::string &id)=0 |
Set the current step. More... | |
virtual void | updateSteps ()=0 |
Update the steps display: Reflect the internal steps and heading lists in the layout. | |
virtual void | addTreeItem (const std::string &parentID, const std::string &text, const std::string &id)=0 |
Add a tree item. More... | |
virtual void | selectTreeItem (const std::string &id)=0 |
Select the tree item with the specified ID, if such an item exists. | |
virtual std::string | currentTreeSelection ()=0 |
Returns the current tree selection or an empty string if nothing is selected or there is no tree. | |
virtual void | deleteTreeItems ()=0 |
Delete all tree items. | |
virtual void | addMenu (const std::string &text, const std::string &id)=0 |
Add a menu to the menu bar. More... | |
virtual void | addSubMenu (const std::string &parentMenuID, const std::string &text, const std::string &id)=0 |
Add a submenu to the menu with ID 'parentMenuID'. | |
virtual void | addMenuEntry (const std::string &parentMenuID, const std::string &text, const std::string &id)=0 |
Add a menu entry to the menu with ID 'parentMenuID'. More... | |
virtual void | addMenuSeparator (const std::string &parentMenuID)=0 |
Add a menu separator to a menu. | |
virtual void | deleteMenus ()=0 |
Delete all menus and hide the menu bar. | |
virtual void | showReleaseNotesButton (const std::string &label, const std::string &id)=0 |
Show a "Release Notes" button above the "Help" button in the steps panel with the specified label that will return the specified id to UI::UserInput() when clicked. | |
virtual void | hideReleaseNotesButton ()=0 |
Hide an existing "Release Notes" button. | |
virtual void | retranslateInternalButtons ()=0 |
Retranslate internal buttons that are not accessible from the outside: More... | |
void | ping () |
NOP command to check if a YWizard is running. | |
virtual YPropertyValue | getProperty (const std::string &propertyName) |
Get a property. More... | |
virtual const YPropertySet & | propertySet () |
Return this class's property set. More... | |
![]() | |
virtual | ~YWidget () |
Destructor. | |
virtual std::string | debugLabel () const |
Returns a descriptive label of this widget instance. More... | |
std::string | helpText () const |
Return the help text for this widget. | |
void | setHelpText (const std::string &helpText) |
Set a help text for this widget. More... | |
virtual bool | setProperty (const std::string &propertyName, const YPropertyValue &val) |
Set a property. More... | |
bool | hasChildren () const |
Returns 'true' if this widget has any children. | |
YWidget * | firstChild () const |
Returns the first child or 0 if there is none. More... | |
YWidget * | lastChild () const |
Returns the last child or 0 if there is none. | |
YWidgetListIterator | childrenBegin () const |
Return an iterator that points to the first child or to childrenEnd() if there are no children. | |
YWidgetListIterator | childrenEnd () const |
Return an interator that points after the last child. | |
YWidgetListConstIterator | childrenConstBegin () const |
Return a const iterator that points to the first child or to childrenEnd() if there are no children. | |
YWidgetListConstIterator | childrenConstEnd () const |
Return a const interator that points after the last child. | |
YWidgetListIterator | begin () |
A helper for the range-based "for" loop. More... | |
YWidgetListIterator | end () |
A helper for the range-based "for" loop. More... | |
int | childrenCount () const |
Returns the current number of children. | |
bool | contains (YWidget *child) const |
Checks if 'child' is a (direct!) child of this widget. | |
virtual void | addChild (YWidget *child) |
Add a new child. More... | |
virtual void | removeChild (YWidget *child) |
Remove a child. More... | |
void | deleteChildren () |
Delete all children and remove them from the children manager's list. | |
YWidget * | parent () const |
Return this widget's parent or 0 if it doesn't have a parent. | |
bool | hasParent () const |
Return 'true' if this widget has a parent, 'false' if not. | |
void | setParent (YWidget *newParent) |
Set this widget's parent. | |
YDialog * | findDialog () |
Traverse up the widget hierarchy and find the dialog this widget belongs to. More... | |
YWidget * | findWidget (YWidgetID *id, bool doThrow=true) const |
Recursively find a widget by its ID. More... | |
virtual int | preferredWidth ()=0 |
Preferred width of the widget. More... | |
virtual int | preferredHeight ()=0 |
Preferred height of the widget. More... | |
virtual int | preferredSize (YUIDimension dim) |
Preferred size of the widget in the specified dimension. More... | |
virtual void | setSize (int newWidth, int newHeight)=0 |
Set the new size of the widget. More... | |
bool | isValid () const |
Checks whether or not this object is valid. More... | |
bool | beingDestroyed () const |
Check if this widget is in the process of being destroyed. | |
void * | widgetRep () const |
Return a pointer to the underlying toolkit's (Qt, ...) widget representing this abstract UI widget. | |
void | setWidgetRep (void *toolkitWidgetRep) |
Set the pointer to the underlying toolkit's (Qt, ...) widget representing this abstract UI widget. More... | |
bool | hasId () const |
Returns 'true' if this widget has an ID. | |
YWidgetID * | id () const |
Returns this widget's ID. | |
void | setId (YWidgetID *newId_disown) |
Set this widget's ID. More... | |
virtual void | setEnabled (bool enabled=true) |
Enable or disable this widget, i.e. More... | |
void | setDisabled () |
Disable this widget (overloaded for better readability). | |
virtual bool | isEnabled () const |
Returns 'true' if this widget is enabled. | |
virtual bool | stretchable (YUIDimension dim) const |
This is a boolean value that determines whether the widget is resizable beyond its preferred size in the specified dimension. More... | |
void | setStretchable (YUIDimension dim, bool newStretch) |
Set the stretchable state to "newStretch" regardless of any hstretch or vstretch options. | |
void | setDefaultStretchable (YUIDimension dim, bool newStretch) |
Set the stretchable state to "newStretch". More... | |
virtual int | weight (YUIDimension dim) |
The weight is used in situations where all widgets can get their preferred size and yet space is available. More... | |
bool | hasWeight (YUIDimension dim) |
Return whether or not the widget has a weight in the specified dimension. | |
void | setWeight (YUIDimension dim, int weight) |
Set a weight in the specified dimension. | |
void | setNotify (bool notify=true) |
Sets the Notify property. | |
bool | notify () const |
Returns whether the widget will notify, i.e. More... | |
void | setNotifyContextMenu (bool notifyContextMenu=true) |
Sets the notifyContextMenu property. | |
bool | notifyContextMenu () const |
Returns whether the widget will send an event when the user clicks selects the context menu e.g. More... | |
bool | sendKeyEvents () const |
Returns 'true' if this widget should send key events, i.e. More... | |
void | setSendKeyEvents (bool doSend) |
Specify whether or not this widget should send key events. | |
bool | autoShortcut () const |
Returns 'true' if a keyboard shortcut should automatically be assigned to this widget - without complaints in the log file. | |
void | setAutoShortcut (bool _newAutoShortcut) |
Sets the 'autoShortcut' flag. | |
int | functionKey () const |
Return a function key number that is assigned to this widget. More... | |
bool | hasFunctionKey () const |
Check if a function key is assigned to this widget. | |
virtual void | setFunctionKey (int fkey_no) |
Assign a function key to this widget (1 for F1, 2 for F2, etc. More... | |
virtual bool | setKeyboardFocus () |
Set the keyboard focus to this widget. More... | |
virtual std::string | shortcutString () const |
Get the string of this widget that holds the keyboard shortcut, if any. More... | |
virtual void | setShortcutString (const std::string &str) |
Set the string of this widget that holds the keyboard shortcut, if any. More... | |
virtual const char * | userInputProperty () |
The name of the widget property that will return user input, if there is any. More... | |
void | dumpWidgetTree (int indentationLevel=0) |
Debugging function: Dump the widget tree from here on to the log file. | |
void | dumpDialogWidgetTree () |
Debugging function: Dump the widget tree from this widget's dialog parent. More... | |
void | setChildrenEnabled (bool enabled) |
Enable or disable all widgets in this widget tree. | |
virtual void | saveUserInput (YMacroRecorder *macroRecorder) |
Recursively save the user input of all child widgets to a macro recorder: More... | |
void * | operator new (size_t size) |
Overloaded operator new to ensure widgets are always created on the heap, never on the stack. More... | |
virtual void | startMultipleChanges () |
In some UIs updating the screen content is an expensive operation. More... | |
virtual void | doneMultipleChanges () |
Protected Member Functions | |
YWizard (YWidget *parent, const std::string &backButtonLabel, const std::string &abortButtonLabel, const std::string &nextButtonLabel, YWizardMode wizardMode=YWizardMode_Standard) | |
Constructor. More... | |
![]() | |
YWidget (YWidget *parent) | |
Constructor. | |
YWidgetChildrenManager * | childrenManager () const |
Returns this widget's children manager. | |
void | setChildrenManager (YWidgetChildrenManager *manager) |
Sets a new children manager for this widget. More... | |
void | setBeingDestroyed () |
Set the "being destroyed" flag, i.e. More... | |
void | dumpWidget (YWidget *w, int indentationLevel) |
Helper function for dumpWidgetTree(): Dump one widget to the log file. | |
A wizard is a more complex frame typically used for multi-step workflows:
+---------—+---------------------------------------------—+
Side bar | Content Area |
(YReplacePoint) | |
[Back] [Abort] [Next] |
+---------—+---------------------------------------------—+
The side bar can contain help text, a list of steps that are performed, or an embedded tree (much like the YTree widget).
The client application creates the wizard and replaces the widget in the content area for each step.
The wizard buttons can theoretically be used to do anything, but good UI design will stick to the model above: [Back], [Abort], [Next].
If only two buttons are desired, leave the [Back] button's label emtpy. The remaining two buttons will be rearranged accordingly in the button area.
In the last step of a multi-step workflow, the [Next] button's label is customarily replaced with a label that indicates that this is the last step. [Accept] is recommended for that button label: [Finish] (as sometimes used in other environments) by no means clearly indicates that this is the positive ending, the final "do it" button. Worse, translations of that are often downright miserable: To German, [Finish] gets translated as [Beenden] which is the same word as "Quit" (used in menus). This does not at all tell the user that that button really performs the requested action the multi-step wizard is all about.
|
protected |
Constructor.
If only two buttons are desired, leave 'backButtonLabel' empty.
Definition at line 47 of file YWizard.cc.
|
pure virtual |
Add a menu to the menu bar.
If the menu bar is not visible yet, it will be made visible. 'text' is the user-visible text for the menu bar (including keyboard shortcuts marked with '&'), 'id' is the menu ID for later addMenuEntry() etc. calls.
|
pure virtual |
Add a menu entry to the menu with ID 'parentMenuID'.
'id' is what will be returned by UI::UserInput() etc. when a user activates this menu entry.
|
pure virtual |
Add a step for the steps panel on the side bar.
This only adds the step to the internal list of steps. The display is only updated upon calling updateSteps().
|
pure virtual |
Add a step heading for the steps panel on the side bar.
This only adds the heading to the internal list of steps. The display is only updated upon calling updateSteps().
|
pure virtual |
Add a tree item.
If "parentID" is an empty string, it will be a root item. 'text' is the text that will be displayed in the tree, 'id' the ID with which this newly created item can be referenced - and that will be returned when the user clicks on a tree item.
|
pure virtual |
Return the wizard buttons or 0 if there is no such button.
Derived classes are required to implement this.
|
pure virtual |
Return the internal contents ReplacePoint.
Derived classes are required to implement this.
|
pure virtual |
Delete all steps and step headings from the internal lists.
The display is only updated upon calling updateSteps().
|
virtual |
Get a property.
Reimplemented from YWidget.
This method may throw YUIPropertyExceptions.
Reimplemented from YWidget.
Definition at line 131 of file YWizard.cc.
|
virtual |
Return this class's property set.
This also initializes the property upon the first call.
Reimplemented from YWidget.
Reimplemented from YWidget.
Definition at line 113 of file YWizard.cc.
|
pure virtual |
Retranslate internal buttons that are not accessible from the outside:
|
virtual |
Set the label of one of the wizard buttons (backButton(), abortButton(), nextButton() ) if that button is non-null.
The default implementation simply calls button->setLabel( newLabel ).
Definition at line 94 of file YWizard.cc.
|
pure virtual |
Set the current step.
This also triggers updateSteps() if necessary.
|
pure virtual |
Set the dialog icon.
An empty icon name clears the current icon.
|
pure virtual |
Set the dialog title shown in the window manager's title bar.
An empty string clears the current title.