use new menu bar (no more mercutio)

This commit is contained in:
pinkerton%netscape.com 1998-09-29 17:32:35 +00:00
Родитель 4a1839cccf
Коммит 3a96148b35
2 изменённых файлов: 31 добавлений и 5 удалений

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

@ -43,6 +43,7 @@
#include <LGARadioButton.h> #include <LGARadioButton.h>
#include <LGACheckbox.h> #include <LGACheckbox.h>
#include <LAppearanceMBAR.h>
// macfe // macfe
//#include "NavigationServicesSupport.h" //#include "NavigationServicesSupport.h"
@ -1861,11 +1862,12 @@ void CFrontApp::OpenBookmarksFile( FSSpec* inFileSpec, CBrowserWindow * /*win*/,
{ {
Try_ Try_
{ {
vector<char> url(500); const int kBufferLen = 500;
vector<char> url (kBufferLen);
OSErr err = ReadBookmarksFile(url, *inFileSpec); OSErr err = ReadBookmarksFile(url, *inFileSpec);
ThrowIfOSErr_(err); ThrowIfOSErr_(err);
URL_Struct * request = NET_CreateURLStruct( url.begin(), NET_DONT_RELOAD ); URL_Struct * request = NET_CreateURLStruct( &(*url.begin()), NET_DONT_RELOAD );
CURLDispatcher::DispatchURL(request, NULL); CURLDispatcher::DispatchURL(request, NULL);
} }
Catch_(inErr) Catch_(inErr)
@ -1954,6 +1956,23 @@ void CFrontApp::PrintDocument(FSSpec* inFileSpec)
PrintDocument( inFileSpec ); PrintDocument( inFileSpec );
} }
//
// MakeMenuBar
//
// Overidden to make an appearance-savvy menu bar.
//
void
CFrontApp::MakeMenuBar()
{
if ( UEnvironment::HasFeature( env_HasAppearance ) )
new LAppearanceMBAR(MBAR_Initial);
else
new LMenuBar(MBAR_Initial);
LMenuBar::GetCurrentMenuBar()->SetModifierKeys ( cmdKey | shiftKey );
}
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
// ¥ ClickMenuBar // ¥ ClickMenuBar
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
@ -3198,7 +3217,6 @@ void CFrontApp::DoHelpMenuItem( short itemNum )
} }
} }
extern pascal long MDEF_MenuKey( long theMessage, short theModifiers, MenuHandle hMenu );
//----------------------------------- //-----------------------------------
void CFrontApp::EventKeyDown( const EventRecord& inMacEvent ) void CFrontApp::EventKeyDown( const EventRecord& inMacEvent )
@ -3236,6 +3254,13 @@ void CFrontApp::EventKeyDown( const EventRecord& inMacEvent )
CTargetedUpdateMenuRegistry::SetCommands(CFrontApp::GetCommandsToUpdateBeforeSelectingMenu()); CTargetedUpdateMenuRegistry::SetCommands(CFrontApp::GetCommandsToUpdateBeforeSelectingMenu());
CTargetedUpdateMenuRegistry::UpdateMenus(); CTargetedUpdateMenuRegistry::UpdateMenus();
// MacOS8 can do the weird key combos for us w/out Mercutio.
SInt32 unused;
LAppearanceMBAR* bar = dynamic_cast<LAppearanceMBAR*>(LMenuBar::GetCurrentMenuBar());
if ( bar )
keyCommand = bar->FindKeyCommand ( inMacEvent, unused );
#if 0
menuChoice = MDEF_MenuKey( menuChoice = MDEF_MenuKey(
inMacEvent.message, inMacEvent.message,
inMacEvent.modifiers, ::GetMenu( 666 ) ); inMacEvent.modifiers, ::GetMenu( 666 ) );
@ -3258,6 +3283,7 @@ void CFrontApp::EventKeyDown( const EventRecord& inMacEvent )
keyCommand = LMenuBar::GetCurrentMenuBar()->FindCommand( keyCommand = LMenuBar::GetCurrentMenuBar()->FindCommand(
HiWord(menuChoice), HiWord(menuChoice),
LoWord(menuChoice)); LoWord(menuChoice));
#endif
} }
} }
SignalIf_(LCommander::GetTarget() == nil); SignalIf_(LCommander::GetTarget() == nil);

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

@ -144,8 +144,8 @@ public:
return sCommandsToUpdateBeforeSelectingMenu; return sCommandsToUpdateBeforeSelectingMenu;
} }
virtual void MakeMenuBar();
virtual void ClickMenuBar(const EventRecord& inMacEvent); virtual void ClickMenuBar(const EventRecord& inMacEvent);
virtual void SetMenubar( ResIDT mbar, Boolean inUpdateNow = false ); // If appleMenu is 0, do not rebuild it virtual void SetMenubar( ResIDT mbar, Boolean inUpdateNow = false ); // If appleMenu is 0, do not rebuild it
virtual void UpdateMenus(); virtual void UpdateMenus();
void UpdateHierarchicalMenus(); void UpdateHierarchicalMenus();