![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /********************************************************************* 00002 ** Copyright (c) 2007 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /********************************************************************* 00006 ** $RCSfile: newSimulationModelSetWizard.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 *********************************************************************/ 00008 00011 00012 #ifndef DTNEWSIMULATIONMODELSETWIZARD_H_ 00013 #define DTNEWSIMULATIONMODELSETWIZARD_H_ 00014 00015 #include <QtGui/QDialog> 00016 #include <QtCore/QList> 00017 00018 class QPushButton; 00019 class QRadioButton; 00020 class QFileDialog; 00021 class QLineEdit; 00022 class DtSimulationModelSet; 00023 class DtFilename; 00024 class QProgressDialog; 00025 00026 #include "entityEditorImpl/entityEditorImplDefines.h" 00027 00028 class DT_DLL_entityeditorimpl DtWizardPage : public QWidget 00029 { 00030 Q_OBJECT 00031 00032 public: 00033 DtWizardPage(QWidget*, const Qt::WindowFlags& f = 0); 00034 virtual ~DtWizardPage(); 00035 00036 virtual DtWizardPage* nextPage(QWidget* p) { return NULL; }; 00037 00038 virtual bool isLastPage() const; 00039 virtual bool pageComplete() const; 00040 virtual bool nextPageComplete() const { return false; }; 00041 00042 virtual void execute() {}; 00043 00044 virtual void keyPressEvent(QKeyEvent*); 00045 00046 signals: 00047 void pageCompleted(bool); 00048 void returnPressed(); 00049 void backPage(); 00050 void rejected(); 00051 00052 protected: 00053 DtWizardPage* myNextPage; 00054 }; 00055 00056 class DT_DLL_entityeditorimpl DtNewModelSetPage : public DtWizardPage 00057 { 00058 Q_OBJECT 00059 00060 public: 00061 DtNewModelSetPage(QWidget*, const Qt::WindowFlags& f = 0); 00062 virtual ~DtNewModelSetPage(); 00063 00064 void setSimulationModelSet(const DtSimulationModelSet* s) { mySet = s; }; 00065 00066 virtual void accept(); 00067 virtual void reject(); 00068 00069 protected: 00070 virtual bool isLastPage() const; 00071 virtual bool hideButtons(QWidget*); 00072 virtual bool pageComplete() const; 00073 virtual bool nextPageComplete() const { return false; }; 00074 virtual QLineEdit* lineEdit(QWidget*); 00075 virtual void execute(); 00076 virtual void createFromSet(const DtSimulationModelSet& set, const QStringList& ignoreFiles = QStringList()); 00077 00080 virtual int fileCount(const DtFilename&, const QStringList& ignore) const; 00081 virtual bool duplicateDirectory(const DtFilename& sourceDir, const DtFilename& destDir, 00082 const QStringList& ignore, QProgressDialog*, int& onFile); 00083 00084 protected slots: 00085 virtual void directoryChanged(); 00086 00087 protected: 00088 QFileDialog* myDirectory; 00089 const DtSimulationModelSet* mySet; 00090 }; 00091 00092 class DT_DLL_entityeditorimpl DtExistingModelSetPage : public DtNewModelSetPage 00093 { 00094 Q_OBJECT 00095 00096 public: 00097 DtExistingModelSetPage(QWidget*, const Qt::WindowFlags& f = 0); 00098 virtual ~DtExistingModelSetPage(); 00099 00100 protected: 00101 virtual bool isLastPage() const { return false; }; 00102 virtual bool pageComplete() const; 00103 virtual bool nextPageComplete() const { return pageComplete(); }; 00104 virtual DtWizardPage* nextPage(QWidget* p); 00105 virtual void execute(); 00106 00107 protected: 00108 DtWizardPage* myNewModelSetPage; 00109 }; 00110 00111 class DT_DLL_entityeditorimpl DtChoicePage : public DtWizardPage 00112 { 00113 Q_OBJECT 00114 00115 public: 00116 DtChoicePage(QWidget*, const Qt::WindowFlags& f = 0); 00117 virtual ~DtChoicePage(); 00118 00119 protected: 00120 virtual DtWizardPage* nextPage(QWidget* p); 00121 virtual bool pageComplete() const { return true; }; 00122 virtual bool nextPageComplete() const { return true; }; 00123 virtual void execute(); 00124 virtual DtNewModelSetPage* createNewModelSetPage(QWidget* p); 00125 virtual DtExistingModelSetPage* createExistingModelSetPage(QWidget* p); 00126 00127 protected: 00128 QRadioButton* myCreateNew; 00129 QRadioButton* myCreateFromExisting; 00130 00131 DtWizardPage* myCreateNewPage; 00132 DtWizardPage* myCreateFromExistingPage; 00133 }; 00134 00135 class DT_DLL_entityeditorimpl DtNewSimulationModelSetWizard : public QDialog 00136 { 00137 Q_OBJECT 00138 00139 public: 00140 DtNewSimulationModelSetWizard(QWidget* p, const Qt::WindowFlags& f = 0); 00141 virtual ~DtNewSimulationModelSetWizard(); 00142 00143 virtual void createNewModelSet(); 00144 00145 static DtNewSimulationModelSetWizard* create(QWidget* p = NULL); 00146 00147 protected: 00148 virtual void keyPressEvent(QKeyEvent*); 00149 virtual DtChoicePage* createChoicePage(QWidget*); 00150 00151 protected slots: 00152 virtual void backButtonClicked(); 00153 virtual void nextButtonClicked(); 00154 virtual void enableNextButton(bool); 00155 virtual void returnKeyPressed(); 00156 00157 protected: 00158 QPushButton* myNextButton; 00159 QPushButton* myBackButton; 00160 QPushButton* myCancelButton; 00161 QPushButton* myFinishButton; 00162 QList<DtWizardPage*> myPages; 00163 00164 protected: 00165 QWidget* myChoicePage; 00166 }; 00167 00168 #endif