00001 /*======================================================================= 00002 *** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), *** 00003 *** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. *** 00004 *** *** 00005 *** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS *** 00006 *** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR *** 00007 *** WRITTEN AUTHORIZATION OF FEI S.A.S. *** 00008 *** *** 00009 *** RESTRICTED RIGHTS LEGEND *** 00010 *** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS *** 00011 *** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN *** 00012 *** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT *** 00013 *** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN *** 00014 *** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. *** 00015 *** *** 00016 *** COPYRIGHT (C) 1996-2014 BY FEI S.A.S, *** 00017 *** BORDEAUX, FRANCE *** 00018 *** ALL RIGHTS RESERVED *** 00019 **=======================================================================*/ 00020 /*======================================================================= 00021 ** Author : Nicolas DAGUISE (Oct 2002) 00022 **=======================================================================*/ 00023 #ifndef _SO_MENU_FILE_SELECTION_ 00024 #define _SO_MENU_FILE_SELECTION_ 00025 00026 #include <DialogViz/dialog/SoMenuPushButton.h> 00027 #include <Inventor/fields/SoMFString.h> 00028 #include <Inventor/fields/SoSFFilePathString.h> 00029 #include <Inventor/fields/SoSFInt32.h> 00030 00031 class SoMenuFileSelectionAuditor; 00032 00076 class SoMenuFileSelection : public SoMenuPushButton 00077 { 00078 SO_DG_HEADER(SoMenuFileSelection); 00079 00080 public: 00081 00085 SoSFString title; 00086 00100 SoMFString filter; 00101 00105 SoSFInt32 defaultFilter; 00106 00110 SoSFFilePathString fileDirectory; 00111 00115 SoSFFilePathString filename; 00116 00117 enum Mode { 00119 OPEN = 0x01, 00121 SAVE = 0x02 00122 }; 00123 00128 SoSFEnum mode; 00129 00133 SoMenuFileSelection(); 00134 00138 void addAuditor(SoMenuFileSelectionAuditor* auditor); 00139 00143 void removeAuditor(SoMenuFileSelectionAuditor* auditor); 00144 00145 /*==============================================================================*/ 00146 private: 00147 static void initClass(); 00148 static void exitClass(); 00149 virtual void menuEvent(void* parent, int itemId); 00150 void validateFilename(); 00151 void setIsOpened(SbBool iso) { m_isOpenedWindow = iso; }; 00152 void applyDlgCptAuditor(); 00153 00154 private: 00155 virtual ~SoMenuFileSelection(); 00156 00157 void openDialogBox(); 00158 00159 SbString m_dirPath; // saved current directory 00160 00161 private: 00162 SbBool m_isOpenedWindow; 00163 00165 // 3D methods 00166 private: 00167 00168 private: 00169 virtual void add3DCallbackMethods(); 00170 00171 private: 00172 static void finishCB3D( void *, SoDragger *inDragger ); 00173 virtual void draggerFinishCallback3D(); 00174 00176 }; 00177 00178 #endif // _SO_MENU_FILE_SELECTION_ 00179 00180 00181