Open an FDLog Open dialog box passing the file types to list in an array of strings.
An FDLog.UseGroup version of GetOpenBox that uses an enumerated FDLog.UseGroup code to indicate the set of file types to list. See sys_utils.h or the Origin.ini file for a list of the enumerated FDLOG.UseGroup codes.
An easier to use version of GetOpenBox that works for a single file type.
string GetOpenBox( StringArray & saFiletypes, LPCSTR lpcszPath = NULL, LPCSTR lpcszFilename = NULL, LPCSTR lpcszDialogName = NULL )
string GetOpenBox( FDLogUseGroup nFDLogUseGroup, LPCSTR lpcszPath = NULL, LPCSTR lpcszFilename = NULL, LPCSTR lpcszDialogName = NULL )
string GetOpenBox( LPCSTR lpcszFileType = "*.* All Files", LPCSTR lpcszPath = NULL, LPCSTR lpcszFilename = NULL, LPCSTR lpcszDialogName = NULL )
Returns the path and filename of a selecetd file or an empty string if Cancel button
in dialog box is clicked.
Returns the path and filename of a selected file or an empty string if Cancel button
in dialog box is clicked.
Returns the path and filename of a selecetd file or an empty string if Cancel button
in dialog box is clicked.
EX1
int GetOpenBox_ex1() { string strPath; StringArray saFiletypes; saFiletypes.SetSize( 3 ); saFiletypes[0]="[Project (*.OPJ)] *.OPJ"; saFiletypes[1]="[Old version (*.ORG)] *.ORG"; saFiletypes[2]="[Worksheets (*.OGW)] *.OGW"; strPath = GetOpenBox( saFiletypes ); // or //strPath = GetOpenBox( saFiletypes, "C:\\Program Files\\" ); // or //strPath = GetOpenBox( saFiletypes, "C:\\Program Files\\", "Origin" ); // or //strPath = GetOpenBox( saFiletypes, "C:\\Program Files\\", "Origin", "OpenOPJ" ); if( strPath.IsEmpty() ) printf( "User has cancelled the Open dialog box." ); else printf( "The file chosen is %s\n.", strPath ); return 0; }
EX2
int GetOpenBox_ex2() { string strPath; strPath = GetOpenBox( FDLOG_ORIGIN ); // or //strPath = GetOpenBox( FDLOG_EXCEL, "C:\\Program Files\\" ); // or //strPath = GetOpenBox( FDLOG_ASCII, "C:\\Program Files\\", "Origin" ); // or //strPath = GetOpenBox( FDLOG_SCRIPT, "C:\\Program Files\\", "Origin", "OpenOGS" ); if( strPath.IsEmpty() ) out_str( "User has cancelled the Open dialog box." ); else printf( "The file chosen is %s\n.", strPath ); return 0; }
EX3
int GetOpenBox_ex3() { string strPath; strPath = GetOpenBox(); // or //strPath = GetOpenBox( "[Old version (*.ORG)] *.ORG" ); // or //strPath = GetOpenBox( "*.OPJ"); // or //strPath = GetOpenBox( "*.ocw Workspace", GetAppPath() + "OriginC\\" ); // or //strPath = GetOpenBox( "*.ocw Workspace", GetAppPath() + "OriginC\\", "Origin" ); // or //strPath = GetOpenBox( "*.ocw Workspace", "C:\\Program Files\\", "Origin", "Open Workspace" ); if( strPath.IsEmpty() ) out_str( "User has cancelled the Open dialog box." ); else printf( "The file chosen is %s\n.", strPath ); return 0; }
origin.h