moved ConvertOSMenuResultToPPMenuResult() to the message pump

This commit is contained in:
pierre%netscape.com 1999-01-19 10:29:14 +00:00
Родитель 6ad1c5ab54
Коммит e7a85ea042
1 изменённых файлов: 0 добавлений и 30 удалений

Просмотреть файл

@ -84,32 +84,6 @@ enum
static nsNativeViewerApp* gTheApp;
static long ConvertOSMenuResultToPPMenuResult(long menuResult);
static long ConvertOSMenuResultToPPMenuResult(long menuResult)
{
// Convert MacOS menu item to PowerPlant menu item because
// in our sample app, we use Constructor for resource editing
long menuID = HiWord(menuResult);
long menuItem = LoWord(menuResult);
Int16** theMcmdH = (Int16**) ::GetResource('Mcmd', menuID);
if (theMcmdH != nil)
{
if (::GetHandleSize((Handle)theMcmdH) > 0)
{
Int16 numCommands = (*theMcmdH)[0];
if (numCommands >= menuItem)
{
CommandT* theCommandNums = (CommandT*)(&(*theMcmdH)[1]);
menuItem = theCommandNums[menuItem-1];
}
}
::ReleaseResource((Handle) theMcmdH);
}
menuResult = (menuID << 16) + menuItem;
return (menuResult);
}
#pragma mark -
//----------------------------------------------------------------------
@ -132,8 +106,6 @@ nsNativeViewerApp::Run()
void nsNativeViewerApp::DispatchMenuItemWithoutWindow(PRInt32 menuResult)
{
menuResult = ConvertOSMenuResultToPPMenuResult(menuResult);
long menuID = HiWord(menuResult);
long menuItem = LoWord(menuResult);
switch (menuID)
@ -200,8 +172,6 @@ nsNativeBrowserWindow::CreateMenuBar(PRInt32 aWidth)
nsEventStatus
nsNativeBrowserWindow::DispatchMenuItem(PRInt32 aID)
{
aID = ConvertOSMenuResultToPPMenuResult(aID);
PRInt32 xpID = 0;
long menuID = HiWord(aID);
long menuItem = LoWord(aID);