]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/dirpicker.tex
silence gcc warnings about values not handled in switch
[wxWidgets.git] / docs / latex / wx / dirpicker.tex
CommitLineData
ec376c8f
VZ
1%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2%% Name: dirpicker.tex
3%% Purpose: wxDirPickerCtrl documentation
4%% Author: Francesco Montorsi
5%% Created: 2006-05-12
6%% RCS-ID: $Id$
7%% Copyright: (c) 2006 Francesco Montorsi
8%% License: wxWindows license
9%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
10
11\section{\class{wxDirPickerCtrl}}\label{wxdirpickerctrl}
12
13This control allows the user to select a directory. The generic implementation is
14a button which brings up a \helpref{wxDirDialog}{wxdirdialog} when clicked. Native implementation
15may differ but this is usually a (small) widget which give access to the dir-chooser
16dialog.
17It is only available if \texttt{wxUSE\_DIRPICKERCTRL} is set to $1$ (the default).
18
19\wxheading{Derived from}
20
21\helpref{wxPickerBase}{wxpickerbase}\\
22\helpref{wxControl}{wxcontrol}\\
23\helpref{wxWindow}{wxwindow}\\
24\helpref{wxEvtHandler}{wxevthandler}\\
25\helpref{wxObject}{wxobject}
26
27\wxheading{Include files}
28
29<wx/filepicker.h>
30
31\wxheading{Window styles}
32
33\twocolwidtha{5cm}%
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
37picker button which is completely managed by the \helpref{wxDirPickerCtrl}{wxdirpickerctrl}
38and which can be used by the user to specify a path (see \helpref{SetPath}{wxdirpickerctrlsetpath}).
39The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
40
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.}
43
44\end{twocollist}
45
46\wxheading{Event handling}
47
48\twocolwidtha{7cm}%
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).}
51\end{twocollist}
52
53\wxheading{See also}
54
55\helpref{wxDirDialog}{wxdirdialog},\\
56\helpref{wxFileDirPickerEvent}{wxfiledirpickerevent}
57
58
59\latexignore{\rtfignore{\wxheading{Members}}}
60
61\membersection{wxDirPickerCtrl::wxDirPickerCtrl}\label{wxdirpickerctrl}
62
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"}}
72
73Initializes the object and calls \helpref{Create}{wxdirpickerctrlcreate} with
74all the parameters.
75
76
77\membersection{wxDirPickerCtrl::Create}\label{wxdirpickerctrlcreate}
78
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"}}
88
89\wxheading{Parameters}
90
91\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
92
93\docparam{id}{The identifier for the control.}
94
95\docparam{path}{The initial directory shown in the control. Must be a valid path to a directory or the empty string.}
96
97\docparam{message}{The message shown to the user in the \helpref{wxFileDialog}{wxfiledialog} shown by the control.}
98
99\docparam{pos}{Initial position.}
100
101\docparam{size}{Initial size.}
102
103\docparam{style}{The window style, see wxDIRP\_* flags.}
104
105\docparam{validator}{Validator which can be used for additional date checks.}
106
107\docparam{name}{Control name.}
108
109\wxheading{Return value}
110
111\true if the control was successfully created or \false if creation failed.
112
113
114\membersection{wxDirPickerCtrl::GetPath}\label{wxdirpickerctrlgetpath}
115
116\constfunc{wxString}{GetPath}{\void}
117
118Returns the currently selected directory.
119
120
121\membersection{wxDirPickerCtrl::SetPath}\label{wxdirpickerctrlsetpath}
122
123\func{void}{SetPath}{\param{const wxString \&}{dirname}}
124
125Sets the currently selected directory. This must be a valid directory.
126
127