Search documentation of wx

# View Source wxFilePickerCtrl (wx v2.4.2)

Functions for wxFilePickerCtrl class

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:

See: `wxFileDialog`, `wxFileDirPickerEvent`

This class is derived (and can use functions) from: `wxPickerBase` `wxControl` `wxWindow` `wxEvtHandler`

wxWidgets docs: wxFilePickerCtrl

## Events

Event types emitted from this class: `command_filepicker_changed`

# Summary

## Types

wxFilePickerCtrl()

## Functions

create(This, Parent, Id)
create/4

Creates this widget with the given parameters.

destroy(This)

Destroys the object.

getPath(This)

Returns the absolute path of the currently selected file.

new()
new(Parent, Id)
new/3

Initializes the object and calls `create/4` with all the parameters.

setPath(This, Filename)

Sets the absolute path of the currently selected file.

# Types

Link to this type

# wxFilePickerCtrl()

View Source

    -type wxFilePickerCtrl() :: wx:wx_object().

# Functions

Link to this function

# create(This, Parent, Id)

View Source

    -spec create(This, Parent, Id) -> boolean()
                    when This :: wxFilePickerCtrl(), Parent :: wxWindow:wxWindow(), Id :: integer().

Link to this function

# create/4

View Source

    -spec create(This, Parent, Id, [Option]) -> boolean()
                    when
                        This :: wxFilePickerCtrl(),
                        Parent :: wxWindow:wxWindow(),
                        Id :: integer(),
                        Option ::
                            {path, unicode:chardata()} |
                            {message, unicode:chardata()} |
                            {wildcard, unicode:chardata()} |
                            {pos, {X :: integer(), Y :: integer()}} |
                            {size, {W :: integer(), H :: integer()}} |
                            {style, integer()} |
                            {validator, wx:wx_object()}.

Creates this widget with the given parameters.

Return: true if the control was successfully created or false if creation failed.

Link to this function

# destroy(This)

View Source

    -spec destroy(This :: wxFilePickerCtrl()) -> ok.

Destroys the object.

Link to this function

# getPath(This)

View Source

    -spec getPath(This) -> unicode:charlist() when This :: wxFilePickerCtrl().

Returns the absolute path of the currently selected file.

Link to this function

# new()

View Source

    -spec new() -> wxFilePickerCtrl().

Link to this function

# new(Parent, Id)

View Source

    -spec new(Parent, Id) -> wxFilePickerCtrl() when Parent :: wxWindow:wxWindow(), Id :: integer().

Link to this function

# new/3

View Source

    -spec new(Parent, Id, [Option]) -> wxFilePickerCtrl()
                 when
                     Parent :: wxWindow:wxWindow(),
                     Id :: integer(),
                     Option ::
                         {path, unicode:chardata()} |
                         {message, unicode:chardata()} |
                         {wildcard, unicode:chardata()} |
                         {pos, {X :: integer(), Y :: integer()}} |
                         {size, {W :: integer(), H :: integer()}} |
                         {style, integer()} |
                         {validator, wx:wx_object()}.

Initializes the object and calls `create/4` with all the parameters.

Link to this function

# setPath(This, Filename)

View Source

    -spec setPath(This, Filename) -> ok when This :: wxFilePickerCtrl(), Filename :: unicode:chardata().

Sets the absolute path of the currently selected file.

If the control uses `wxFLP_FILE_MUST_EXIST` and does not use `wxFLP_USE_TEXTCTRL` style, the `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).