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-2020 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 00077 class SoMenuFileSelection : public SoMenuPushButton 00078 { 00079 SO_DG_HEADER(SoMenuFileSelection); 00080 00081 public: 00082 00086 SoSFString title; 00087 00101 SoMFString filter; 00102 00106 SoSFInt32 defaultFilter; 00107 00111 SoSFFilePathString fileDirectory; 00112 00116 SoSFFilePathString filename; 00117 00118 enum Mode { 00120 OPEN = 0x01, 00122 SAVE = 0x02 00123 }; 00124 00129 SoSFEnum mode; 00130 00134 SoMenuFileSelection(); 00135 00139 void addAuditor(SoMenuFileSelectionAuditor* auditor); 00140 00144 void removeAuditor(SoMenuFileSelectionAuditor* auditor); 00145 00146 /*==============================================================================*/ 00147 private: 00148 static void initClass(); 00149 static void exitClass(); 00150 virtual void menuEvent(void* parent, int itemId); 00151 void validateFilename(); 00152 void setIsOpened(SbBool iso) { m_isOpenedWindow = iso; }; 00153 void applyDlgCptAuditor(); 00154 00155 private: 00156 virtual ~SoMenuFileSelection(); 00157 00158 void openDialogBox(); 00159 00160 SbString m_dirPath; // saved current directory 00161 00162 private: 00163 SbBool m_isOpenedWindow; 00164 00166 // 3D methods 00167 private: 00168 00169 private: 00170 virtual void add3DCallbackMethods(); 00171 00172 private: 00173 static void finishCB3D( void *, SoDragger *inDragger ); 00174 virtual void draggerFinishCallback3D(); 00175 00177 }; 00178 00179 #endif // _SO_MENU_FILE_SELECTION_ 00180 00181 00182