move 8 copies of the same function to common code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54092 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -101,12 +101,6 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
|||||||
return new wxMenuItem(parentMenu, itemid, name, help, kind, subMenu);
|
return new wxMenuItem(parentMenu, itemid, name, help, kind, subMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxMenuItemCocoa::CocoaSetKeyEquivalent()
|
void wxMenuItemCocoa::CocoaSetKeyEquivalent()
|
||||||
{
|
{
|
||||||
wxAcceleratorEntry *accel = GetAccel();
|
wxAcceleratorEntry *accel = GetAccel();
|
||||||
|
@@ -125,6 +125,13 @@ void wxMenuItemBase::SetHelp(const wxString& str)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __WXPM__
|
||||||
|
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
||||||
|
{
|
||||||
|
return wxStripMenuCodes(text);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#if WXWIN_COMPATIBILITY_2_8
|
#if WXWIN_COMPATIBILITY_2_8
|
||||||
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
wxString wxMenuItemBase::GetLabelFromText(const wxString& text)
|
||||||
{
|
{
|
||||||
|
@@ -625,17 +625,6 @@ wxMenuItem::~wxMenuItem()
|
|||||||
// don't delete menu items, the menus take care of that
|
// don't delete menu items, the menus take care of that
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the menu item text without any menu accels
|
|
||||||
/* static */
|
|
||||||
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
// The argument to this function will now always be in wxWidgets standard label
|
|
||||||
// format, not GTK+ format, so we do what the other ports do.
|
|
||||||
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
void wxMenuItem::SetItemLabel( const wxString& str )
|
void wxMenuItem::SetItemLabel( const wxString& str )
|
||||||
{
|
{
|
||||||
#if wxUSE_ACCEL
|
#if wxUSE_ACCEL
|
||||||
|
@@ -751,47 +751,6 @@ wxMenuItem::~wxMenuItem()
|
|||||||
// don't delete menu items, the menus take care of that
|
// don't delete menu items, the menus take care of that
|
||||||
}
|
}
|
||||||
|
|
||||||
// return the menu item text without any menu accels
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
// The argument to this function will now always be in wxWidgets standard label
|
|
||||||
// format, not GTK+ format, so we do what the other ports do.
|
|
||||||
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
wxString label;
|
|
||||||
|
|
||||||
for ( const wxChar *pc = text.c_str(); *pc; pc++ )
|
|
||||||
{
|
|
||||||
if ( *pc == wxT('\t'))
|
|
||||||
break;
|
|
||||||
|
|
||||||
if ( *pc == wxT('_') )
|
|
||||||
{
|
|
||||||
// GTK 1.2 escapes "xxx_xxx" to "xxx__xxx"
|
|
||||||
pc++;
|
|
||||||
label += *pc;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( (*pc == wxT('&')) && (*(pc+1) != wxT('&')) )
|
|
||||||
{
|
|
||||||
// wxMSW escapes "&"
|
|
||||||
// "&" is doubled to indicate "&" instead of accelerator
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
label += *pc;
|
|
||||||
}
|
|
||||||
|
|
||||||
// wxPrintf( wxT("GetLabelText(): text %s label %s\n"), text.c_str(), label.c_str() );
|
|
||||||
|
|
||||||
return label;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
wxString wxMenuItem::GetItemLabel() const
|
wxString wxMenuItem::GetItemLabel() const
|
||||||
{
|
{
|
||||||
wxString label = wxConvertFromGTKToWXLabel(m_text);
|
wxString label = wxConvertFromGTKToWXLabel(m_text);
|
||||||
|
@@ -278,12 +278,6 @@ void wxMenuItem::SetRadioGroupEnd(int end)
|
|||||||
// wxMenuItemBase
|
// wxMenuItemBase
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
||||||
int id,
|
int id,
|
||||||
const wxString& name,
|
const wxString& name,
|
||||||
|
@@ -136,12 +136,6 @@ void wxMenuItem::Check(bool bDoCheck)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenuItemBase
|
// wxMenuItemBase
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -213,12 +213,6 @@ bool wxMenuItem::IsChecked() const
|
|||||||
return (flag & MF_CHECKED) != 0;
|
return (flag & MF_CHECKED) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
// radio group stuff
|
// radio group stuff
|
||||||
// -----------------
|
// -----------------
|
||||||
|
|
||||||
|
@@ -158,12 +158,6 @@ bool wxMenuItem::IsChecked() const
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
// radio group stuff
|
// radio group stuff
|
||||||
// -----------------
|
// -----------------
|
||||||
|
|
||||||
|
@@ -1519,12 +1519,6 @@ wxMenuItem *wxMenuItemBase::New(wxMenu *parentMenu,
|
|||||||
return new wxMenuItem(parentMenu, id, name, help, kind, subMenu);
|
return new wxMenuItem(parentMenu, id, name, help, kind, subMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */
|
|
||||||
wxString wxMenuItemBase::GetLabelText(const wxString& text)
|
|
||||||
{
|
|
||||||
return wxStripMenuCodes(text);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
// wxMenuItem operations
|
// wxMenuItem operations
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user