added stock buttons support

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28793 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2004-08-15 15:56:56 +00:00
parent c50e42a122
commit 401e3b6e5f
25 changed files with 943 additions and 24 deletions

View File

@@ -222,6 +222,7 @@ All (GUI):
- implemented wxListCtrl::FindItem() for non-MSW (Robin Stoll)
- added status bar fields styles support (Tim Kosse)
- added samples/splash
- added support for stock buttons
Unix:

View File

@@ -20,10 +20,10 @@ almost any other window.
\twocolwidtha{5cm}%
\begin{twocollist}\itemsep=0pt
\twocolitem{\windowstyle{wxBU\_LEFT}}{Left-justifies the label. Windows only.}
\twocolitem{\windowstyle{wxBU\_TOP}}{Aligns the label to the top of the button. Windows only.}
\twocolitem{\windowstyle{wxBU\_RIGHT}}{Right-justifies the bitmap label. Windows only.}
\twocolitem{\windowstyle{wxBU\_BOTTOM}}{Aligns the label to the bottom of the button. Windows only.}
\twocolitem{\windowstyle{wxBU\_LEFT}}{Left-justifies the label. Windows and GTK+ only.}
\twocolitem{\windowstyle{wxBU\_TOP}}{Aligns the label to the top of the button. Windows and GTK+ only.}
\twocolitem{\windowstyle{wxBU\_RIGHT}}{Right-justifies the bitmap label. Windows and GTK+ only.}
\twocolitem{\windowstyle{wxBU\_BOTTOM}}{Aligns the label to the bottom of the button. Windows and GTK+ only.}
\twocolitem{\windowstyle{wxBU\_EXACTFIT}}{Creates the button as small as possible instead of making it of the standard size (which is the default behaviour ).}
\twocolitem{\windowstyle{wxNO\_BORDER}}{Creates a flat button. Windows and GTK+ only.}
\end{twocollist}
@@ -54,8 +54,20 @@ Default constructor.
\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
\func{}{wxButton}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},
\param{wxStockItemID}{ stock},\rtfsp
\param{const wxString\& }{descriptiveLabel = wxEmptyString},\rtfsp
\param{const wxPoint\& }{pos},\rtfsp
\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
Constructor, creating and showing a button.
The second form is used to create {\em stock} button. Stock buttons are
commonly used buttons such as OK or Cancel. They have standard label and
dimensions and may have different appearance on some platforms (e.g. GTK+ 2
decorates them with icons). Using this from is preferred way of creating
standard buttons.
\wxheading{Parameters}
\docparam{parent}{Parent window. Must not be NULL.}
@@ -75,6 +87,14 @@ appropriately for the text.}
\docparam{name}{Window name.}
\docparam{stock}{Stock ID of the stock button to create. See the
\helpref{list of possible values}{stockitems}.}
\docparam{descriptiveLabel}{Optional label to be used on platforms where
standard buttons have descriptive rather than generic labels. Mac is one such
platforms, well-behaved Mac apps should use descriptive labels (e.g. "Save"
and "Don't Save" instead of "OK" and "Cancel").}
\wxheading{See also}
\helpref{wxButton::Create}{wxbuttoncreate}, \helpref{wxValidator}{wxvalidator}
@@ -91,7 +111,14 @@ Destructor, destroying the button.
\param{const wxPoint\& }{pos}, \param{const wxSize\& }{size = wxDefaultSize},\rtfsp
\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
Button creation function for two-step creation. For more details, see \helpref{wxButton::wxButton}{wxbuttonconstr}.
\func{bool}{Create}{\param{wxWindow* }{parent}, \param{wxWindowID}{ id},
\param{wxStockItemID}{ stock},\rtfsp
\param{const wxString\& }{descriptiveLabel = wxEmptyString},\rtfsp
\param{const wxPoint\& }{pos},\rtfsp
\param{long}{ style = 0}, \param{const wxValidator\& }{validator}, \param{const wxString\& }{name = ``button"}}
Button creation function for two-step creation. For more details, see
\helpref{wxButton::wxButton}{wxbuttonconstr}.
\membersection{wxButton::GetLabel}\label{wxbuttongetlabel}

View File

@@ -8,3 +8,4 @@ This chapter describes the constants defined by wxWidgets.
\input stdevtid.tex
\input keycode.tex
\input langcodes.tex
\input stockitems.tex

View File

@@ -0,0 +1,56 @@
\section{Stock items}\label{stockitems}
Stock item IDs for use in \helpref{wxButton constructor}{wxbuttonconstr}:
\begin{twocollist}\itemsep=0pt
\twocolitem{wxSTOCK\_ADD}{"Add"}
\twocolitem{wxSTOCK\_APPLY}{"\&Apply"}
\twocolitem{wxSTOCK\_BOLD}{"\&Bold"}
\twocolitem{wxSTOCK\_CANCEL}{"\&Cancel"}
\twocolitem{wxSTOCK\_CLEAR}{"\&Clear"}
\twocolitem{wxSTOCK\_CLOSE}{"\&Close"}
\twocolitem{wxSTOCK\_COPY}{"\&Copy"}
\twocolitem{wxSTOCK\_CUT}{"Cu\&t"}
\twocolitem{wxSTOCK\_DELETE}{"\&Delete"}
\twocolitem{wxSTOCK\_FIND}{"\&Find"}
\twocolitem{wxSTOCK\_FIND\_AND\_REPLACE}{"Find and rep\&lace"}
\twocolitem{wxSTOCK\_GO\_BACK}{"\&Back"}
\twocolitem{wxSTOCK\_GO\_DOWN}{"\&Down"}
\twocolitem{wxSTOCK\_GO\_FORWARD}{"\&Forward"}
\twocolitem{wxSTOCK\_GO\_UP}{"\&Up"}
\twocolitem{wxSTOCK\_HELP}{"\&Help"}
\twocolitem{wxSTOCK\_HOME}{"\&Home"}
\twocolitem{wxSTOCK\_INDENT}{"Indent"}
\twocolitem{wxSTOCK\_INDEX}{"\&Index"}
\twocolitem{wxSTOCK\_ITALIC}{"\&Italic"}
\twocolitem{wxSTOCK\_JUSTIFY\_CENTER}{"Centered"}
\twocolitem{wxSTOCK\_JUSTIFY\_FILL}{"Justified"}
\twocolitem{wxSTOCK\_JUSTIFY\_LEFT}{"Align Left"}
\twocolitem{wxSTOCK\_JUSTIFY\_RIGHT}{"Align Right"}
\twocolitem{wxSTOCK\_NEW}{"\&New"}
\twocolitem{wxSTOCK\_NO}{"\&No"}
\twocolitem{wxSTOCK\_OK}{"\&OK"}
\twocolitem{wxSTOCK\_OPEN}{"\&Open"}
\twocolitem{wxSTOCK\_PASTE}{"\&Paste"}
\twocolitem{wxSTOCK\_PREFERENCES}{"\&Preferences"}
\twocolitem{wxSTOCK\_PRINT}{"\&Print"}
\twocolitem{wxSTOCK\_PRINT\_PREVIEW}{"Print previe\&w"}
\twocolitem{wxSTOCK\_PROPERTIES}{"\&Properties"}
\twocolitem{wxSTOCK\_QUIT}{"\&Quit"}
\twocolitem{wxSTOCK\_REDO}{"\&Redo"}
\twocolitem{wxSTOCK\_REFRESH}{"Refresh"}
\twocolitem{wxSTOCK\_REMOVE}{"Remove"}
\twocolitem{wxSTOCK\_REVERT\_TO\_SAVED}{"Revert to Saved"}
\twocolitem{wxSTOCK\_SAVE}{"\&Save"}
\twocolitem{wxSTOCK\_SAVE\_AS}{"Save \&As..."}
\twocolitem{wxSTOCK\_STOP}{"\&Stop"}
\twocolitem{wxSTOCK\_UNDELETE}{"Undelete"}
\twocolitem{wxSTOCK\_UNDERLINE}{"\&Underline"}
\twocolitem{wxSTOCK\_UNDO}{"\&Undo"}
\twocolitem{wxSTOCK\_UNINDENT}{"\&Unindent"}
\twocolitem{wxSTOCK\_YES}{"\&Yes"}
\twocolitem{wxSTOCK\_ZOOM\_100}{"\&Actual Size"}
\twocolitem{wxSTOCK\_ZOOM\_FIT}{"Zoom to \&Fit"}
\twocolitem{wxSTOCK\_ZOOM\_IN}{"Zoom \&In"}
\twocolitem{wxSTOCK\_ZOOM\_OUT}{"Zoom \&Out"}
\end{twocollist}\itemsep=0pt