X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d17f05afeb41c64fab410cd3178a78596da55e38..44b62d54c61e4a0989fcc0f24eecfe0bd883d72b:/docs/latex/wx/menu.tex?ds=sidebyside diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index 4f8faa2abb..33946872fe 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -51,7 +51,7 @@ Constructs a wxMenu object. \docparam{title}{A title for the popup menu: the empty string denotes no title.} -\docparam{style}{If set to {\tt wxMENU\_TEAROFF}, the menu will be detachable.} +\docparam{style}{If set to {\tt wxMENU\_TEAROFF}, the menu will be detachable (wxGTK only).} \func{}{wxMenu}{\param{long}{ style}} @@ -59,7 +59,7 @@ Constructs a wxMenu object. \wxheading{Parameters} -\docparam{style}{If set to {\tt wxMENU\_TEAROFF}, the menu will be detachable.} +\docparam{style}{If set to {\tt wxMENU\_TEAROFF}, the menu will be detachable (wxGTK only).} \membersection{wxMenu::\destruct{wxMenu}} @@ -234,6 +234,10 @@ Finds the menu item id for a menu item string. Finds the menu item object associated with the given menu item identifier and, optionally, the (sub)menu it belongs to. +\perlnote{In wxPerl this method takes just the {\tt id} parameter; +in scalar context it returns the associated {\tt Wx::MenuItem}, in list +context it returns a 2-element list ( item, submenu )} + \wxheading{Parameters} \docparam{itemString}{Menu item string to find.} @@ -254,7 +258,7 @@ Second form: returns the menu item object, or NULL if it is not found. Any special menu codes are stripped out of source and target strings before matching. -\pythonnote{The name of this method in wxPython is {\tt FindItemById} +\pythonnote{The name of this method in wxPython is {\tt FindItemById} and it does not support the second parameter.} \membersection{wxMenu::GetHelpString}\label{wxmenugethelpstring} @@ -477,6 +481,11 @@ then the events are sent directly to the frame. This allows command and UI updat handling to be processed by specific windows and controls, and not necessarily by the application frame. +{\bf Tip:} under Windows, if you discover that menu shortcuts (for example, Alt-F to show the file menu) +are not working, check any EVT\_CHAR events you are handling in child windows. +If you are not calling {\tt event.Skip()} for events that you don't process in these event handlers, +menu shortcuts may cease to work. + \wxheading{See also} \helpref{wxMenu}{wxmenu}, \helpref{Event handling overview}{eventhandlingoverview} @@ -507,6 +516,9 @@ menu bar.} \pythonnote{Only the default constructor is supported in wxPython. Use wxMenuBar.Append instead.} +\perlnote{wxPerl only supports the first contructor: +use {\tt Append} instead.} + \membersection{wxMenuBar::\destruct{wxMenuBar}} \func{void}{\destruct{wxMenuBar}}{\void} @@ -527,7 +539,7 @@ Adds the item to the end of the menu bar. \wxheading{Return value} -TRUE on success, FALSE if an error occured. +TRUE on success, FALSE if an error occurred. \wxheading{See also} @@ -584,6 +596,15 @@ Enables or disables a whole menu. Only use this when the menu bar has been associated with a frame. +\membersection{wxMenuBar::FindMenu}\label{wxmenubarfindmenu} + +\constfunc{int}{FindMenu}{\param{const wxString\& }{title}} + +Returns the index of the menu with the given {\it title} or wxNOT\_FOUND if no +such menu exists in this menubar. The {\it title} parameter may specify either +the menu title (with accelerator characters, i.e. {\tt "\&File"}) or just the +menu label ({\tt "File"}) indifferently. + \membersection{wxMenuBar::FindMenuItem}\label{wxmenubarfindmenuitem} \constfunc{int}{FindMenuItem}{\param{const wxString\& }{menuString}, \param{const wxString\& }{itemString}} @@ -697,8 +718,8 @@ Returns the number of menus in this menubar. \func{bool}{Insert}{\param{size\_t }{pos}, \param{wxMenu *}{menu}, \param{const wxString\& }{title}} Inserts the menu at the given position into the menu bar. Inserting menu at -position $0$ will insert it in the very beginning of it, inserting at position -\helpref{GetMenuCount()}{wxmenubargetmenucount} is the same as calling +position $0$ will insert it in the very beginning of it, inserting at position +\helpref{GetMenuCount()}{wxmenubargetmenucount} is the same as calling \helpref{Append()}{wxmenubarappend}. \wxheading{Parameters} @@ -711,7 +732,7 @@ position $0$ will insert it in the very beginning of it, inserting at position \wxheading{Return value} -TRUE on success, FALSE if an error occured. +TRUE on success, FALSE if an error occurred. \wxheading{See also} @@ -756,7 +777,7 @@ Redraw the menu bar \func{wxMenu *}{Remove}{\param{size\_t }{pos}} Removes the menu from the menu bar and returns the menu object - the caller is -reposnbile for deleting it. This function may be used together with +reposnbile for deleting it. This function may be used together with \helpref{wxMenuBar::Insert}{wxmenubarinsert} to change the menubar dynamically. @@ -768,7 +789,7 @@ dynamically. \func{wxMenu *}{Replace}{\param{size\_t }{pos}, \param{wxMenu *}{menu}, \param{const wxString\& }{title}} -Replaces the menu at givenm position with another one. +Replaces the menu at the given position with another one. \wxheading{Parameters}