24#ifndef _SO_XTFILESELECTIONDIALOG_
25#define _SO_XTFILESELECTIONDIALOG_
27#include <Inventor/SbLinear.h>
28#include <Inventor/SbBasic.h>
29#include <Inventor/Xt/SoXtDef.h>
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);
48#define charset XmSTRING_DEFAULT_CHARSET
174 void buildFilePath(
void);
175 void updateFileDirectory(
void);
177 char *m_filterSuffix;
179 char *m_fileDirectory;
181 char m_fullFilePath[1000];
187 void setFilePath(
char *fPath);
190#if !defined(_WIN32) && !defined(SOQT)
194 SoWidget m_fileSelectionDialog;
195 SoWidget m_SoXtFileSelectionDialog;
196 static void OK_Button (SoWidget fs,
XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs);
197 static void Cancel_Button (SoWidget fs,
XtPointer client_data, XmFileSelectionBoxCallbackStruct *cbs);
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 SoXtFileSelectionDialogCB(void *data, SoXtFileSelectionDialog *dialog)
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.