| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
Audacity: A Digital Audio Editor |
| 4 |
|
| 5 |
FileDialog.h |
| 6 |
|
| 7 |
Leland Lucius |
| 8 |
|
| 9 |
*******************************************************************//** |
| 10 |
|
| 11 |
\class FileDialog |
| 12 |
\brief Dialog used to present platform specific "Save As" dialog with |
| 13 |
custom controls. |
| 14 |
|
| 15 |
*//*******************************************************************/ |
| 16 |
|
| 17 |
#ifndef _FILEDIALOG_H_ |
| 18 |
#define _FILEDIALOG_H_ |
| 19 |
|
| 20 |
#include <wx/filedlg.h> // to inherit |
| 21 |
|
| 22 |
class WX_WRAPPERS_API FileDialogBase : public wxFileDialogBase |
| 23 |
{ |
| 24 |
public: |
| 25 |
FileDialogBase(); |
| 26 |
virtual ~FileDialogBase() {}; |
| 27 |
|
| 28 |
// FileDialogBase |
| 29 |
|
| 30 |
typedef void (*UserPaneCreatorFunction)(wxWindow *parent, wxUIntPtr userdata); |
| 31 |
|
| 32 |
virtual bool HasUserPaneCreator() const; |
| 33 |
virtual void SetUserPaneCreator(UserPaneCreatorFunction creator, wxUIntPtr userdata); |
| 34 |
|
| 35 |
virtual void SetFileExtension(const wxString& extension) {}; |
| 36 |
|
| 37 |
protected: |
| 38 |
void CreateUserPane(wxWindow *parent); |
| 39 |
|
| 40 |
UserPaneCreatorFunction m_creator; |
| 41 |
wxUIntPtr m_userdata; |
| 42 |
}; |
| 43 |
|
| 44 |
#if defined(__WXGTK__) |
| 45 |
#include "gtk/FileDialogPrivate.h" |
| 46 |
#elif defined(__WXMAC__) |
| 47 |
#include "mac/FileDialogPrivate.h" |
| 48 |
#elif defined(__WXMSW__) |
| 49 |
#include "win/FileDialogPrivate.h" |
| 50 |
#else |
| 51 |
#error Unknown implementation |
| 52 |
#endif |
| 53 |
|
| 54 |
// |
| 55 |
// Copied from wx 3.0.2 and modified to support additional features |
| 56 |
// |
| 57 |
///////////////////////////////////////////////////////////////////////////// |
| 58 |
// Name: wx/filedlg.h |
| 59 |
// Purpose: wxFileDialog base header |
| 60 |
// Author: Robert Roebling |
| 61 |
// Modified by: Leland Lucius |
| 62 |
// Created: 8/17/99 |
| 63 |
// Copyright: (c) Robert Roebling |
| 64 |
// Licence: wxWindows licence |
| 65 |
///////////////////////////////////////////////////////////////////////////// |
| 66 |
|
| 67 |
//---------------------------------------------------------------------------- |
| 68 |
// FileDialog convenience functions |
| 69 |
//---------------------------------------------------------------------------- |
| 70 |
|
| 71 |
WX_WRAPPERS_API wxString |
| 72 |
FileSelector(const wxString& message = wxFileSelectorPromptStr, |
| 73 |
const wxString& default_path = wxEmptyString, |
| 74 |
const wxString& default_filename = wxEmptyString, |
| 75 |
const wxString& default_extension = wxEmptyString, |
| 76 |
const wxString& wildcard = wxFileSelectorDefaultWildcardStr, |
| 77 |
int flags = 0, |
| 78 |
wxWindow *parent = NULL, |
| 79 |
int x = wxDefaultCoord, int y = wxDefaultCoord); |
| 80 |
|
| 81 |
// An extended version of FileSelector |
| 82 |
WX_WRAPPERS_API wxString |
| 83 |
FileSelectorEx(const wxString& message = wxFileSelectorPromptStr, |
| 84 |
const wxString& default_path = wxEmptyString, |
| 85 |
const wxString& default_filename = wxEmptyString, |
| 86 |
int *indexDefaultExtension = NULL, |
| 87 |
const wxString& wildcard = wxFileSelectorDefaultWildcardStr, |
| 88 |
int flags = 0, |
| 89 |
wxWindow *parent = NULL, |
| 90 |
int x = wxDefaultCoord, int y = wxDefaultCoord); |
| 91 |
|
| 92 |
#endif |