//*************************************************************************** //* //* Class: cvSaveAsDialog //* Package Name: cvFileDialogs.pkg //* //*************************************************************************** Use File_dlg.pkg // *WvA: 13-01-1999 Created // The Class cSelectFile_Dialog is created to support the function Select_File // This function opens the Windows standard file open dialog and returns the selected // file_name. Class cvSelectFile_Dialog Is An OpenDialog Procedure Construct_Object Integer iImage_Id Forward Send Construct_Object iImage_Id Set HideReadOnly_State To True End_Procedure // Construct_Object Function SelectedFileName Returns String String sFileName Move "" To sFileName If (Show_Dialog(Self)) Begin Move (RTrim(File_Name(Self))) To sFileName End Function_Return sFileName End_Function // SelectedFileName End_Class // cvSelectFile_Dialog // *WvA: 13-01-1999 Created // This function opens the Windows standard file open dialog and returns the selected // file_name. Returns '' if the user didn't make a selection. // **WvA: 17-10-2003 Cleaned up and added code to destroy the dynamically created // file-open dialog Function vSelect_File Global String sSupportedFileTypes String sCaptionText ; String sInitialFolder Returns String String sSelectedFile Integer hoOpenFileDialog Object oOpenFileDialog Is A cvSelectFile_Dialog Set Dialog_Caption To sCaptionText Set Filter_String To sSupportedFileTypes Set Initial_Folder To sInitialFolder Move Self To hoOpenFileDialog End_Object // oOpenFileDialog Get SelectedFileName Of hoOpenFileDialog To sSelectedFile Send Destroy_Object To hoOpenFileDialog Function_Return sSelectedFile End_Function // vSelect_File Class cvSaveAsDialog is a SaveAsDialog Procedure Construct_Object Forward Send Construct_Object Set HideReadOnly_State To True End_Procedure // Construct_Object Function SelectedFileName Returns String String sFileName Move "" To sFileName If (Show_Dialog(Self)) Begin Move (RTrim(File_Name(Self))) To sFileName End Function_Return sFileName End_Function // SelectedFileName End_Class // cvSaveAsDialog Function vSelectSaveFile Global String sSupportedFileTypes String sCaptionText String sInitialFolder Returns String String sSelectedFile Integer hoDialog Move "" To sSelectedFile Get Create U_cvSaveAsDialog To hoDialog If (hoDialog) Begin //Set NoChangeDir_State Of hoDialog To True Set Dialog_Caption Of hoDialog To sCaptionText Set Filter_String Of hoDialog To sSupportedFileTypes Set Initial_Folder Of hoDialog To sInitialFolder Get SelectedFileName Of hoDialog To sSelectedFile Send Destroy Of hoDialog End Function_Return sSelectedFile End_Function // vSelectSaveFile