24#ifndef _SO_XTFILESELECTIONDIALOG_
25#define _SO_XTFILESELECTIONDIALOG_
31#if defined(_WIN32) && !defined(SOQT)
32class SoWinFileSelectionDialog;
33#define SoXtFileSelectionDialog SoWinFileSelectionDialog
34#define SoXtFileSelectionDialogCB SoWinFileSelectionDialogCB
35typedef void SoWinFileSelectionDialogCB(
void *data, SoWinFileSelectionDialog *dialog);
36#elif defined(__APPLE__) || defined(SOQT)
37class SoQtFileSelectionDialog;
38#define SoXtFileSelectionDialog SoQtFileSelectionDialog
39#define SoXtFileSelectionDialogCB SoQtFileSelectionDialogCB
40typedef void SoQtFileSelectionDialogCB(
void *data, SoQtFileSelectionDialog *dialog);
47#define charset XmSTRING_DEFAULT_CHARSET
173 void buildFilePath(
void);
174 void updateFileDirectory(
void);
176 char *m_filterSuffix;
178 char *m_fileDirectory;
180 char m_fullFilePath[1000];
186 void setFilePath(
char *fPath);
189#if !defined(_WIN32) && !defined(SOQT)
195 static void OK_Button (
SoWidget fs,
XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs);
196 static void Cancel_Button (
SoWidget fs,
XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs);
void SoXtFileSelectionDialogCB(void *data, SoXtFileSelectionDialog *dialog)
Cross-platform file selection box.
void setFilter(char *suffix, char *title)
Sets the suffix filter and the filter title.
void setTitle(char *title)
Sets the file selection dialog box title.
char * getFileName(void)
Gets the file name.
~SoXtFileSelectionDialog()
Destructor.
void setAcceptCallback(SoXtFileSelectionDialogCB *f, void *data)
Set the callback associated with the OK button.
void setFileName(char *fName)
Sets the file name.
char * getFilePath(void)
Retrieves the full file path.
void setFileDirectory(char *directory)
Sets the file directory.
void show()
Shows the file selection box dialog.
SbVec2s getSize(void)
Gets the dialog box size (UNIX only).
Dialog_Mode getMode(void)
Gets the mode (Open or Close) of the file selection box.
void setMode(Dialog_Mode dMode)
Sets the mode (Open or Close) of the file selection box.
SoXtFileSelectionDialog()
Constructor.
char * getTitle(void)
Gets the file selection dialog box title.
void setAbortCallback(SoXtFileSelectionDialogCB *f, void *data)
Set the callback associated with the Cancel button.
char * getFileDirectory()
Gets the file directory.
void setSize(const SbVec2s &size)
Sets the dialog box size (UNIX only).
Dialog_Mode
Enum to set the dialog box mode (Open file / Save file).
@ SAVE_FILE
Save file mode.
@ OPEN_FILE
Open file mode.
void getFilter(char **suffix, char **title)
Gets the suffix filter and the filter title.
void keepDialog(SbBool)
Sets the persistency property, if TRUE, the dialog box will not be deleted after buttons are pressed.