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}}{The default style: includes
36 wxDIRP
\_DIR\_MUST\_EXIST and, under wxMSW only, wxDIRP
\_USE\_TEXTCTRL.
}
37 \twocolitem{\windowstyle{wxDIRP
\_USE\_TEXTCTRL}}{Creates a text control to the left of the
38 picker button which is completely managed by the
\helpref{wxDirPickerCtrl
}{wxdirpickerctrl
}
39 and which can be used by the user to specify a path (see
\helpref{SetPath
}{wxdirpickerctrlsetpath
}).
40 The text control is automatically synchronized with button's value. Use functions defined in
\helpref{wxPickerBase
}{wxpickerbase
} to modify the text control.
}
42 \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.
}
43 \twocolitem{\windowstyle{wxDIRP
\_CHANGE\_DIR}}{Change current working directory on each user directory selection change.
}
47 \wxheading{Event handling
}
50 \begin{twocollist
}\itemsep=
0pt
51 \twocolitem{{\bf EVT
\_DIRPICKER\_CHANGED(id, func)
}}{The user changed the
52 directory selected in the control either using the button or using text control
53 (see wxDIRP
\_USE\_TEXTCTRL; note that in this case the event is fired only if
54 the user's input is valid, e.g. an existing directory path).
}
59 \helpref{wxDirDialog
}{wxdirdialog
},\\
60 \helpref{wxFileDirPickerEvent
}{wxfiledirpickerevent
}
63 \latexignore{\rtfignore{\wxheading{Members
}}}
65 \membersection{wxDirPickerCtrl::wxDirPickerCtrl
}\label{wxdirpickerctrl
}
67 \func{}{wxDirPickerCtrl
}{\param{wxWindow *
}{parent
},
\rtfsp
68 \param{wxWindowID
}{ id
},
\rtfsp
69 \param{const wxString\&
}{path = wxEmptyString
},
\rtfsp
70 \param{const wxString\&
}{message = ``Select a folder"
},
\rtfsp
71 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
72 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
73 \param{long
}{ style = wxDIRP
\_DEFAULT\_STYLE},
\rtfsp
74 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
75 \param{const wxString\&
}{name = ``dirpickerctrl"
}}
77 Initializes the object and calls
\helpref{Create
}{wxdirpickerctrlcreate
} with
81 \membersection{wxDirPickerCtrl::Create
}\label{wxdirpickerctrlcreate
}
83 \func{bool
}{Create
}{\param{wxWindow *
}{parent
},
\rtfsp
84 \param{wxWindowID
}{ id
},
\rtfsp
85 \param{const wxString\&
}{path = wxEmptyString
},
\rtfsp
86 \param{const wxString\&
}{message = ``Select a folder"
},
\rtfsp
87 \param{const wxPoint\&
}{pos = wxDefaultPosition
},
\rtfsp
88 \param{const wxSize\&
}{size = wxDefaultSize
},
\rtfsp
89 \param{long
}{ style = wxDIRP
\_DEFAULT\_STYLE},
\rtfsp
90 \param{const wxValidator\&
}{validator = wxDefaultValidator
},
91 \param{const wxString\&
}{name = ``dirpickerctrl"
}}
93 \wxheading{Parameters
}
95 \docparam{parent
}{Parent window, must not be non-
\texttt{NULL
}.
}
97 \docparam{id
}{The identifier for the control.
}
99 \docparam{path
}{The initial directory shown in the control. Must be a valid path to a directory or the empty string.
}
101 \docparam{message
}{The message shown to the user in the
\helpref{wxDirDialog
}{wxdirdialog
} shown by the control.
}
103 \docparam{pos
}{Initial position.
}
105 \docparam{size
}{Initial size.
}
107 \docparam{style
}{The window style, see
{\tt wxDIRP
\_*
} flags.
}
109 \docparam{validator
}{Validator which can be used for additional date checks.
}
111 \docparam{name
}{Control name.
}
113 \wxheading{Return value
}
115 \true if the control was successfully created or
\false if creation failed.
118 \membersection{wxDirPickerCtrl::GetPath
}\label{wxdirpickerctrlgetpath
}
120 \constfunc{wxString
}{GetPath
}{\void}
122 Returns the currently selected directory.
125 \membersection{wxDirPickerCtrl::SetPath
}\label{wxdirpickerctrlsetpath
}
127 \func{void
}{SetPath
}{\param{const wxString \&
}{dirname
}}
129 Sets the currently selected directory. his must be a valid directory if
130 {\tt wxDIRP
\_DIR\_MUST\_EXIST} style was given.