fix for items without accelerators

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4197 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-10-26 13:45:29 +00:00
parent af111fc338
commit 505928852c
2 changed files with 86 additions and 76 deletions

View File

@@ -810,6 +810,10 @@ static wxString GetHotKey( const wxMenuItem& item )
// as wxGetAccelFromString() looks for TAB, insert a dummy one here
wxString label;
label << wxT('\t') << item.GetHotKey();
// but if the hotkey is empty don't do anything
if ( label.length() > 1 )
{
wxAcceleratorEntry *accel = wxGetAccelFromString(label);
if ( accel )
{
@@ -852,9 +856,10 @@ static wxString GetHotKey( const wxMenuItem& item )
wxFAIL_MSG( wxT("unknown keyboard accel") );
}
}
if (accel)
delete accel;
}
}
return hotkey;
}

View File

@@ -810,6 +810,10 @@ static wxString GetHotKey( const wxMenuItem& item )
// as wxGetAccelFromString() looks for TAB, insert a dummy one here
wxString label;
label << wxT('\t') << item.GetHotKey();
// but if the hotkey is empty don't do anything
if ( label.length() > 1 )
{
wxAcceleratorEntry *accel = wxGetAccelFromString(label);
if ( accel )
{
@@ -852,9 +856,10 @@ static wxString GetHotKey( const wxMenuItem& item )
wxFAIL_MSG( wxT("unknown keyboard accel") );
}
}
if (accel)
delete accel;
}
}
return hotkey;
}