Version: 2.9.4
Public Member Functions
wxFilePickerCtrl Class Reference

#include </home/zeitlin/src/wx/github/interface/wx/filepicker.h>

Inheritance diagram for wxFilePickerCtrl:

Detailed Description

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 file-chooser dialog. It is only available if wxUSE_FILEPICKERCTRL is set to 1 (the default).

Styles

This class supports the following styles:

Events emitted by this class

The following event handler macros redirect the events to member function handlers 'func' with prototypes like:

void handlerFuncName(wxFileDirPickerEvent& event)

Event macros for events emitted by this class:

Library:  wxCore
Category:  Picker Controls

Appearance:
wxMSW appearancewxGTK appearancewxMac appearance
wxMSW appearancewxGTK appearancewxMac appearance
参照:
wxFileDialog, wxFileDirPickerEvent

Public Member Functions

 wxFilePickerCtrl ()
 wxFilePickerCtrl (wxWindow *parent, wxWindowID id, const wxString &path=wxEmptyString, const wxString &message=wxFileSelectorPromptStr, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxFLP_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxFilePickerCtrlNameStr)
 Initializes the object and calls Create() with all the parameters.
bool Create (wxWindow *parent, wxWindowID id, const wxString &path=wxEmptyString, const wxString &message=wxFileSelectorPromptStr, const wxString &wildcard=wxFileSelectorDefaultWildcardStr, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxFLP_DEFAULT_STYLE, const wxValidator &validator=wxDefaultValidator, const wxString &name=wxFilePickerCtrlNameStr)
 Creates this widget with the given parameters.
wxFileName GetFileName () const
 Similar to GetPath() but returns the path of the currently selected file as a wxFileName object.
wxString GetPath () const
 Returns the absolute path of the currently selected file.
void SetFileName (const wxFileName &filename)
 This method does the same thing as SetPath() but takes a wxFileName object instead of a string.
void SetInitialDirectory (const wxString &dir)
 Set the directory to show when starting to browse for files.
void SetPath (const wxString &filename)
 Sets the absolute path of the currently selected file.

List of all members.


Constructor & Destructor Documentation

wxFilePickerCtrl::wxFilePickerCtrl ( )
wxFilePickerCtrl::wxFilePickerCtrl ( wxWindow parent,
wxWindowID  id,
const wxString path = wxEmptyString,
const wxString message = wxFileSelectorPromptStr,
const wxString wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxFLP_DEFAULT_STYLE,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxFilePickerCtrlNameStr 
)

Initializes the object and calls Create() with all the parameters.


Member Function Documentation

bool wxFilePickerCtrl::Create ( wxWindow parent,
wxWindowID  id,
const wxString path = wxEmptyString,
const wxString message = wxFileSelectorPromptStr,
const wxString wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint pos = wxDefaultPosition,
const wxSize size = wxDefaultSize,
long  style = wxFLP_DEFAULT_STYLE,
const wxValidator validator = wxDefaultValidator,
const wxString name = wxFilePickerCtrlNameStr 
)

Creates this widget with the given parameters.

Parameters:
parentParent window, must not be non-NULL.
idThe identifier for the control.
pathThe initial file shown in the control. Must be a valid path to a file or the empty string.
messageThe message shown to the user in the wxFileDialog shown by the control.
wildcardA wildcard which defines user-selectable files (use the same syntax as for wxFileDialog's wildcards).
posInitial position.
sizeInitial size.
styleThe window style, see wxFLP_* flags.
validatorValidator which can be used for additional data checks.
nameControl name.
Returns:
true if the control was successfully created or false if creation failed.
wxFileName wxFilePickerCtrl::GetFileName ( ) const

Similar to GetPath() but returns the path of the currently selected file as a wxFileName object.

wxString wxFilePickerCtrl::GetPath ( ) const

Returns the absolute path of the currently selected file.

void wxFilePickerCtrl::SetFileName ( const wxFileName filename)

This method does the same thing as SetPath() but takes a wxFileName object instead of a string.

void wxFilePickerCtrl::SetInitialDirectory ( const wxString dir)

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 wxFilePickerCtrl::SetPath ( const wxString filename)

Sets the absolute path of the currently selected file.

This must be a valid file if the wxFLP_FILE_MUST_EXIST style was given.

 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines