Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXWizard.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * W i z a r d W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 2002,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXWizard.h,v 1.8 2006/01/22 17:58:12 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXWIZARD_H
25 #define FXWIZARD_H
26 
27 #ifndef FXDIALOGBOX_H
28 #include "FXDialogBox.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXImage;
35 class FXIcon;
36 class FXImageFrame;
37 class FXButton;
38 class FXSwitcher;
39 
40 
41 /**
42 * A Wizard widget guides the user through a number of panels
43 * in a predefined sequence; each step must be completed before
44 * moving on to the next step.
45 * For example, a Wizard may be used to install software components,
46 * and ask various questions at each step in the installation.
47 */
48 class FXAPI FXWizard : public FXDialogBox {
50 protected:
51  FXHorizontalFrame *buttons; // Button frame
52  FXImageFrame *sidebar; // Sidebar comprising image
53  FXButton *advance; // Advance to next stage
54  FXButton *retreat; // Retreat to last stage
55  FXButton *finish; // Finish panel
56  FXButton *cancel; // Cancel button
57  FXSwitcher *panels; // Sub panels
58  FXIcon *finishicon;
59  FXIcon *nexticon;
60  FXIcon *backicon;
61 protected:
62  FXWizard(){}
63  void construct();
64 private:
65  FXWizard(const FXWizard&);
66  FXWizard &operator=(const FXWizard&);
67 public:
68  long onUpdFinish(FXObject*,FXSelector,void*);
69  long onCmdNext(FXObject*,FXSelector,void*);
70  long onUpdNext(FXObject*,FXSelector,void*);
71  long onCmdBack(FXObject*,FXSelector,void*);
72  long onUpdBack(FXObject*,FXSelector,void*);
73 public:
74  enum {
76  ID_BACK,
77  ID_LAST
78  };
79 public:
80 
81  /// Construct free-floating Wizard
82  FXWizard(FXApp* a,const FXString& name,FXImage *image,FXuint opts=DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=10,FXint vs=10);
83 
84  /// Construct Wizard which will always float over the owner window
85  FXWizard(FXWindow* owner,const FXString& name,FXImage *image,FXuint opts=DECOR_TITLE|DECOR_BORDER|DECOR_RESIZE,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=10,FXint pr=10,FXint pt=10,FXint pb=10,FXint hs=10,FXint vs=10);
86 
87  /// Return a pointer to the button frame
88  FXHorizontalFrame *buttonFrame() const { return buttons; }
89 
90  /// Return a pointer to the "Advance" button
91  FXButton *advanceButton() const { return advance; }
92 
93  /// Return a pointer to the "Retreat" button
94  FXButton *retreatButton() const { return retreat; }
95 
96  /// Return a pointer to the "Finish" button
97  FXButton *finishButton() const { return finish; }
98 
99  /// Return a pointer to the "Cancel" button
100  FXButton *cancelButton() const { return cancel; }
101 
102  /// Return the container used as parent for the subpanels
103  FXSwitcher *getContainer() const { return panels; }
104 
105  /// Change the image being displayed
106  void setImage(FXImage* img);
107 
108  /// Return the current image
109  FXImage* getImage() const;
110 
111  /// Return number of panels
112  FXint getNumPanels() const;
113 
114  /// Bring the child window at index to the top
115  void setCurrentPanel(FXint index);
116 
117  /// Return the index of the child window currently on top
118  FXint getCurrentPanel() const;
119 
120  /// Save to stream
121  virtual void save(FXStream& store) const;
122 
123  /// Load from stream
124  virtual void load(FXStream& store);
125 
126  // Destroy
127  virtual ~FXWizard();
128  };
129 
130 }
131 
132 #endif
DialogBox window.
Definition: FXDialogBox.h:40
Base class for all windows.
Definition: FXWindow.h:115
unsigned int FXuint
Definition: fxdefs.h:396
FXuint FXSelector
Association key.
Definition: FXObject.h:53
Window title.
Definition: FXTopWindow.h:41
A button provides a push button, with optional icon and/or text label.
Definition: FXButton.h:85
Border.
Definition: FXTopWindow.h:45
#define FXAPI
Definition: fxdefs.h:122
Application Object.
Definition: FXApp.h:158
Horizontal frame layout manager widget is used to automatically place child-windows horizontally from...
Definition: FXHorizontalFrame.h:39
FXString name(const FXString &file)
Return name and extension part of the path name.
The Switcher layout manager automatically arranges its child windows such that one of them is placed ...
Definition: FXSwitcher.h:62
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:45
A Wizard widget guides the user through a number of panels in a predefined sequence; each step must b...
Definition: FXWizard.h:48
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
The image frame is a simple frame widget displaying an image; the image is not owned by the image fra...
Definition: FXImageFrame.h:39
An Image is a rectangular array of pixels.
Definition: FXImage.h:67
Definition: FXDialogBox.h:51
Resize handles.
Definition: FXTopWindow.h:48
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp