Settle on one shortcut key utility proc.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -324,7 +324,6 @@ bool wxMenu::DoInsertOrAppend(
|
|||||||
//
|
//
|
||||||
// Menu is just a normal string (passed in data parameter)
|
// Menu is just a normal string (passed in data parameter)
|
||||||
//
|
//
|
||||||
wxSetShortCutKey((wxChar*)pItem->GetText().c_str());
|
|
||||||
vItem.afStyle |= MIS_TEXT;
|
vItem.afStyle |= MIS_TEXT;
|
||||||
pData = (char*)pItem->GetText().c_str();
|
pData = (char*)pItem->GetText().c_str();
|
||||||
}
|
}
|
||||||
@@ -913,8 +912,6 @@ bool wxMenuBar::Append(
|
|||||||
|
|
||||||
wxCHECK_MSG(hSubmenu, FALSE, wxT("can't append invalid menu to menubar"));
|
wxCHECK_MSG(hSubmenu, FALSE, wxT("can't append invalid menu to menubar"));
|
||||||
|
|
||||||
wxSetShortCutKey((wxChar*)rTitle.c_str());
|
|
||||||
|
|
||||||
wxString Title = TextToLabel(rTitle);
|
wxString Title = TextToLabel(rTitle);
|
||||||
if (!wxMenuBarBase::Append(pMenu, Title))
|
if (!wxMenuBarBase::Append(pMenu, Title))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@@ -1074,23 +1071,4 @@ wxMenuItem* wxMenuBar::FindItem(
|
|||||||
return pItem;
|
return pItem;
|
||||||
} // end of wxMenuBar::FindItem
|
} // end of wxMenuBar::FindItem
|
||||||
|
|
||||||
//
|
|
||||||
// wxWindows' default shortcut identifier is WIN32's "&" but
|
|
||||||
// OS2's is "~" so we have to change this and must watch for the
|
|
||||||
// sequence, "&&" converting only the first one
|
|
||||||
//
|
|
||||||
void wxSetShortCutKey(
|
|
||||||
wxChar* zText
|
|
||||||
)
|
|
||||||
{
|
|
||||||
for (int i = 0; zText[i] != '\0'; i++)
|
|
||||||
{
|
|
||||||
if (zText[i] == '&')
|
|
||||||
{
|
|
||||||
zText[i] = '~';
|
|
||||||
if (zText[i+1] == '&')
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user