X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7c5cd6e9ad02d43ad2d25565d36414c45ff917aa..3cc305b2b4a0674c56c84d7088cfd70676b850f0:/docs/latex/wx/menu.tex diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index fed7774d60..824d341009 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -61,6 +61,10 @@ that normally all menus used are deleted automatically. +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{Event handling} If the menu is part of a menubar, then \helpref{wxMenuBar}{wxmenubar} event processing is used. @@ -73,10 +77,6 @@ With a popup menu, there is a variety of ways to handle a menu selection event \item Set a new event handler for wxMenu, using an object whose class has EVT\_MENU entries. \item Provide EVT\_MENU handlers in the window which pops up the menu, or in an ancestor of this window. -\item Define a callback of type wxFunction, which you pass to the wxMenu constructor. -The callback takes a reference to the menu, and a reference to a -\helpref{wxCommandEvent}{wxcommandevent}. This method is deprecated and should -not be used in the new code, it is provided for backwards compatibility only. \end{enumerate} \wxheading{See also} @@ -127,7 +127,7 @@ and recreation of internal data structures. \membersection{wxMenu::Append}\label{wxmenuappend} -\func{wxMenuItem*}{Append}{\param{int}{ id}, \param{const wxString\& }{ item}, \param{const wxString\& }{helpString = ""},\rtfsp +\func{wxMenuItem*}{Append}{\param{int}{ id}, \param{const wxString\& }{ item = ""}, \param{const wxString\& }{helpString = ""},\rtfsp \param{wxItemKind}{ kind = wxITEM\_NORMAL}} Adds a string item to the end of the menu. @@ -435,8 +435,26 @@ The item label, or the empty string if the item was not found. \wxheading{See also} -\helpref{wxMenu::SetLabel}{wxmenusetlabel} +\helpref{wxMenu::GetLabelText}{wxmenugetlabeltext}, \helpref{wxMenu::SetLabel}{wxmenusetlabel} + + +\membersection{wxMenu::GetLabelText}\label{wxmenugetlabeltext} + +\constfunc{wxString}{GetLabelText}{\param{int}{ id}} + +Returns a menu item label, without any of the original mnemonics and accelerators. + +\wxheading{Parameters} + +\docparam{id}{The menu item identifier.} + +\wxheading{Return value} + +The item label, or the empty string if the item was not found. + +\wxheading{See also} +\helpref{wxMenu::GetLabel}{wxmenugetlabel}, \helpref{wxMenu::SetLabel}{wxmenusetlabel} \membersection{wxMenu::GetMenuItemCount}\label{wxmenugetmenuitemcount} @@ -450,7 +468,7 @@ Returns the number of items in the menu. \constfunc{wxMenuItemList\&}{GetMenuItems}{\void} Returns the list of items in the menu. wxMenuItemList is a pseudo-template -list class containing wxMenuItem pointers. +list class containing wxMenuItem pointers, see \helpref{wxList}{wxlist}. \membersection{wxMenu::GetTitle}\label{wxmenugettitle} @@ -462,7 +480,7 @@ Returns the title of the menu. \wxheading{Remarks} This is relevant only to popup menus, use -\helpref{wxMenuBar::GetLabelTop}{wxmenubargetlabeltop} for the menus in the +\helpref{wxMenuBar::GetMenuLabel}{wxmenubargetmenulabel} for the menus in the menubar. \wxheading{See also} @@ -475,7 +493,7 @@ menubar. \func{wxMenuItem*}{Insert}{\param{size\_t }{pos}, \param{wxMenuItem *}{item}} \func{wxMenuItem*}{Insert}{\param{size\_t }{pos}, \param{int}{ id},\rtfsp -\param{const wxString\& }{ item}, \param{const wxString\& }{helpString = ""},\rtfsp +\param{const wxString\& }{ item = ""}, \param{const wxString\& }{helpString = ""},\rtfsp \param{wxItemKind}{ kind = wxITEM\_NORMAL}} Inserts the given {\it item} before the position {\it pos}. Inserting the item @@ -569,7 +587,7 @@ true if the menu item is enabled, false otherwise. \func{wxMenuItem*}{Prepend}{\param{wxMenuItem *}{item}} \func{wxMenuItem*}{Prepend}{\param{int}{ id},\rtfsp -\param{const wxString\& }{ item}, \param{const wxString\& }{helpString = ""},\rtfsp +\param{const wxString\& }{ item = ""}, \param{const wxString\& }{helpString = ""},\rtfsp \param{wxItemKind}{ kind = wxITEM\_NORMAL}} Inserts the given {\it item} at position $0$, i.e. before all the other @@ -721,6 +739,10 @@ A menu bar is a series of menus accessible from the top of a frame. +\wxheading{Library} + +\helpref{wxCore}{librarieslist} + \wxheading{Event handling} To respond to a menu selection, provide a handler for EVT\_MENU, in the frame @@ -958,6 +980,8 @@ The menu label, or the empty string if the menu was not found. Use only after the menubar has been associated with a frame. +This function is deprecated in favour of \helpref{GetMenuLabel}{wxmenubargetmenulabel} and \helpref{GetMenuLabelText}{wxmenubargetmenulabeltext}. + \wxheading{See also} \helpref{wxMenuBar::SetLabelTop}{wxmenubarsetlabeltop} @@ -972,11 +996,61 @@ Returns the menu at {\it menuIndex} (zero-based). \membersection{wxMenuBar::GetMenuCount}\label{wxmenubargetmenucount} -\constfunc{int}{GetMenuCount}{\void} +\constfunc{size\_t}{GetMenuCount}{\void} Returns the number of menus in this menubar. +\membersection{wxMenuBar::GetMenuLabel}\label{wxmenubargetmenulabel} + +\constfunc{wxString}{GetMenuLabel}{\param{int}{ pos}} + +Returns the label of a top-level menu. Note that the returned string +includes the accelerator characters that have been specified in the menu +title string during its construction. + +\wxheading{Parameters} + +\docparam{pos}{Position of the menu on the menu bar, starting from zero.} + +\wxheading{Return value} + +The menu label, or the empty string if the menu was not found. + +\wxheading{Remarks} + +Use only after the menubar has been associated with a frame. + +\wxheading{See also} + +\helpref{wxMenuBar::GetMenuLabelText}{wxmenubargetmenulabeltext}, \helpref{wxMenuBar::SetMenuLabel}{wxmenubarsetmenulabel} + + +\membersection{wxMenuBar::GetMenuLabelText}\label{wxmenubargetmenulabeltext} + +\constfunc{wxString}{GetMenuLabelText}{\param{int}{ pos}} + +Returns the label of a top-level menu. Note that the returned string does not +include any accelerator characters that may have been specified in the menu +title string during its construction. + +\wxheading{Parameters} + +\docparam{pos}{Position of the menu on the menu bar, starting from zero.} + +\wxheading{Return value} + +The menu label, or the empty string if the menu was not found. + +\wxheading{Remarks} + +Use only after the menubar has been associated with a frame. + +\wxheading{See also} + +\helpref{wxMenuBar::GetMenuLabel}{wxmenubargetmenulabel}, \helpref{wxMenuBar::SetMenuLabel}{wxmenubarsetmenulabel} + + \membersection{wxMenuBar::Insert}\label{wxmenubarinsert} \func{bool}{Insert}{\param{size\_t }{pos}, \param{wxMenu *}{menu}, \param{const wxString\& }{title}} @@ -1133,7 +1207,30 @@ Sets the label of a top-level menu. Use only after the menubar has been associated with a frame. +This function has been deprecated in favour of \helpref{SetMenuLabel}{wxmenubarsetmenulabel}. + \wxheading{See also} \helpref{wxMenuBar::GetLabelTop}{wxmenubargetlabeltop} + +\membersection{wxMenuBar::SetMenuLabel}\label{wxmenubarsetmenulabel} + +\func{void}{SetMenuLabel}{\param{int}{ pos}, \param{const wxString\& }{label}} + +Sets the label of a top-level menu. + +\wxheading{Parameters} + +\docparam{pos}{The position of a menu on the menu bar, starting from zero.} + +\docparam{label}{The menu label.} + +\wxheading{Remarks} + +Use only after the menubar has been associated with a frame. + +\wxheading{See also} + +\helpref{wxMenuBar::GetMenuLabel}{wxmenubargetmenulabel}, \helpref{wxMenuBar::GetMenuLabelText}{wxmenubargetmenulabeltext} +