Kbase P125309: Is there a common code for file open dialog box which can be used on Windows or Unix?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  07/08/2007 |
|
Status: Unverified
GOAL:
Is there a common code for file open dialog box which can be used on Windows or Unix?
GOAL:
Sample code to create a file open dialog box on Unix?
GOAL:
Sample code to create a file save dialog box on Unix?
GOAL:
Sample code to create a file open dialog box on Windows?
GOAL:
Sample code to create a file save dialog box on Windows?
FIX:
The following procedure heading is an excerpt taken from the adeedit.pl and is distributed with most versions of Progress / OpenEdge.
/**************************************************************************
Procedure : _dlggetf.p
Purpose : GUI and Character-mode version of SYSTEM-DIALOG GET-FILE for both
Open and Save As dialogs.
Syntax :
RUN adeedit/_dlggetf.p
( INPUT p_Title ,
INPUT p_Save_As ,
INPUT p_Initial_Filter ,
INPUT-OUTPUT p_File_Spec ,
OUTPUT p_Return_Status ) .
Parmameters :
p_Title : String to use for dialog box title.
p_Save_As : YES means use Save As dlg; NO means Open.
p_Initial_Filter : A number indicating which filter should be
the initial filter. Currently unused.
p_File_Spec : File spec passed in and out.
p_Return_Status : YES - User successfully selected a file name
which could be found executing a PROGRESS RUN.
NO - User press Cancel or STOP.
**************************************************************************/
Here is an example using the Procedure:
DEFINE VARIABLE c_MyFileName AS CHARACTER INITIAL "" NO-UNDO.
DEFINE VARIABLE p_Title AS CHARACTER INITIAL "" NO-UNDO.
DEFINE VARIABLE p_Save_As AS CHARACTER INITIAL FALSE NO-UNDO.
DEFINE VARIABLE p_File_Spec AS CHARACTER INITIAL 1 NO-UNDO.
DEFINE VARIABLE p_Initial_Filter AS CHARACTER INITIAL "" NO-UNDO.
DEFINE VARIABLE p_Return_Status AS LOGICAL INITIAL FALSE.
RUN Main.
PROCEDURE Main:
ASSIGN p_Title = "Choose your file.".
REPEAT WHILE ( p_Return_Status = FALSE) :
run adeedit/_dlggetf.p
( INPUT p_Title ,
INPUT p_Save_As ,
INPUT p_Initial_Filter ,
INPUT-OUTPUT p_File_Spec ,
OUTPUT p_Return_Status ) .
END.
ASSIGN c_MyFileName = p_File_Spec.
END.