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

FXWizard.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                           W i z a r d   W i d g e t                           *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 2002,2009 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (at your option) any later version.                                           *
00012 *                                                                               *
00013 * This library is distributed in the hope that it will be useful,               *
00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of                *
00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 *********************************************************************************
00021 * $Id: FXWizard.h,v 1.13 2009/01/06 13:07:29 fox Exp $                          *
00022 ********************************************************************************/
00023 #ifndef FXWIZARD_H
00024 #define FXWIZARD_H
00025 
00026 #ifndef FXDIALOGBOX_H
00027 #include "FXDialogBox.h"
00028 #endif
00029 
00030 namespace FX {
00031 
00032 
00033 class FXImage;
00034 class FXIcon;
00035 class FXImageFrame;
00036 class FXButton;
00037 class FXSwitcher;
00038 
00039 
00040 /**
00041 * A Wizard widget guides the user through a number of panels
00042 * in a predefined sequence; each step must be completed before
00043 * moving on to the next step.
00044 * For example, a Wizard may be used to install software components,
00045 * and ask various questions at each step in the installation.
00046 */
00047 class FXAPI FXWizard : public FXDialogBox {
00048   FXDECLARE(FXWizard)
00049 protected:
00050   FXHorizontalFrame *buttons;           // Button frame
00051   FXImageFrame      *sidebar;           // Sidebar comprising image
00052   FXButton          *advance;           // Advance to next stage
00053   FXButton          *retreat;           // Retreat to last stage
00054   FXButton          *finish;            // Finish panel
00055   FXButton          *cancel;            // Cancel button
00056   FXSwitcher        *panels;            // Sub panels
00057   FXIcon            *finishicon;
00058   FXIcon            *nexticon;
00059   FXIcon            *backicon;
00060 protected:
00061   FXWizard(){}
00062   void construct();
00063 private:
00064   FXWizard(const FXWizard&);
00065   FXWizard &operator=(const FXWizard&);
00066 public:
00067   long onUpdFinish(FXObject*,FXSelector,void*);
00068   long onCmdNext(FXObject*,FXSelector,void*);
00069   long onUpdNext(FXObject*,FXSelector,void*);
00070   long onCmdBack(FXObject*,FXSelector,void*);
00071   long onUpdBack(FXObject*,FXSelector,void*);
00072 public:
00073   enum {
00074     ID_NEXT=FXDialogBox::ID_LAST,
00075     ID_BACK,
00076     ID_LAST
00077     };
00078 public:
00079 
00080   /// Construct free-floating Wizard
00081   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);
00082 
00083   /// Construct Wizard which will always float over the owner window
00084   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);
00085 
00086   /// Return a pointer to the button frame
00087   FXHorizontalFrame *buttonFrame() const { return buttons; }
00088 
00089   /// Return a pointer to the "Advance" button
00090   FXButton *advanceButton() const { return advance; }
00091 
00092   /// Return a pointer to the "Retreat" button
00093   FXButton *retreatButton() const { return retreat; }
00094 
00095   /// Return a pointer to the "Finish" button
00096   FXButton *finishButton() const { return finish; }
00097 
00098   /// Return a pointer to the "Cancel" button
00099   FXButton *cancelButton() const { return cancel; }
00100 
00101   /// Return the container used as parent for the subpanels
00102   FXSwitcher *getContainer() const { return panels; }
00103 
00104   /// Change the image being displayed
00105   void setImage(FXImage* img);
00106 
00107   /// Return the current image
00108   FXImage* getImage() const;
00109 
00110   /// Return number of panels
00111   FXint getNumPanels() const;
00112 
00113   /// Bring the child window at index to the top
00114   void setCurrentPanel(FXint index);
00115 
00116   /// Return the index of the child window currently on top
00117   FXint getCurrentPanel() const;
00118 
00119   /// Save to stream
00120   virtual void save(FXStream& store) const;
00121 
00122   /// Load from stream
00123   virtual void load(FXStream& store);
00124 
00125   // Destroy
00126   virtual ~FXWizard();
00127   };
00128 
00129 }
00130 
00131 #endif

Copyright © 1997-2009 Jeroen van der Zijp