Binary compatible API fixes for menu label retrieval with and without

mnemonics/accelerators.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@48053 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-08-13 17:07:01 +00:00
parent 49ab1eb964
commit fb9c1ff9cb
38 changed files with 615 additions and 70 deletions

View File

@@ -108,6 +108,10 @@ All (GUI):
- Fixed wxXPMHandler::SaveFile for images with more than 92 colors.
- Fixed a crash in wxGrid on creation due to OnSize being called too soon.
- Added XRC handler for wxPropertySheetDialog (Sander Berents).
- API consistency fixes: added wxMenuBar::SetMenuLabel, wxMenuBar::GetMenuLabel,
wxMenuBar::GetMenuLabelText, wxMenu::GetLabelText, wxMenuItem::SetItemLabel,
wxMenuItem::GetItemLabel, wxMenuItem::GetItemLabelText, wxMenuItem::GetLabelText.
Retrieval of labels with and without mnemonics/accelerators is now possible.
wxMSW:

View File

@@ -423,7 +423,7 @@ item was not found.
\constfunc{wxString}{GetLabel}{\param{int}{ id}}
Returns a menu item label.
Returns a menu item label, including any mnemonics and accelerators.
\wxheading{Parameters}
@@ -435,7 +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}
@@ -958,6 +977,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}
@@ -977,6 +998,56 @@ Returns the menu at {\it menuIndex} (zero-based).
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 +1204,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}

View File

@@ -148,6 +148,31 @@ Returns the help string associated with the menu item.
Returns the menu item identifier.
\membersection{wxMenuItem::GetItemLabel}\label{wxmenuitemgetitemlabel}
\constfunc{wxString}{GetItemLabel}{\void}
Returns the text associated with the menu item including any accelerator
characters that were passed to the constructor or SetItemLabel.
\wxheading{See also}
\helpref{GetItemLabelText}{wxmenuitemgetitemlabeltext},
\helpref{GetLabelText}{wxmenuitemgetlabeltext}
\membersection{wxMenuItem::GetItemLabelText}\label{wxmenuitemgetitemlabeltext}
\constfunc{wxString}{GetItemLabelText}{\void}
Returns the text associated with the menu item, without any accelerator
characters.
\wxheading{See also}
\helpref{GetItemLabel}{wxmenuitemgetitemlabel},
\helpref{GetLabelText}{wxmenuitemgetlabeltext}
\membersection{wxMenuItem::GetKind}\label{wxmenuitemgetkind}
@@ -164,12 +189,33 @@ Returns the item kind, one of {\tt wxITEM\_SEPARATOR}, {\tt wxITEM\_NORMAL},
Returns the text associated with the menu item without any accelerator
characters it might contain.
This function is deprecated in favour of \helpref{GetItemLabelText}{wxmenuitemgetitemlabeltext}.
\wxheading{See also}
\helpref{GetText}{wxmenuitemgettext},
\helpref{GetLabelFromText}{wxmenuitemgetlabelfromtext}
\membersection{wxMenuItem::GetLabelText}\label{wxmenuitemgetlabeltext}
\func{static wxString}{GetLabelText}{\param{const wxString\& }{text}}
Strips all accelerator characters and mnemonics from the given {\it text}.
For example,
\begin{verbatim}
wxMenuItem::GetLabelFromText("&Hello\tCtrl-H");
\end{verbatim}
will return just {\tt "Hello"}.
\wxheading{See also}
\helpref{GetItemLabelText}{wxmenuitemgetitemlabeltext},
\helpref{GetItemLabel}{wxmenuitemgetitemlabel}
\membersection{wxMenuItem::GetLabelFromText}\label{wxmenuitemgetlabelfromtext}
\func{static wxString}{GetLabelFromText}{\param{const wxString\& }{text}}
@@ -183,12 +229,13 @@ wxMenuItem::GetLabelFromText("&Hello\tCtrl-H");
will return just {\tt "Hello"}.
This function is deprecated; please use \helpref{wxMenuItem::GetLabelText}{wxmenuitemgetlabeltext} instead.
\wxheading{See also}
\helpref{GetText}{wxmenuitemgettext},
\helpref{GetLabel}{wxmenuitemgetlabel}
\membersection{wxMenuItem::GetMarginWidth}\label{wxmenuitemgetmarginwidth}
\constfunc{int}{GetMarginWidth}{\void}
@@ -221,6 +268,8 @@ instead.
Returns the text associated with the menu item, such as it was passed to the
wxMenuItem constructor, i.e. with any accelerator characters it may contain.
This function is deprecated in favour of \helpref{GetItemLabel}{wxmenuitemgetitemlabel}.
\wxheading{See also}
\helpref{GetLabel}{wxmenuitemgetlabel},
@@ -314,6 +363,13 @@ Sets the font associated with the menu item (Windows only).
Sets the help string.
\membersection{wxMenuItem::SetItemLabel}\label{wxmenuitemsetitemlabel}
\func{void}{SetItemLabel}{\param{const wxString\& }{label}}
Sets the label associated with the menu item.
\membersection{wxMenuItem::SetMarginWidth}\label{wxmenuitemsetmarginwidth}
\constfunc{void}{SetMarginWidth}{\param{int}{ width}}
@@ -341,6 +397,8 @@ Sets the submenu of this menu item.
Sets the text associated with the menu item.
This function is deprecated in favour of \helpref{SetItemLabel}{wxmenuitemsetitemlabel}.
\membersection{wxMenuItem::SetTextColour}\label{wxmenuitemsettextcolour}