The constructor takes a nsMacWindow instead of a nsWindow. Removed HandleDiskEvent(): disk events are handled in our message pump or left to the embedding apps.

This commit is contained in:
pierre%netscape.com 1999-05-14 10:14:46 +00:00
Родитель e88056bb38
Коммит 019c19fdbd
2 изменённых файлов: 10 добавлений и 24 удалений

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

@ -19,6 +19,7 @@
#include "nsMacEventHandler.h"
#include "nsWindow.h"
#include "nsMacWindow.h"
#include "nsToolkit.h"
#include "prinrval.h"
@ -41,7 +42,7 @@ PRBool nsMacEventHandler::mInBackground = PR_FALSE;
// nsMacEventHandler constructor/destructor
//
//-------------------------------------------------------------------------
nsMacEventHandler::nsMacEventHandler(nsWindow* aTopLevelWidget)
nsMacEventHandler::nsMacEventHandler(nsMacWindow* aTopLevelWidget)
{
mTopLevelWidget = aTopLevelWidget;
mLastWidgetHit = nsnull;
@ -103,10 +104,6 @@ PRBool nsMacEventHandler::HandleOSEvent ( EventRecord& aOSEvent )
retVal = HandleMouseUpEvent(aOSEvent);
break;
case diskEvt:
retVal = HandleDiskEvent(aOSEvent);
break;
case osEvt:
unsigned char eventType = ((aOSEvent.message >> 24) & 0x00ff);
if (eventType == suspendResumeMessage)
@ -191,8 +188,12 @@ PRBool nsMacEventHandler::HandleMenuCommand(
}
//-------------------------------------------------------------------------
//
// DropOccurred
//
//-------------------------------------------------------------------------
//
// Someone on the outside told us that a drop from the DragManager has occurred in
// this window. We need to send this event into Gecko for processing. Create a Gecko
@ -264,7 +265,7 @@ printf("dispatching drop into Gecko\n");
//-------------------------------------------------------------------------
//
// HandleKeyEvent
// ConvertMacToRaptorKeyCode
//
//-------------------------------------------------------------------------
@ -744,21 +745,6 @@ PRBool nsMacEventHandler::HandleMouseMoveEvent(
return retVal;
}
//-------------------------------------------------------------------------
PRBool nsMacEventHandler::HandleDiskEvent(const EventRecord& anEvent)
//-------------------------------------------------------------------------
{
if (HiWord(anEvent.message) != noErr)
{
// Error mounting disk. Ask if user wishes to format it.
Point pt = {120, 120}; // System 7 will auto-center dialog
::DILoad();
::DIBadMount(pt, (SInt32) anEvent.message);
::DIUnload();
}
return PR_TRUE;
}
#pragma mark -
//-------------------------------------------------------------------------

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

@ -25,11 +25,12 @@
#include "nsGUIEvent.h"
class nsWindow;
class nsMacWindow;
class nsMacEventHandler : public nsDeleteObserver
{
public:
nsMacEventHandler(nsWindow* aTopLevelWidget);
nsMacEventHandler(nsMacWindow* aTopLevelWidget);
virtual ~nsMacEventHandler();
virtual PRBool HandleOSEvent(EventRecord& aOSEvent);
@ -46,7 +47,6 @@ protected:
virtual PRBool HandleMouseDownEvent(EventRecord& aOSEvent);
virtual PRBool HandleMouseUpEvent(EventRecord& aOSEvent);
virtual PRBool HandleMouseMoveEvent(EventRecord& aOSEvent);
virtual PRBool HandleDiskEvent(const EventRecord& anEvent);
virtual void ConvertOSEventToMouseEvent(
EventRecord& aOSEvent,
@ -57,7 +57,7 @@ public:
virtual void NotifyDelete(void* aDeletedObject);
protected:
nsWindow* mTopLevelWidget;
nsMacWindow* mTopLevelWidget;
nsWindow* mLastWidgetHit;
PRBool mMouseInWidgetHit;
nsWindow* mLastWidgetPointed;