1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %% Purpose: wxDirPickerCtrl documentation
4 %% Author: Francesco Montorsi
7 %% Copyright: (c) 2006 Francesco Montorsi
8 %% License: wxWindows license
9 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11 \section{\class{wxDirPickerCtrl
}}\label{wxdirpickerctrl
}
13 This control allows the user to select a directory. The generic implementation is
14 a button which brings up a
\helpref{wxDirDialog
}{wxdirdialog
} when clicked. Native implementation
15 may differ but this is usually a (small) widget which give access to the dir-chooser
17 It is only available if
\texttt{wxUSE
\_DIRPICKERCTRL} is set to $
1$ (the default).
19 \wxheading{Derived from
}
21 \helpref{wxPickerBase
}{wxpickerbase
}\\
22 \helpref{wxControl
}{wxcontrol
}\\
23 \helpref{wxWindow
}{wxwindow
}\\
24 \helpref{wxEvtHandler
}{wxevthandler
}\\
25 \helpref{wxObject
}{wxobject
}
27 \wxheading{Include files
}
31 \wxheading{Window styles
}
34 \begin{twocollist
}\itemsep=
0pt
35 \twocolitem{\windowstyle{wxDIRP
\_DEFAULT\_STYLE}}{Default style.
}
36 \twocolitem{\windowstyle{wxDIRP
\_USE\_TEXTCTRL}}{Creates a text control to the left of the
37 picker button which is completely managed by the
\helpref{wxDirPickerCtrl
}{wxdirpickerctrl
}
38 and which can be used by the user to specify a path (see
\helpref{SetPath
}{wxdirpickerctrlsetpath
}).
39 The text control is automatically synchronized with button's value. Use functions defined in
\helpref{wxPickerBase
}{wxpickerbase
} to modify the text control.
}
41 \twocolitem{\windowstyle{wxDIRP
\_DIR\_MUST\_EXIST}}{Creates a picker which allows to select only existing directories. wxGTK control always adds this flag internally as it does not support its absence.
}
42 \twocolitem{\windowstyle{wxDIRP
\_CHANGE\_DIR}}{Change current working directory on each user directory selection change.
}
46 \wxheading{Event handling
}
49 \begin{twocollist
}\itemsep=
0pt
50 \twocolitem{{\bf 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).
}
55 \helpref{wxDirDialog
}{wxdirdialog
},\\
56 \helpref{wxFileDirPickerEvent
}{wxfiledirpickerevent
}
59 \latexignore{\rtfignore{\wxheading{Members
}}}
61 \membersection{wxDirPickerCtrl::wxDirPickerCtrl
}\label{wxdirpickerctrl
}
63 \func{}{wxdirpickerctrl
}{\param{wxWindow *
}{parent
},
\rtfsp
64 \param{wxWindowID
}{ id
},
\rtfsp
65 \param{const wxString\&
}{path = wxEmptyString
},
\rtfsp
66 \param{const wxString\&
}{message = ``Select a folder"
},
\rtfsp
67 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
68 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
69 \param{long
}{ style = wxDIRP
\_DEFAULT\_STYLE},
\rtfsp
70 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
71 \param{const wxString\&
}{name = ``dirpickerctrl"
}}
73 Initializes the object and calls
\helpref{Create
}{wxdirpickerctrlcreate
} with
77 \membersection{wxDirPickerCtrl::Create
}\label{wxdirpickerctrlcreate
}
79 \func{bool
}{Create
}{\param{wxWindow *
}{parent
},
\rtfsp
80 \param{wxWindowID
}{ id
},
\rtfsp
81 \param{const wxString\&
}{path = wxEmptyString
},
\rtfsp
82 \param{const wxString\&
}{message = ``Select a folder"
},
\rtfsp
83 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
84 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
85 \param{long
}{ style = wxDIRP
\_DEFAULT\_STYLE},
\rtfsp
86 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
87 \param{const wxString\&
}{name = ``dirpickerctrl"
}}
89 \wxheading{Parameters
}
91 \docparam{parent
}{Parent window, must not be non-
\texttt{NULL
}.
}
93 \docparam{id
}{The identifier for the control.
}
95 \docparam{path
}{The initial directory shown in the control. Must be a valid path to a directory or the empty string.
}
97 \docparam{message
}{The message shown to the user in the
\helpref{wxFileDialog
}{wxfiledialog
} shown by the control.
}
99 \docparam{pos
}{Initial position.
}
101 \docparam{size
}{Initial size.
}
103 \docparam{style
}{The window style, see wxDIRP
\_* flags.
}
105 \docparam{validator
}{Validator which can be used for additional date checks.
}
107 \docparam{name
}{Control name.
}
109 \wxheading{Return value
}
111 \true if the control was successfully created or
\false if creation failed.
114 \membersection{wxDirPickerCtrl::GetPath
}\label{wxdirpickerctrlgetpath
}
116 \constfunc{wxString
}{GetPath
}{\void}
118 Returns the currently selected directory.
121 \membersection{wxDirPickerCtrl::SetPath
}\label{wxdirpickerctrlsetpath
}
123 \func{void
}{SetPath
}{\param{const wxString \&
}{dirname
}}
125 Sets the currently selected directory. This must be a valid directory.