added wx{Colour|File|Dir|Font}PickerCtrl (patch 1472329 by Francesco)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39495 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-05-31 23:57:54 +00:00
parent 96aed0cd6b
commit ec376c8fd9
70 changed files with 6911 additions and 1 deletions

View File

@@ -94,7 +94,6 @@ that are not static can have \helpref{validators}{wxvalidator} associated with t
\twocolitem{\helpref{wxCheckListBox}{wxchecklistbox}}{A listbox with a checkbox to the left of each item}
\twocolitem{\helpref{wxChoice}{wxchoice}}{Choice control (a combobox without the editable area)}
\twocolitem{\helpref{wxComboBox}{wxcombobox}}{A choice with an editable area}
\twocolitem{\helpref{wxDatePickerCtrl}{wxdatepickerctrl}}{Small date picker control}
\twocolitem{\helpref{wxGauge}{wxgauge}}{A control to represent a varying quantity, such as time remaining}
\twocolitem{\helpref{wxGenericDirCtrl}{wxgenericdirctrl}}{A control for displaying a directory tree}
\twocolitem{\helpref{wxHtmlListBox}{wxhtmllistbox}}{A listbox showing HTML content}
@@ -116,6 +115,21 @@ that are not static can have \helpref{validators}{wxvalidator} associated with t
\twocolitem{\helpref{wxVListBox}{wxvlistbox}}{A listbox supporting variable height rows}
\end{twocollist}
{\large {\bf Miscellaneous pickers}}
A picker control is a control whose appearance and behaviour is highly platform-dependent.
\twocolwidtha{6cm}
\begin{twocollist}\itemsep=0pt
\twocolitem{\helpref{wxColourPickerCtrl}{wxcolourpickerctrl}}{A control which allows the user to choose a colour}
\twocolitem{\helpref{wxDirPickerCtrl}{wxdirpickerctrl}}{A control which allows the user to choose a directory}
\twocolitem{\helpref{wxFilePickerCtrl}{wxfilepickerctrl}}{A control which allows the user to choose a file}
\twocolitem{\helpref{wxFontPickerCtrl}{wxfontpickerctrl}}{A control which allows the user to choose a font}
\twocolitem{\helpref{wxDatePickerCtrl}{wxdatepickerctrl}}{Small date picker control}
\end{twocollist}
{\large {\bf Menus}}
\twocolwidtha{6cm}

View File

@@ -35,6 +35,7 @@
\input choice.tex
\input choicebk.tex
\input clasinfo.tex
\input clrpicker.tex
\input ipcclint.tex
\input clientdc.tex
\input clientdat.tex
@@ -89,6 +90,7 @@
\input dialup.tex
\input dir.tex
\input dirdlg.tex
\input dirpicker.tex
\input dirtrav.tex
\input display.tex
\input dllload.tex
@@ -119,6 +121,7 @@
\input fileistr.tex
\input filename.tex
\input fileostr.tex
\input filepicker.tex
\input filestrm.tex
\input filesys.tex
\input filesysh.tex
@@ -133,6 +136,7 @@
\input fontenum.tex
\input fontlist.tex
\input fontmap.tex
\input fontpicker.tex
\input frame.tex
\input fsfile.tex
\input ftp.tex
@@ -253,6 +257,7 @@
\input passdlg.tex
\input pathlist.tex
\input pen.tex
\input pickerbase.tex
\input point.tex
\input postscpt.tex
\input powerevt.tex

187
docs/latex/wx/clrpicker.tex Normal file
View File

@@ -0,0 +1,187 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: clrpicker.tex
%% Purpose: wxColourPickerCtrl and wxColourPickerEvent documentation
%% Author: Francesco Montorsi
%% Created: 2006-04-17
%% RCS-ID: $Id$
%% Copyright: (c) 2006 Francesco Montorsi
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxColourPickerCtrl}}\label{wxcolourpickerctrl}
This control allows the user to select a colour. The generic implementation is
a button which brings up a \helpref{wxColourDialog}{wxcolourdialog} when clicked. Native implementation
may differ but this is usually a (small) widget which give access to the colour-chooser
dialog.
It is only available if \texttt{wxUSE\_COLOURPICKERCTRL} is set to $1$ (the default).
\wxheading{Derived from}
\helpref{wxPickerBase}{wxpickerbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/clrpicker.h>
\wxheading{Window styles}
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxCLRP\_DEFAULT}}{Default style.}
\twocolitem{\windowstyle{wxCLRP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker button which is completely managed by the \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
and which can be used by the user to specify a colour (see \helpref{SetColour}{wxcolourpickerctrlsetcolour}).
The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
\twocolitem{\windowstyle{wxCLRP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker button which is completely managed by the \helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
and which can be used by the user to specify a colour (see \helpref{SetColour}{wxcolourpickerctrlsetcolour}).
The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
\twocolitem{\windowstyle{wxCLRP\_SHOW\_LABEL}}{Shows the colour in HTML form (#AABBCC) as colour button label
(instead of no label at all).}
\end{twocollist}
\wxheading{Event handling}
\twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_COLOURPICKER\_CHANGED(id, func)}}{The user changed the
colour selected in the control either using the button or using text control
(see wxCLRP\_USE\_TEXTCTRL; note that in this case the event is fired only if
the user's input is valid, i.e. recognizable). }
\end{twocollist}
\wxheading{See also}
\helpref{wxColourDialog}{wxcolourdialog},\\
\helpref{wxColourPickerEvent}{wxcolourpickerevent}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxColourPickerCtrl::wxColourPickerCtrl}\label{wxcolourpickerctrl}
\func{}{wxColourPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxColour\& }{colour = *wxBLACK},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``colourpickerctrl"}}
Initializes the object and calls \helpref{Create}{wxcolourpickerctrlcreate} with
all the parameters.
\membersection{wxColourPickerCtrl::Create}\label{wxcolourpickerctrlcreate}
\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxColour\& }{colour = *wxBLACK},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxCP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``colourpickerctrl"}}
\wxheading{Parameters}
\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
\docparam{id}{The identifier for the control.}
\docparam{colour}{The initial colour shown in the control.}
\docparam{pos}{Initial position.}
\docparam{size}{Initial size.}
\docparam{style}{The window style, see wxCRLP\_* flags.}
\docparam{validator}{Validator which can be used for additional date checks.}
\docparam{name}{Control name.}
\wxheading{Return value}
\true if the control was successfully created or \false if creation failed.
\membersection{wxColourPickerCtrl::GetColour}\label{wxcolourpickerctrlgetcolour}
\constfunc{wxColour}{GetColour}{\void}
Returns the currently selected colour.
\membersection{wxColourPickerCtrl::SetColour}\label{wxcolourpickerctrlsetcolour}
\func{void}{SetColour}{\param{const wxColour \&}{col}}
\func{void}{SetColour}{\param{const wxString \&}{colname}}
Sets the currently selected colour. See \helpref{wxColour::Set}{wxcolourset}.
%% wxColourPickerEvent documentation
\section{\class{wxColourPickerEvent}}\label{wxcolourpickerevent}
This event class is used for the events generated by
\helpref{wxColourPickerCtrl}{wxcolourpickerctrl}.
\wxheading{Derived from}
\helpref{wxCommandEvent}{wxcommandevent}\\
\helpref{wxEvent}{wxevent}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/clrpicker.h>
\wxheading{Event handling}
To process input from a wxColourPickerCtrl, use one of these event handler macros to
direct input to member function that take a
\helpref{wxColourPickerEvent}{wxcolourpickerevent} argument:
\twocolwidtha{7cm}
\begin{twocollist}
\twocolitem{{\bf EVT\_COLOURPICKER\_CHANGED(id, func)}}{Generated whenever the selected colour changes.}
\end{twocollist}%
\wxheading{See also}
\helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxColourPickerEvent::wxColourPickerEvent}\label{wxcolourpickereventctor}
\func{}{wxColourPickerEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{const wxColour\&}{ colour}}
The constructor is not normally used by the user code.
\membersection{wxColourPickerEvent::GetColour}\label{wxcolourpickereventgetcolour}
\constfunc{wxColour}{GetColour}{\void}
Retrieve the colour the user has just selected.
\membersection{wxColourPickerEvent::SetColour}\label{wxcolourpickereventsetcolour}
\func{void}{SetColour}{\param{const wxColour \&}{pos}}
Set the colour associated with the event.

127
docs/latex/wx/dirpicker.tex Normal file
View File

@@ -0,0 +1,127 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: dirpicker.tex
%% Purpose: wxDirPickerCtrl documentation
%% Author: Francesco Montorsi
%% Created: 2006-05-12
%% RCS-ID: $Id$
%% Copyright: (c) 2006 Francesco Montorsi
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxDirPickerCtrl}}\label{wxdirpickerctrl}
This control allows the user to select a directory. The generic implementation is
a button which brings up a \helpref{wxDirDialog}{wxdirdialog} when clicked. Native implementation
may differ but this is usually a (small) widget which give access to the dir-chooser
dialog.
It is only available if \texttt{wxUSE\_DIRPICKERCTRL} is set to $1$ (the default).
\wxheading{Derived from}
\helpref{wxPickerBase}{wxpickerbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/filepicker.h>
\wxheading{Window styles}
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxDIRP\_DEFAULT\_STYLE}}{Default style.}
\twocolitem{\windowstyle{wxDIRP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker button which is completely managed by the \helpref{wxDirPickerCtrl}{wxdirpickerctrl}
and which can be used by the user to specify a path (see \helpref{SetPath}{wxdirpickerctrlsetpath}).
The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
\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.}
\twocolitem{\windowstyle{wxDIRP\_CHANGE\_DIR}}{Change current working directory on each user directory selection change.}
\end{twocollist}
\wxheading{Event handling}
\twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt
\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).}
\end{twocollist}
\wxheading{See also}
\helpref{wxDirDialog}{wxdirdialog},\\
\helpref{wxFileDirPickerEvent}{wxfiledirpickerevent}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxDirPickerCtrl::wxDirPickerCtrl}\label{wxdirpickerctrl}
\func{}{wxdirpickerctrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{path = wxEmptyString},\rtfsp
\param{const wxString\& }{message = ``Select a folder"},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxDIRP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``dirpickerctrl"}}
Initializes the object and calls \helpref{Create}{wxdirpickerctrlcreate} with
all the parameters.
\membersection{wxDirPickerCtrl::Create}\label{wxdirpickerctrlcreate}
\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{path = wxEmptyString},\rtfsp
\param{const wxString\& }{message = ``Select a folder"},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxDIRP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``dirpickerctrl"}}
\wxheading{Parameters}
\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
\docparam{id}{The identifier for the control.}
\docparam{path}{The initial directory shown in the control. Must be a valid path to a directory or the empty string.}
\docparam{message}{The message shown to the user in the \helpref{wxFileDialog}{wxfiledialog} shown by the control.}
\docparam{pos}{Initial position.}
\docparam{size}{Initial size.}
\docparam{style}{The window style, see wxDIRP\_* flags.}
\docparam{validator}{Validator which can be used for additional date checks.}
\docparam{name}{Control name.}
\wxheading{Return value}
\true if the control was successfully created or \false if creation failed.
\membersection{wxDirPickerCtrl::GetPath}\label{wxdirpickerctrlgetpath}
\constfunc{wxString}{GetPath}{\void}
Returns the currently selected directory.
\membersection{wxDirPickerCtrl::SetPath}\label{wxdirpickerctrlsetpath}
\func{void}{SetPath}{\param{const wxString \&}{dirname}}
Sets the currently selected directory. This must be a valid directory.

View File

@@ -0,0 +1,195 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: filepicker.tex
%% Purpose: wxFilePickerCtrl and wxFileDirPickerEvent documentation
%% Author: Francesco Montorsi
%% Created: 2006-05-12
%% RCS-ID: $Id$
%% Copyright: (c) 2006 Francesco Montorsi
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxFilePickerCtrl}}\label{wxfilepickerctrl}
This control allows the user to select a file. The generic implementation is
a button which brings up a \helpref{wxFileDialog}{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 \texttt{wxUSE\_FILEPICKERCTRL} is set to $1$ (the default).
\wxheading{Derived from}
\helpref{wxPickerBase}{wxpickerbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/filepicker.h>
\wxheading{Window styles}
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxFLP\_DEFAULT\_STYLE}}{Default style.}
\twocolitem{\windowstyle{wxFLP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker button which is completely managed by the \helpref{wxFilePickerCtrl}{wxfilepickerctrl}
and which can be used by the user to specify a path (see \helpref{SetPath}{wxfilepickerctrlsetpath}).
The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
\twocolitem{\windowstyle{wxFLP\_OPEN}}{Creates a picker which allows the user to select a file to open.}
\twocolitem{\windowstyle{wxFLP\_SAVE}}{Creates a picker which allows the user to select a file to save.}
\twocolitem{\windowstyle{wxFLP\_OVERWRITE\_PROMPT}}{Can be combined with wxFLP\_SAVE only: ask confirmation to the user before selecting a file.}
\twocolitem{\windowstyle{wxFLP\_FILE\_MUST\_EXIST}}{Can be combined with wxFLP\_OPEN only: the selected file must be an existing file.}
\twocolitem{\windowstyle{wxFLP\_CHANGE\_DIR}}{Change current working directory on each user file selection change.}
NB: the wxFD\_MULTIPLE style of wxFileDialog is not supported!
\end{twocollist}
\wxheading{Event handling}
\twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_FILEPICKER\_CHANGED(id, func)}}{The user changed the file
selected in the control either using the button or using text control (see
wxFILEP\_USE\_TEXTCTRL; note that in this case the event is fired only if the
user's input is valid, e.g. an existing file path if wxFILEP\_FILE\_MUST\_EXIST
was given).}
\end{twocollist}
\wxheading{See also}
\helpref{wxFileDialog}{wxfiledialog},\\
\helpref{wxFileDirPickerEvent}{wxfiledirpickerevent}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxFilePickerCtrl::wxFilePickerCtrl}\label{wxfilepickerctrl}
\func{}{wxfilepickerctrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{path = wxEmptyString},\rtfsp
\param{const wxString\& }{message = ``Select a file"},\rtfsp
\param{const wxString\& }{wildcard = ``*.*"},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFILEP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``filepickerctrl"}}
Initializes the object and calls \helpref{Create}{wxfilepickerctrlcreate} with
all the parameters.
\membersection{wxFilePickerCtrl::Create}\label{wxfilepickerctrlcreate}
\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxString\& }{path = wxEmptyString},\rtfsp
\param{const wxString\& }{message = ``Select a file"},\rtfsp
\param{const wxString\& }{wildcard = ``*.*"},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFILEP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``filepickerctrl"}}
\wxheading{Parameters}
\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
\docparam{id}{The identifier for the control.}
\docparam{path}{The initial file shown in the control. Must be a valid path to a file or the empty string.}
\docparam{message}{The message shown to the user in the \helpref{wxFileDialog}{wxfiledialog} shown by the control.}
\docparam{wildcard}{A wildcard which defines user-selectable files (use the same syntax as for \helpref{wxFileDialog}{wxfiledialog}'s wildcards.}
\docparam{pos}{Initial position.}
\docparam{size}{Initial size.}
\docparam{style}{The window style, see wxFILEP\_* flags.}
\docparam{validator}{Validator which can be used for additional date checks.}
\docparam{name}{Control name.}
\wxheading{Return value}
\true if the control was successfully created or \false if creation failed.
\membersection{wxFilePickerCtrl::GetPath}\label{wxfilepickerctrlgetpath}
\constfunc{wxString}{GetPath}{\void}
Returns the currently selected file.
\membersection{wxFilePickerCtrl::SetPath}\label{wxfilepickerctrlsetpath}
\func{void}{SetPath}{\param{const wxString \&}{filename}}
Sets the currently selected file. This must be a valid file if
wxFILEP\_FILE\_MUST\_EXIST style was given.
%% wxFileDirPickerEvent documentation
\section{\class{wxFileDirPickerEvent}}\label{wxfiledirpickerevent}
This event class is used for the events generated by
\helpref{wxFilePickerCtrl}{wxfilepickerctrl} and by \helpref{wxDirPickerCtrl}{wxdirpickerctrl}.
\wxheading{Derived from}
\helpref{wxCommandEvent}{wxcommandevent}\\
\helpref{wxEvent}{wxevent}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/filepicker.h>
\wxheading{Event handling}
To process input from a wxFilePickerCtrl or from a wxDirPickerCtrl, use one of these event handler macros to
direct input to member function that take a \helpref{wxFileDirPickerEvent}{wxfiledirpickerevent} argument:
\twocolwidtha{7cm}
\begin{twocollist}
\twocolitem{{\bf EVT\_FILEPICKER\_CHANGED(id, func)}}{Generated whenever the selected file changes.}
\twocolitem{{\bf EVT\_DIRPICKER\_CHANGED(id, func)}}{Generated whenever the selected directory changes.}
\end{twocollist}%
\wxheading{See also}
\helpref{wxfilepickerctrl}{wxfilepickerctrl}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxFileDirPickerEvent::wxFileDirPickerEvent}\label{wxfiledirpickereventctor}
\func{}{wxFileDirPickerEvent}{\param{wxEventType}{ type}, \param{wxObject *}{ generator}, \param{int}{ id}, \param{const wxString&}{ path}}
The constructor is not normally used by the user code.
\membersection{wxFileDirPickerEvent::GetPath}\label{wxfiledirpickereventgetpath}
\constfunc{wxString}{GetPath}{\void}
Retrieve the file/directory the user has just selected.
\membersection{wxFileDirPickerEvent::SetPath}\label{wxfiledirpickereventsetpath}
\func{void}{SetPath}{\param{const wxString \&}{path}}
Set the file/directory associated with the event.

View File

@@ -0,0 +1,200 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: fontpicker.tex
%% Purpose: wxFontPickerCtrl and wxFontPickerEvent documentation
%% Author: Francesco Montorsi
%% Created: 2006-04-17
%% RCS-ID: $Id$
%% Copyright: (c) 2006 Francesco Montorsi
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxFontPickerCtrl}}\label{wxfontpickerctrl}
This control allows the user to select a font. The generic implementation is
a button which brings up a \helpref{wxFontDialog}{wxfontdialog} when clicked. Native implementation
may differ but this is usually a (small) widget which give access to the font-chooser
dialog.
It is only available if \texttt{wxUSE\_FONTPICKERCTRL} is set to $1$ (the default).
\wxheading{Derived from}
\helpref{wxPickerBase}{wxpickerbase}\\
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/fontpicker.h>
\wxheading{Window styles}
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxFONTP\_DEFAULT}}{Default style.}
\twocolitem{\windowstyle{wxFONTP\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker button which is completely managed by the \helpref{wxFontPickerCtrl}{wxfontpickerctrl}
and which can be used by the user to specify a font (see \helpref{SetSelectedFont}{wxfontpickerctrlsetselectedfont}).
The text control is automatically synchronized with button's value. Use functions defined in \helpref{wxPickerBase}{wxpickerbase} to modify the text control.}
\twocolitem{\windowstyle{wxFONTP\_FONTDESC\_AS\_LABEL}}{Keeps the label of the button updated with the fontface name and the font size. E.g. choosing "Times New Roman bold, italic with size 10" from the fontdialog, will update the label (overwriting any previous label) with the "Times New Roman, 10" text.}
\twocolitem{\windowstyle{wxFONTP\_USEFONT\_FOR\_LABEL}}{Uses the currently selected font to draw the label of the button.}
\end{twocollist}
\wxheading{Event handling}
\twocolwidtha{7cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf EVT\_FONTPICKER\_CHANGED(id, func)}}{The user changed the font
selected in the control either using the button or using text control (see
wxFONTP\_USE\_TEXTCTRL; note that in this case the event is fired only if the
user's input is valid, i.e. recognizable). }
\end{twocollist}
\wxheading{See also}
\helpref{wxFontDialog}{wxfontdialog},\\
\helpref{wxFontPickerEvent}{wxfontpickerevent}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxFontPickerCtrl::wxFontPickerCtrl}\label{wxfontpickerctrl}
\func{}{wxFontPickerCtrl}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFONTP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``fontpickerctrl"}}
Initializes the object and calls \helpref{Create}{wxfontpickerctrlcreate} with
all the parameters.
\membersection{wxFontPickerCtrl::Create}\label{wxfontpickerctrlcreate}
\func{bool}{Create}{\param{wxWindow *}{parent},\rtfsp
\param{wxWindowID}{ id},\rtfsp
\param{const wxFont\& }{font = *wxNORMAL\_FONT},\rtfsp
\param{const wxPoint\& }{pos = wxDefaultPosition},\rtfsp
\param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = wxFONTP\_DEFAULT\_STYLE},\rtfsp
\param{const wxValidator\& }{validator = wxDefaultValidator},
\param{const wxString\& }{name = ``fontpickerctrl"}}
\wxheading{Parameters}
\docparam{parent}{Parent window, must not be non-\texttt{NULL}.}
\docparam{id}{The identifier for the control.}
\docparam{font}{The initial font shown in the control.}
\docparam{pos}{Initial position.}
\docparam{size}{Initial size.}
\docparam{style}{The window style, see wxCRLP\_* flags.}
\docparam{validator}{Validator which can be used for additional date checks.}
\docparam{name}{Control name.}
\wxheading{Return value}
\true if the control was successfully created or \false if creation failed.
\membersection{wxFontPickerCtrl::GetSelectedFont}\label{wxfontpickerctrlgetselectedfont}
\constfunc{wxFont}{GetSelectedFont}{\void}
Returns the currently selected font.
Note that this function is completely different from \helpref{wxWindow::GetFont}{wxwindowgetfont}.
\membersection{wxFontPickerCtrl::SetSelectedFont}\label{wxfontpickerctrlsetselectedfont}
\func{void}{SetSelectedFont}{\param{const wxFont \&}{font}}
Sets the currently selected font.
Note that this function is completely different from \helpref{wxWindow::SetFont}{wxwindowsetfont}.
\membersection{wxFontPickerCtrl::GetMaxPointSize}\label{wxfontpickerctrlgetmaxpointsize}
\constfunc{unsigned int}{GetMaxPointSize}{\void}
Returns the maximum point size value allowed for the user-chosen font.
\membersection{wxFontPickerCtrl::SetMaxPointSize}\label{wxfontpickerctrlsetmaxpointsize}
\func{void}{GetMaxPointSize}{\param{unsigned int}{ max}}
Sets the maximum point size value allowed for the user-chosen font.
The default value is 100. Note that big fonts can require a lot of memory and CPU time
both for creation and for rendering; thus, specially because the user has the option to specify
the fontsize through a text control (see wxFONTP\_USE\_TEXTCTRL), it's a good idea to put a limit
to the maximum font size when huge fonts do not make much sense.
%% wxFontPickerEvent documentation
\section{\class{wxFontPickerEvent}}\label{wxfontpickerevent}
This event class is used for the events generated by
\helpref{wxFontPickerCtrl}{wxfontpickerctrl}.
\wxheading{Derived from}
\helpref{wxCommandEvent}{wxcommandevent}\\
\helpref{wxEvent}{wxevent}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/clrpicker.h>
\wxheading{Event handling}
To process input from a wxFontPickerCtrl, use one of these event handler macros to
direct input to member function that take a
\helpref{wxFontPickerEvent}{wxfontpickerevent} argument:
\twocolwidtha{7cm}
\begin{twocollist}
\twocolitem{{\bf EVT\_FONTPICKER\_CHANGED(id, func)}}{Generated whenever the selected font changes.}
\end{twocollist}%
\wxheading{See also}
\helpref{wxFontPickerCtrl}{wxfontpickerctrl}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxFontPickerEvent::wxFontPickerEvent}\label{wxfontpickereventctor}
\func{}{wxFontPickerEvent}{\param{wxObject *}{ generator}, \param{int}{ id}, \param{const wxFont\&}{ font}}
The constructor is not normally used by the user code.
\membersection{wxFontPickerEvent::GetFont}\label{wxfontpickereventgetfont}
\constfunc{wxFont}{GetFont}{\void}
Retrieve the font the user has just selected.
\membersection{wxFontPickerEvent::SetFont}\label{wxfontpickereventsetfont}
\func{void}{SetFont}{\param{const wxFont \&}{ f}}
Set the font associated with the event.

View File

@@ -0,0 +1,87 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Name: pickerbase.tex
%% Purpose: wxPickerBase documentation
%% Author: Francesco Montorsi
%% Created: 2006-04-18
%% RCS-ID: $Id$
%% Copyright: (c) 2006 Francesco Montorsi
%% License: wxWindows license
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\section{\class{wxPickerBase}}\label{wxpickerbase}
Base abstract class for all pickers which support an auxiliary text control.
This class handles all positioning and sizing of the text control like a
an horizontal \helpref{wxBoxSizer}{wxboxsizer} would do, with the text control on
the left of the picker button and the proportion of the picker fixed to value 1.
\wxheading{Derived from}
\helpref{wxControl}{wxcontrol}\\
\helpref{wxWindow}{wxwindow}\\
\helpref{wxEvtHandler}{wxevthandler}\\
\helpref{wxObject}{wxobject}
\wxheading{Include files}
<wx/pickerbase.h>
\wxheading{Window styles}
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxPB\_USE\_TEXTCTRL}}{Creates a text control to the left of the
picker which is completely managed by this \helpref{wxPickerBase}{wxpickerbase}
class.}
\end{twocollist}
\wxheading{See also}
\helpref{wxColourPickerCtrl}{wxcolourpickerctrl}
\latexignore{\rtfignore{\wxheading{Members}}}
\membersection{wxPickerBase::SetInternalMargin}\label{wxpickerbasesetinternalmargin}
\func{void}{SetInternalMargin}{\param{int}{margin}}
Sets the margin (in pixel) between the picker and the text control.
\membersection{wxPickerBase::GetInternalMargin}\label{wxpickerbasegetinternalmargin}
\constfunc{int}{GetInternalMargin}{}
Returns the margin (in pixel) between the picker and the text control.
\membersection{wxPickerBase::SetTextCtrlProportion}\label{wxpickerbasesettextctrlproportion}
\func{void}{SetTextCtrlProportion}{\param{int}{prop}}
Sets the proportion between the text control and the picker.
Look at the overview of wxPickerBase for more details about this.
\membersection{wxPickerBase::GetTextCtrlProportion}\label{wxpickerbasesgettextctrlproportion}
\constfunc{int}{GetTextCtrlProportion}{}
Returns the proportion between the text control and the picker.
\membersection{wxPickerBase::HasTextCtrl}\label{wxpickerbaseshastextctrl}
\constfunc{bool}{HasTextCtrl}{}
Returns true if this class has a valid text control (i.e. if the \windowstyle{wxPB\_USE\_TEXTCTRL} style was
given when creating this control).
\membersection{wxPickerBase::GetTextCtrl}\label{wxpickerbasesgetextctrl}
\func{wxTextCtrl *}{GetTextCtrl}{}
Returns a pointer to the text control handled by this class or \texttt{NULL} if the \windowstyle{wxPB\_USE\_TEXTCTRL} style was not specified when this control was created.
Very important: the contents of the text control could be containing an invalid representation of the entity which can be chosen through the picker (e.g. the user entered an invalid colour syntax because of a typo). Thus you should never parse the content of the textctrl to get the user's input; rather use the derived-class getter (e.g. \helpref{wxColourPickerCtrl::GetColour}{wxcolourpickerctrlgetcolour}, \helpref{wxFilePickerCtrl::GetPath}{wxfilepickerctrlgetpath}, etc).