2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: filepicker.h
|
2008-03-10 15:24:38 +00:00
|
|
|
// Purpose: interface of wxFilePickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
// Author: wxWidgets team
|
2010-07-13 13:29:13 +00:00
|
|
|
// Licence: wxWindows licence
|
2008-03-08 13:52:38 +00:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2012-04-12 05:33:29 +00:00
|
|
|
#define wxFLP_OPEN 0x0400
|
|
|
|
#define wxFLP_SAVE 0x0800
|
|
|
|
#define wxFLP_OVERWRITE_PROMPT 0x1000
|
|
|
|
#define wxFLP_FILE_MUST_EXIST 0x2000
|
|
|
|
#define wxFLP_CHANGE_DIR 0x4000
|
|
|
|
#define wxFLP_SMALL wxPB_SMALL
|
|
|
|
#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
|
|
|
|
#define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST)
|
|
|
|
|
|
|
|
#define wxDIRP_DIR_MUST_EXIST 0x0008
|
|
|
|
#define wxDIRP_CHANGE_DIR 0x0010
|
|
|
|
#define wxDIRP_SMALL wxPB_SMALL
|
|
|
|
#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
|
|
|
|
#define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST)
|
|
|
|
|
2013-04-25 10:11:03 +00:00
|
|
|
wxEventType wxEVT_FILEPICKER_CHANGED;
|
|
|
|
wxEventType wxEVT_DIRPICKER_CHANGED;
|
2012-04-12 05:33:29 +00:00
|
|
|
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxFilePickerCtrl
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This control allows the user to select a file. The generic implementation is
|
|
|
|
a button which brings up a wxFileDialog when clicked. Native implementation
|
|
|
|
may differ but this is usually a (small) widget which give access to the
|
2008-09-25 19:15:28 +00:00
|
|
|
file-chooser dialog.
|
2008-03-08 13:52:38 +00:00
|
|
|
It is only available if @c wxUSE_FILEPICKERCTRL is set to 1 (the default).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_DEFAULT_STYLE}
|
2008-03-08 13:52:38 +00:00
|
|
|
The default style: includes wxFLP_OPEN | wxFLP_FILE_MUST_EXIST and,
|
2016-03-04 13:53:30 +00:00
|
|
|
under wxMSW and wxOSX, wxFLP_USE_TEXTCTRL.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_USE_TEXTCTRL}
|
2008-03-08 13:52:38 +00:00
|
|
|
Creates a text control to the left of the picker button which is
|
|
|
|
completely managed by the wxFilePickerCtrl and which can be used by
|
|
|
|
the user to specify a path (see SetPath). The text control is
|
|
|
|
automatically synchronized with button's value. Use functions
|
|
|
|
defined in wxPickerBase to modify the text control.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_OPEN}
|
2008-03-08 13:52:38 +00:00
|
|
|
Creates a picker which allows the user to select a file to open.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_SAVE}
|
2008-03-08 13:52:38 +00:00
|
|
|
Creates a picker which allows the user to select a file to save.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_OVERWRITE_PROMPT}
|
2008-03-08 13:52:38 +00:00
|
|
|
Can be combined with wxFLP_SAVE only: ask confirmation to the user
|
|
|
|
before selecting a file.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_FILE_MUST_EXIST}
|
2016-06-09 15:03:51 +00:00
|
|
|
Can be combined with wxFLP_OPEN only: the file selected in the popup
|
|
|
|
wxFileDialog must be an existing file. Notice that it still remains
|
|
|
|
possible for the user to enter a non-existent file name in the text
|
|
|
|
control if @c wxFLP_USE_TEXTCTRL is also used, this flag is a hint
|
|
|
|
for the user rather than a guarantee that the selected file does
|
|
|
|
exist for the program.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxFLP_CHANGE_DIR}
|
2008-03-08 13:52:38 +00:00
|
|
|
Change current working directory on each user file selection change.
|
2011-08-27 14:11:25 +00:00
|
|
|
@style{wxFLP_SMALL}
|
|
|
|
Use smaller version of the control with a small "..." button instead
|
|
|
|
of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.
|
2008-03-08 13:52:38 +00:00
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-09-25 19:15:28 +00:00
|
|
|
|
2009-02-18 17:58:51 +00:00
|
|
|
@beginEventEmissionTable{wxFileDirPickerEvent}
|
2008-09-25 19:15:28 +00:00
|
|
|
@event{EVT_FILEPICKER_CHANGED(id, func)}
|
|
|
|
The user changed the file selected in the control either using the
|
|
|
|
button or using text control (see wxFLP_USE_TEXTCTRL; note that in
|
|
|
|
this case the event is fired only if the user's input is valid,
|
|
|
|
e.g. an existing file path if wxFLP_FILE_MUST_EXIST was given).
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
2008-04-08 05:34:11 +00:00
|
|
|
@category{pickers}
|
2012-11-03 18:32:50 +00:00
|
|
|
@appearance{filepickerctrl}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxFileDialog, wxFileDirPickerEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxFilePickerCtrl : public wxPickerBase
|
|
|
|
{
|
|
|
|
public:
|
2012-04-12 05:33:29 +00:00
|
|
|
wxFilePickerCtrl();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Initializes the object and calls Create() with
|
|
|
|
all the parameters.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxFilePickerCtrl(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxString& path = wxEmptyString,
|
2008-11-09 16:46:52 +00:00
|
|
|
const wxString& message = wxFileSelectorPromptStr,
|
|
|
|
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxFLP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2008-11-09 16:46:52 +00:00
|
|
|
const wxString& name = wxFilePickerCtrlNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Creates this widget with the given parameters.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window, must not be non-@NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The identifier for the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param path
|
2008-03-09 12:33:59 +00:00
|
|
|
The initial file shown in the control. Must be a valid path to a file or
|
2008-09-25 19:15:28 +00:00
|
|
|
the empty string.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param message
|
2008-03-09 12:33:59 +00:00
|
|
|
The message shown to the user in the wxFileDialog shown by the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param wildcard
|
2008-03-09 12:33:59 +00:00
|
|
|
A wildcard which defines user-selectable files (use the same syntax as for
|
2008-09-25 19:15:28 +00:00
|
|
|
wxFileDialog's wildcards).
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial position.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial size.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The window style, see wxFLP_* flags.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-10-04 14:52:38 +00:00
|
|
|
Validator which can be used for additional data checks.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Control name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return @true if the control was successfully created or @false if
|
2008-09-25 19:15:28 +00:00
|
|
|
creation failed.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxString& path = wxEmptyString,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& message = wxFileSelectorPromptStr,
|
|
|
|
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxFLP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& name = wxFilePickerCtrlNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Similar to GetPath() but returns the path of the currently selected
|
|
|
|
file as a wxFileName object.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxFileName GetFileName() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the absolute path of the currently selected file.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetPath() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
This method does the same thing as SetPath() but takes a wxFileName
|
|
|
|
object instead of a string.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetFileName(const wxFileName& filename);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2011-12-18 12:34:47 +00:00
|
|
|
/**
|
|
|
|
Set the directory to show when starting to browse for files.
|
|
|
|
|
|
|
|
This function is mostly useful for the file picker controls which have
|
|
|
|
no selection initially to configure the directory that should be shown
|
|
|
|
if the user starts browsing for files as otherwise the directory of
|
|
|
|
initially selected file is used, which is usually the desired
|
|
|
|
behaviour and so the directory specified by this function is ignored in
|
|
|
|
this case.
|
|
|
|
|
|
|
|
@since 2.9.4
|
|
|
|
*/
|
|
|
|
void SetInitialDirectory(const wxString& dir);
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Sets the absolute path of the currently selected file.
|
2016-06-09 15:03:51 +00:00
|
|
|
|
|
|
|
If the control uses @c wxFLP_FILE_MUST_EXIST and does not use
|
|
|
|
@c wxFLP_USE_TEXTCTRL style, the @a filename must be a name of an
|
|
|
|
existing file and will be simply ignored by the native wxGTK
|
|
|
|
implementation if this is not the case (the generic implementation used
|
|
|
|
under the other platforms accepts even invalid file names currently,
|
|
|
|
but this is subject to change in the future, don't rely on being able
|
|
|
|
to use non-existent paths with it).
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetPath(const wxString& filename);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxDirPickerCtrl
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This control allows the user to select a directory. The generic implementation
|
2008-09-25 19:15:28 +00:00
|
|
|
is a button which brings up a wxDirDialog when clicked. Native implementation
|
2008-03-08 13:52:38 +00:00
|
|
|
may differ but this is usually a (small) widget which give access to the
|
2008-09-25 19:15:28 +00:00
|
|
|
dir-chooser dialog.
|
2008-03-08 13:52:38 +00:00
|
|
|
It is only available if @c wxUSE_DIRPICKERCTRL is set to 1 (the default).
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@beginStyleTable
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxDIRP_DEFAULT_STYLE}
|
2008-03-08 13:52:38 +00:00
|
|
|
The default style: includes wxDIRP_DIR_MUST_EXIST and, under wxMSW
|
|
|
|
only, wxDIRP_USE_TEXTCTRL.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxDIRP_USE_TEXTCTRL}
|
2008-03-08 13:52:38 +00:00
|
|
|
Creates a text control to the left of the picker button which is
|
|
|
|
completely managed by the wxDirPickerCtrl and which can be used by
|
|
|
|
the user to specify a path (see SetPath). The text control is
|
|
|
|
automatically synchronized with button's value. Use functions
|
|
|
|
defined in wxPickerBase to modify the text control.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxDIRP_DIR_MUST_EXIST}
|
2016-06-09 15:03:51 +00:00
|
|
|
Creates a picker which allows to select only existing directories in
|
|
|
|
the popup wxDirDialog. Notice that, as with @c wxFLP_FILE_MUST_EXIST,
|
|
|
|
it is still possible to enter a non-existent directory even when
|
|
|
|
this file is specified if @c wxDIRP_USE_TEXTCTRL style is also used.
|
|
|
|
Also note that if @c wxDIRP_USE_TEXTCTRL is not used, the native
|
|
|
|
wxGTK implementation always uses this style as it doesn't support
|
|
|
|
selecting non-existent directories.
|
2008-04-06 14:43:04 +00:00
|
|
|
@style{wxDIRP_CHANGE_DIR}
|
2008-09-25 19:15:28 +00:00
|
|
|
Change current working directory on each user directory selection change.
|
2011-08-27 14:11:25 +00:00
|
|
|
@style{wxDIRP_SMALL}
|
|
|
|
Use smaller version of the control with a small "..." button instead
|
|
|
|
of the normal "Browse" one. This flag is new since wxWidgets 2.9.3.
|
2008-03-08 13:52:38 +00:00
|
|
|
@endStyleTable
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2009-02-18 17:58:51 +00:00
|
|
|
@beginEventEmissionTable{wxFileDirPickerEvent}
|
2008-09-25 19:15:28 +00:00
|
|
|
@event{EVT_DIRPICKER_CHANGED(id, func)}
|
|
|
|
The user changed the directory selected in the control either using the
|
|
|
|
button or using text control (see wxDIRP_USE_TEXTCTRL; note that in this
|
|
|
|
case the event is fired only if the user's input is valid, e.g. an
|
|
|
|
existing directory path).
|
|
|
|
@endEventTable
|
|
|
|
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
2008-04-08 05:34:11 +00:00
|
|
|
@category{pickers}
|
2012-11-03 18:32:50 +00:00
|
|
|
@appearance{dirpickerctrl}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
@see wxDirDialog, wxFileDirPickerEvent
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxDirPickerCtrl : public wxPickerBase
|
|
|
|
{
|
|
|
|
public:
|
2012-04-12 05:33:29 +00:00
|
|
|
wxDirPickerCtrl();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
Initializes the object and calls Create() with
|
|
|
|
all the parameters.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxDirPickerCtrl(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxString& path = wxEmptyString,
|
2008-11-08 15:17:16 +00:00
|
|
|
const wxString& message = wxDirSelectorPromptStr,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDIRP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2008-11-08 15:17:16 +00:00
|
|
|
const wxString& name = wxDirPickerCtrlNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Creates the widgets with the given parameters.
|
|
|
|
|
2008-03-08 14:43:31 +00:00
|
|
|
@param parent
|
2008-03-09 12:33:59 +00:00
|
|
|
Parent window, must not be non-@NULL.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param id
|
2008-03-09 12:33:59 +00:00
|
|
|
The identifier for the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param path
|
2008-03-09 12:33:59 +00:00
|
|
|
The initial directory shown in the control. Must be a valid path to a
|
2008-09-25 19:15:28 +00:00
|
|
|
directory or the empty string.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param message
|
2008-03-09 12:33:59 +00:00
|
|
|
The message shown to the user in the wxDirDialog shown by the control.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param pos
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial position.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param size
|
2008-03-09 12:33:59 +00:00
|
|
|
Initial size.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param style
|
2008-03-09 12:33:59 +00:00
|
|
|
The window style, see wxDIRP_* flags.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param validator
|
2008-03-09 12:33:59 +00:00
|
|
|
Validator which can be used for additional date checks.
|
2008-03-08 14:43:31 +00:00
|
|
|
@param name
|
2008-03-09 12:33:59 +00:00
|
|
|
Control name.
|
2008-03-20 13:45:17 +00:00
|
|
|
|
2008-05-11 01:38:53 +00:00
|
|
|
@return @true if the control was successfully created or @false if
|
2008-09-25 19:15:28 +00:00
|
|
|
creation failed.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
bool Create(wxWindow* parent, wxWindowID id,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxString& path = wxEmptyString,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& message = wxDirSelectorPromptStr,
|
2008-03-08 13:52:38 +00:00
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDIRP_DEFAULT_STYLE,
|
|
|
|
const wxValidator& validator = wxDefaultValidator,
|
2008-10-28 15:36:26 +00:00
|
|
|
const wxString& name = wxDirPickerCtrlNameStr);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Returns the absolute path of the currently selected directory as a
|
|
|
|
wxFileName object.
|
|
|
|
This function is equivalent to GetPath().
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxFileName GetDirName() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Returns the absolute path of the currently selected directory.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetPath() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
2008-09-25 19:15:28 +00:00
|
|
|
Just like SetPath() but this function takes a wxFileName object.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetDirName(const wxFileName& dirname);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
2011-12-18 12:34:47 +00:00
|
|
|
/**
|
|
|
|
Set the directory to show when starting to browse for directories.
|
|
|
|
|
|
|
|
This function is mostly useful for the directory picker controls which
|
|
|
|
have no selection initially to configure the directory that should be
|
|
|
|
shown if the user starts browsing for directories as otherwise the
|
|
|
|
initially selected directory is used, which is usually the desired
|
|
|
|
behaviour and so the directory specified by this function is ignored in
|
|
|
|
this case.
|
|
|
|
|
|
|
|
@since 2.9.4
|
|
|
|
*/
|
|
|
|
void SetInitialDirectory(const wxString& dir);
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
2016-06-09 15:03:51 +00:00
|
|
|
Sets the absolute path of the currently selected directory.
|
|
|
|
|
|
|
|
If the control uses @c wxDIRP_DIR_MUST_EXIST and does not use
|
|
|
|
@c wxDIRP_USE_TEXTCTRL style, the @a dirname must be a name of an
|
|
|
|
existing directory and will be simply ignored by the native wxGTK
|
|
|
|
implementation if this is not the case.
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetPath(const wxString& dirname);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2008-03-10 15:24:38 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
@class wxFileDirPickerEvent
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
This event class is used for the events generated by
|
|
|
|
wxFilePickerCtrl and by wxDirPickerCtrl.
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-09-25 20:00:31 +00:00
|
|
|
@beginEventTable{wxFileDirPickerEvent}
|
|
|
|
@event{EVT_FILEPICKER_CHANGED(id, func)}
|
|
|
|
Generated whenever the selected file changes.
|
|
|
|
@event{EVT_DIRPICKER_CHANGED(id, func)}
|
|
|
|
Generated whenever the selected directory changes.
|
|
|
|
@endEventTable
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
@library{wxcore}
|
2008-09-25 19:15:28 +00:00
|
|
|
@category{events}
|
2008-03-08 14:43:31 +00:00
|
|
|
|
2008-09-25 19:15:28 +00:00
|
|
|
@see wxFilePickerCtrl, wxDirPickerCtrl
|
2008-03-08 13:52:38 +00:00
|
|
|
*/
|
|
|
|
class wxFileDirPickerEvent : public wxCommandEvent
|
|
|
|
{
|
|
|
|
public:
|
2012-04-12 05:33:29 +00:00
|
|
|
wxFileDirPickerEvent();
|
|
|
|
|
2008-03-08 13:52:38 +00:00
|
|
|
/**
|
|
|
|
The constructor is not normally used by the user code.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
wxFileDirPickerEvent(wxEventType type, wxObject* generator,
|
2008-03-08 13:52:38 +00:00
|
|
|
int id,
|
2008-11-09 16:46:52 +00:00
|
|
|
const wxString& path);
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Retrieve the absolute path of the file/directory the user has just selected.
|
|
|
|
*/
|
2008-03-09 16:24:26 +00:00
|
|
|
wxString GetPath() const;
|
2008-03-08 13:52:38 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
Set the absolute path of the file/directory associated with the event.
|
|
|
|
*/
|
2008-03-09 12:33:59 +00:00
|
|
|
void SetPath(const wxString& path);
|
2008-03-08 13:52:38 +00:00
|
|
|
};
|
2008-03-10 15:24:38 +00:00
|
|
|
|