git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48029
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
void SetLabel(const wxString& text)
{
void SetLabel(const wxString& text)
{
+ m_originalLabel = text;
+
// remember the accel char (may be -1 if none)
m_indexAccel = wxControl::FindAccelIndex(text, &m_label);
// remember the accel char (may be -1 if none)
m_indexAccel = wxControl::FindAccelIndex(text, &m_label);
// accessors
const wxString& GetLabel() const { return m_label; }
// accessors
const wxString& GetLabel() const { return m_label; }
+ const wxString& GetOriginalLabel() const { return m_originalLabel; }
bool IsEnabled() const { return m_isEnabled; }
wxCoord GetWidth(wxMenuBar *menubar) const
{
bool IsEnabled() const { return m_isEnabled; }
wxCoord GetWidth(wxMenuBar *menubar) const
{
+ wxString m_originalLabel;
wxCoord m_width;
int m_indexAccel;
bool m_isEnabled;
wxCoord m_width;
int m_indexAccel;
bool m_isEnabled;
+ item->GetItemLabelText(),
item->GetAccelString(),
bmp,
flags,
item->GetAccelString(),
bmp,
flags,
int idxAccel = item->GetAccelIndex();
if ( idxAccel != -1 &&
int idxAccel = item->GetAccelIndex();
if ( idxAccel != -1 &&
- (wxChar)wxTolower(item->GetLabel()[(size_t)idxAccel])
+ (wxChar)wxTolower(item->GetItemLabelText()[(size_t)idxAccel])
== chAccel )
{
// ok, found an item with this accel
== chAccel )
{
// ok, found an item with this accel
{
wxCHECK_RET( pos < GetCount(), _T("invalid index in SetMenuLabel") );
{
wxCHECK_RET( pos < GetCount(), _T("invalid index in SetMenuLabel") );
- if ( label != m_menuInfos[pos].GetLabel() )
+ if ( label != m_menuInfos[pos].GetOriginalLabel() )
{
m_menuInfos[pos].SetLabel(label);
{
m_menuInfos[pos].SetLabel(label);
{
wxCHECK_MSG( pos < GetCount(), wxEmptyString, _T("invalid index in GetMenuLabel") );
{
wxCHECK_MSG( pos < GetCount(), wxEmptyString, _T("invalid index in GetMenuLabel") );
- return m_menuInfos[pos].GetLabel();
+ return m_menuInfos[pos].GetOriginalLabel();
}
// ----------------------------------------------------------------------------
}
// ----------------------------------------------------------------------------