From: Vadim Zeitlin Date: Tue, 22 Feb 2000 10:17:32 +0000 (+0000) Subject: 1. wxMenuBar::FindMenu() made "const" X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/270e8b6a371c711a26741aa6fc7c9cca88b77d5b 1. wxMenuBar::FindMenu() made "const" 2. documented it 3. documented recent change to wxYield() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index 701ccea152..bfd6094c88 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -1831,8 +1831,8 @@ See also \helpref{wxGetResource}{wxgetresource}, \helpref{wxConfigBase}{wxconfig Yields control to pending messages in the windowing system. This can be useful, for example, when a time-consuming process writes to a text window. Without an occasional -yield, the text window will not be updated properly, and (since Windows -multitasking is cooperative) other processes will not respond. +yield, the text window will not be updated properly, and on systems with +cooperative multitasking, such as Windows 3.1 other processes will not respond. Caution should be exercised, however, since yielding may allow the user to perform actions which are not compatible with the current task. @@ -1840,6 +1840,12 @@ Disabling menu items or whole menus during processing can avoid unwanted reentrance of code: see \helpref{::wxSafeYield}{wxsafeyield} for a better function. +Note that wxYield will not flush the message logs. This is intentional as +calling wxYield is usually done to quickly update the screen and popping up a +message box dialog may be undesirable. If you do with to flush the log +messages immediately (otherwise it will be done during the next idle loop +iteration), call \helpref{wxLog::FlushActive}{wxlogflushactive}. + \wxheading{Include files} or diff --git a/docs/latex/wx/menu.tex b/docs/latex/wx/menu.tex index 4f8faa2abb..86c3d66860 100644 --- a/docs/latex/wx/menu.tex +++ b/docs/latex/wx/menu.tex @@ -584,6 +584,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}} diff --git a/include/wx/menu.h b/include/wx/menu.h index cf5e6b3f93..c297b599a6 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -298,7 +298,7 @@ public: virtual wxMenuItem* FindItem(int id, wxMenu **menu = NULL) const = 0; // find menu by its caption, return wxNOT_FOUND on failure - int FindMenu(const wxString& title); + int FindMenu(const wxString& title) const; // item access // ----------- diff --git a/src/common/menucmn.cpp b/src/common/menucmn.cpp index 5fa6e0723b..2bfaaf2d8a 100644 --- a/src/common/menucmn.cpp +++ b/src/common/menucmn.cpp @@ -544,7 +544,7 @@ wxMenu *wxMenuBarBase::Remove(size_t pos) return menu; } -int wxMenuBarBase::FindMenu(const wxString& title) +int wxMenuBarBase::FindMenu(const wxString& title) const { wxString label = wxMenuItem::GetLabelFromText(title);