wxFilePickerCtrl Class Reference
[Picker Controls]

#include <wx/filepicker.h>

Inheritance diagram for wxFilePickerCtrl:
Inheritance graph
[legend]

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
See also:
wxFileDialog, wxFileDirPickerEvent

Public Member Functions

 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 SetPath (const wxString &filename)
 Sets the absolute path of the currently selected file.

List of all members.


Constructor & Destructor Documentation

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:
parent Parent window, must not be non-NULL.
id The identifier for the control.
path The initial file shown in the control. Must be a valid path to a file or the empty string.
message The message shown to the user in the wxFileDialog shown by the control.
wildcard A wildcard which defines user-selectable files (use the same syntax as for wxFileDialog's wildcards).
pos Initial position.
size Initial size.
style The window style, see wxFLP_* flags.
validator Validator which can be used for additional data checks.
name Control 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::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



wxWidgets logo

[ top ]