libyui
3.0.10
|
#include <YWizard.h>
Public Member Functions | |
virtual | ~YWizard () |
virtual const char * | widgetClass () const |
YWizardMode | wizardMode () const |
virtual YPushButton * | backButton () const =0 |
virtual YPushButton * | abortButton () const =0 |
virtual YPushButton * | nextButton () const =0 |
virtual YReplacePoint * | contentsReplacePoint () const =0 |
void | protectNextButton (bool protect) |
bool | nextButtonIsProtected () const |
virtual void | setButtonLabel (YPushButton *button, const std::string &newLabel) |
virtual void | setHelpText (const std::string &helpText)=0 |
virtual void | setDialogIcon (const std::string &iconName)=0 |
virtual void | setDialogTitle (const std::string &titleText)=0 |
virtual void | setDialogHeading (const std::string &headingText)=0 |
virtual void | addStep (const std::string &text, const std::string &id)=0 |
virtual void | addStepHeading (const std::string &text)=0 |
virtual void | deleteSteps ()=0 |
virtual void | setCurrentStep (const std::string &id)=0 |
virtual void | updateSteps ()=0 |
virtual void | addTreeItem (const std::string &parentID, const std::string &text, const std::string &id)=0 |
virtual void | selectTreeItem (const std::string &id)=0 |
virtual std::string | currentTreeSelection ()=0 |
virtual void | deleteTreeItems ()=0 |
virtual void | addMenu (const std::string &text, const std::string &id)=0 |
virtual void | addSubMenu (const std::string &parentMenuID, const std::string &text, const std::string &id)=0 |
virtual void | addMenuEntry (const std::string &parentMenuID, const std::string &text, const std::string &id)=0 |
virtual void | addMenuSeparator (const std::string &parentMenuID)=0 |
virtual void | deleteMenus ()=0 |
virtual void | showReleaseNotesButton (const std::string &label, const std::string &id)=0 |
virtual void | hideReleaseNotesButton ()=0 |
virtual void | retranslateInternalButtons ()=0 |
void | ping () |
virtual YPropertyValue | getProperty (const std::string &propertyName) |
virtual const YPropertySet & | propertySet () |
Protected Member Functions | |
YWizard (YWidget *parent, const std::string &backButtonLabel, const std::string &abortButtonLabel, const std::string &nextButtonLabel, YWizardMode wizardMode=YWizardMode_Standard) |
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.
YWizard::YWizard | ( | YWidget * | parent, |
const std::string & | backButtonLabel, | ||
const std::string & | abortButtonLabel, | ||
const std::string & | nextButtonLabel, | ||
YWizardMode | wizardMode = YWizardMode_Standard |
||
) | [protected] |
Constructor.
If only two buttons are desired, leave 'backButtonLabel' empty.
Definition at line 47 of file YWizard.cc.
YWizard::~YWizard | ( | ) | [virtual] |
Destructor.
Definition at line 67 of file YWizard.cc.
virtual void YWizard::addMenu | ( | const std::string & | text, |
const std::string & | id | ||
) | [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.
virtual void YWizard::addMenuEntry | ( | const std::string & | parentMenuID, |
const std::string & | text, | ||
const std::string & | id | ||
) | [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.
virtual void YWizard::addMenuSeparator | ( | const std::string & | parentMenuID | ) | [pure virtual] |
Add a menu separator to a menu.
virtual void YWizard::addStep | ( | const std::string & | text, |
const std::string & | id | ||
) | [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().
virtual void YWizard::addStepHeading | ( | const std::string & | text | ) | [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().
virtual void YWizard::addSubMenu | ( | const std::string & | parentMenuID, |
const std::string & | text, | ||
const std::string & | id | ||
) | [pure virtual] |
Add a submenu to the menu with ID 'parentMenuID'.
virtual void YWizard::addTreeItem | ( | const std::string & | parentID, |
const std::string & | text, | ||
const std::string & | id | ||
) | [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.
virtual YPushButton* YWizard::backButton | ( | ) | const [pure virtual] |
Return the wizard buttons or 0 if there is no such button.
Derived classes are required to implement this.
virtual YReplacePoint* YWizard::contentsReplacePoint | ( | ) | const [pure virtual] |
Return the internal contents ReplacePoint.
Derived classes are required to implement this.
virtual std::string YWizard::currentTreeSelection | ( | ) | [pure virtual] |
Returns the current tree selection or an empty string if nothing is selected or there is no tree.
virtual void YWizard::deleteMenus | ( | ) | [pure virtual] |
Delete all menus and hide the menu bar.
virtual void YWizard::deleteSteps | ( | ) | [pure virtual] |
Delete all steps and step headings from the internal lists. The display is only updated upon calling updateSteps().
virtual void YWizard::deleteTreeItems | ( | ) | [pure virtual] |
Delete all tree items.
YPropertyValue YWizard::getProperty | ( | const std::string & | propertyName | ) | [virtual] |
Get a property. Reimplemented from YWidget.
This method may throw YUIPropertyExceptions.
Reimplemented from YWidget.
Definition at line 131 of file YWizard.cc.
virtual void YWizard::hideReleaseNotesButton | ( | ) | [pure virtual] |
Hide an existing "Release Notes" button.
bool YWizard::nextButtonIsProtected | ( | ) | const |
Check if the wizard's "Next" button is currently protected against disabling.
Definition at line 80 of file YWizard.cc.
void YWizard::ping | ( | ) |
NOP command to check if a YWizard is running.
Definition at line 106 of file YWizard.cc.
const YPropertySet & YWizard::propertySet | ( | ) | [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.
void YWizard::protectNextButton | ( | bool | protect | ) |
Protect the wizard's "Next" button against disabling.
Definition at line 87 of file YWizard.cc.
virtual void YWizard::retranslateInternalButtons | ( | ) | [pure virtual] |
Retranslate internal buttons that are not accessible from the outside:
virtual void YWizard::selectTreeItem | ( | const std::string & | id | ) | [pure virtual] |
Select the tree item with the specified ID, if such an item exists.
void YWizard::setButtonLabel | ( | YPushButton * | button, |
const std::string & | newLabel | ||
) | [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.
virtual void YWizard::setCurrentStep | ( | const std::string & | id | ) | [pure virtual] |
Set the current step. This also triggers updateSteps() if necessary.
virtual void YWizard::setDialogHeading | ( | const std::string & | headingText | ) | [pure virtual] |
Set the dialog heading.
virtual void YWizard::setDialogIcon | ( | const std::string & | iconName | ) | [pure virtual] |
Set the dialog icon. An empty icon name clears the current icon.
virtual void YWizard::setDialogTitle | ( | const std::string & | titleText | ) | [pure virtual] |
Set the dialog title shown in the window manager's title bar. An empty string clears the current title.
virtual void YWizard::setHelpText | ( | const std::string & | helpText | ) | [pure virtual] |
Set the help text.
Reimplemented from YWidget.
virtual void YWizard::showReleaseNotesButton | ( | const std::string & | label, |
const std::string & | id | ||
) | [pure virtual] |
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 YWizard::updateSteps | ( | ) | [pure virtual] |
Update the steps display: Reflect the internal steps and heading lists in the layout.
virtual const char* YWizard::widgetClass | ( | ) | const [inline, virtual] |
YWizardMode YWizard::wizardMode | ( | ) | const |
Return the wizard mode (what kind of wizard this is): YWizardMode_Standard, YWizardMode_Steps, YWizardMode_Tree
Definition at line 74 of file YWizard.cc.