fixes to menu stock items support (patch 1547639)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41021 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-09-05 21:00:55 +00:00
parent d3c7fc996a
commit 345319d60c
10 changed files with 147 additions and 50 deletions

View File

@@ -42,11 +42,36 @@ only implemented for Windows and GTK+.
Constructs a wxMenuItem object.
The preferred way to create standard menu items is to use default value of
\arg{text}. If no text is supplied and \arg{id} is one of standard IDs from
\helpref{this list}{stockitems}, a standard label and a standard accelerator
will be used. In addition to that, the button will be decorated with stock
icons under GTK+ 2.
Menu items can be standard, or ``stock menu items'', or custom. For the
standard menu items (such as commands to open a file, exit the program and so
on, see \helpref{stock items}{stockitems} for the full list) it is enough to
specify just the stock ID and leave \arg{text} and \arg{helpString} empty. In
fact, leaving at least \arg{text} empty for the stock menu items is strongly
recommended as they will have appearance and keyboard interface (including
standard accelerators) familiar to the user.
For the custom (non-stock) menu items, \arg{text} must be specified and while
\arg{helpString} may be left empty, it's recommended to pass the item
description (which is automatically shown by the library in the status bar when
the menu item is selected) in this parameter.
Finally note that you can e.g. use a stock menu label without using its stock
help string:
\begin{verbatim}
// use all stock properties:
helpMenu->Append(wxID_ABOUT);
// use the stock label and the stock accelerator but not the stock help string:
helpMenu->Append(wxID_ABOUT, wxEmptyString, wxT("My custom help string"));
// use all stock properties except for the bitmap:
wxMenuItem *mymenu = new wxMenuItem(helpMenu, wxID_ABOUT);
mymenu->SetBitmap(wxArtProvider::GetBitmap(wxART_WARNING));
helpMenu->Append(mymenu);
\end{verbatim}
that is, stock properties are set independently one from the other.
\wxheading{Parameters}

View File

@@ -1,9 +1,11 @@
\section{Stock items}\label{stockitems}
Window IDs for which stock buttons are created
(see \helpref{wxButton constructor}{wxbuttonctor}):
Window IDs for which stock buttons and menu items are created
(see \helpref{wxButton constructor}{wxbuttonctor} and
\helpref{wxMenuItem constructor}{wxmenuitemctor}):
\begin{twocollist}\itemsep=0pt
\twocolitem{{\bf Stock ID}}{{\bf Stock label}}
\twocolitem{wxID\_ABOUT}{"\&About"}
\twocolitem{wxID\_ADD}{"Add"}
\twocolitem{wxID\_APPLY}{"\&Apply"}
@@ -58,4 +60,8 @@ Window IDs for which stock buttons are created
\twocolitem{wxID\_ZOOM\_FIT}{"Zoom to \&Fit"}
\twocolitem{wxID\_ZOOM\_IN}{"Zoom \&In"}
\twocolitem{wxID\_ZOOM\_OUT}{"Zoom \&Out"}
\end{twocollist}\itemsep=0pt
\end{twocollist}
Note that some of the IDs listed above have also a stock accelerator
and an help string associated.