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

FXWizard.h

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

Copyright © 1997-2005 Jeroen van der Zijp