00001 /*========================================================================= 00002 00003 Program: ParaView 00004 Module: $RCSfile: vtkPVServerFileDialog.h,v $ 00005 00006 Copyright (c) Kitware, Inc. 00007 All rights reserved. 00008 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00024 #ifndef __vtkPVServerFileDialog_h 00025 #define __vtkPVServerFileDialog_h 00026 00027 #include "vtkKWLoadSaveDialog.h" 00028 00029 class vtkIntArray; 00030 class vtkKWApplication; 00031 class vtkKWCanvas; 00032 class vtkKWEntry; 00033 class vtkKWFrame; 00034 class vtkKWLabel; 00035 class vtkKWListBox; 00036 class vtkKWMenuButton; 00037 class vtkKWPushButton; 00038 class vtkKWScrollbar; 00039 class vtkKWWindow; 00040 class vtkPVApplication; 00041 class vtkStringList; 00042 class vtkSMProxy; 00043 00044 class VTK_EXPORT vtkPVServerFileDialog : public vtkKWLoadSaveDialog 00045 { 00046 public: 00047 static vtkPVServerFileDialog* New(); 00048 vtkTypeRevisionMacro(vtkPVServerFileDialog, vtkKWLoadSaveDialog); 00049 void PrintSelf(ostream& os, vtkIndent indent); 00050 00052 virtual void Create(vtkKWApplication *app); 00053 00058 virtual int Invoke(); 00059 00061 virtual void OK(); 00062 00064 00065 void SelectFile(const char* name, const char* id); 00066 void SelectDirectory(const char* name, const char* id); 00067 void DownDirectoryCallback(); 00068 void ExtensionsMenuButtonCallback(int typeIdx); 00070 00072 vtkPVApplication* GetPVApplication(); 00073 00075 virtual void Reconfigure(); 00076 00078 */ 00079 void AddDescriptionString(const char*); 00080 void AddExtensionString(const char*); 00082 00083 protected: 00084 vtkPVServerFileDialog(); 00085 ~vtkPVServerFileDialog(); 00086 00087 void Update(); 00088 int Insert(const char* name, int y, int directory); 00089 00090 // Get rid of backslashes. 00091 void ConvertLastPath(); 00092 00093 vtkKWFrame* TopFrame; 00094 vtkKWFrame* MiddleFrame; 00095 vtkKWCanvas* FileList; 00096 vtkKWFrame* BottomFrame; 00097 00098 vtkKWLabel* DirectoryDisplay; 00099 vtkKWMenuButton* DirectoryMenuButton; 00100 00101 vtkKWLabel* FileNameLabel; 00102 vtkKWEntry* FileNameEntry; 00103 vtkKWMenuButton* FileNameMenuButton; 00104 00105 vtkKWLabel* ExtensionsLabel; 00106 vtkKWFrame* ExtensionsDisplayFrame; 00107 vtkKWLabel* ExtensionsDisplay; 00108 vtkKWMenuButton* ExtensionsMenuButton; 00109 00110 vtkKWPushButton* LoadSaveButton; 00111 vtkKWPushButton* CancelButton; 00112 00113 vtkKWLabel* DownDirectoryButton; 00114 00115 char* SelectBoxId; 00116 vtkSetStringMacro(SelectBoxId); 00117 00118 char* SelectedDirectory; 00119 vtkSetStringMacro(SelectedDirectory); 00120 00121 void UpdateExtensionsMenu(); 00122 vtkStringList* FileTypeStrings; 00123 vtkStringList* FileTypeDescriptions; 00124 vtkStringList* ExtensionStrings; 00125 int CheckExtension(const char* name); 00126 00127 // Server-side helper. 00128 void CreateServerSide(); 00129 00130 vtkSMProxy* ServerFileListingProxy; 00131 00132 vtkKWScrollbar* ScrollBar; 00133 00135 void CalculateBBox(vtkKWWidget* canvas, const char* name, int bbox[4]); 00136 00137 private: 00138 vtkPVServerFileDialog(const vtkPVServerFileDialog&); // Not implemented 00139 void operator=(const vtkPVServerFileDialog&); // Not implemented 00140 }; 00141 00142 #endif