-
- }
- }
- else
- {
- doMacInMenuBar(::MenuSelect(m_event.where));
- }
-}
-
-void wxApp::doMacMouseUp(void)
-{
- if (m_mouseWindow)
- {
-#if 0
- int hitX = m_event.where.h; // screen window c.s.
- int hitY = m_event.where.v; // screen window c.s.
- m_mouseWindow->ScreenToClient(&hitX, &hitY); // mouseWindow client c.s.
- m_mouseWindow->ClientToLogical(&hitX, &hitY); // mouseWindow logical c.s.
-#endif
-
- wxMouseEvent event(wxEVT_LEFT_UP);
- event.m_shiftDown = m_event.modifiers & shiftKey;
- event.m_controlDown = m_event.modifiers & controlKey;
- event.m_altDown = m_event.modifiers & optionKey;
- event.m_metaDown = m_event.modifiers & cmdKey;
- event.m_leftDown = FALSE;
- event.m_middleDown = FALSE;
- event.m_rightDown = FALSE;
- event.m_x = m_event.where.h;
- event.m_y = m_event.where.v;
- event.m_timeStamp = m_event.when;
- event.SetEventObject(m_mouseWindow);
-
- m_mouseWindow->ProcessEvent(event);
- }
- else
- {
- //??? Can't we just throw away mouse up events without matching mouse down
- wxWindow* theMacWxFrame = wxFrame::MacFindFrameOrDialog(::FrontWindow());
- if (theMacWxFrame)
- {
-#if 0
- int hitX = cCurrentEvent.where.h; // screen window c.s.
- int hitY = cCurrentEvent.where.v; // screen window c.s.
- theMacWxFrame->ScreenToWindow(&hitX, &hitY);
-#endif
-
- wxMouseEvent event(wxEVT_LEFT_UP);
- event.m_shiftDown = m_event.modifiers & shiftKey;
- event.m_controlDown = m_event.modifiers & controlKey;
- event.m_altDown = m_event.modifiers & optionKey;
- event.m_metaDown = m_event.modifiers & cmdKey;
- event.m_leftDown = FALSE;
- event.m_middleDown = FALSE;
- event.m_rightDown = FALSE;
- event.m_x = m_event.where.h;
- event.m_y = m_event.where.v;
- event.m_timeStamp = m_event.when;
- event.SetEventObject(m_mouseWindow);
-
- theMacWxFrame->ProcessEvent(event);
- }
- }
-}
-
-void wxApp::doMacMouseMotion(void)
-{
- if (m_mouseWindow) {
- wxMouseEvent event(wxEVT_MOTION);
- event.m_shiftDown = m_event.modifiers & shiftKey;
- event.m_controlDown = m_event.modifiers & controlKey;
- event.m_altDown = m_event.modifiers & optionKey;
- event.m_metaDown = m_event.modifiers & cmdKey;
- event.m_leftDown = !(m_event.modifiers & btnState);
- event.m_middleDown = FALSE;
- event.m_rightDown = FALSE;
- event.m_x = m_event.where.h;
- event.m_y = m_event.where.v;
- event.m_timeStamp = m_event.when;
- event.SetEventObject(m_mouseWindow);
-
- m_mouseWindow->ProcessEvent(event);
- }
- else
- {
- wxWindow* theMacWxFrame = wxFrame::MacFindFrameOrDialog(::FrontWindow());
- if (theMacWxFrame)
- {
- wxMouseEvent event(wxEVT_MOTION);
- event.m_shiftDown = m_event.modifiers & shiftKey;
- event.m_controlDown = m_event.modifiers & controlKey;
- event.m_altDown = m_event.modifiers & optionKey;
- event.m_metaDown = m_event.modifiers & cmdKey;
- event.m_leftDown = !(m_event.modifiers & btnState);
- event.m_middleDown = FALSE;
- event.m_rightDown = FALSE;
- event.m_x = m_event.where.h;
- event.m_y = m_event.where.v;
- event.m_timeStamp = m_event.when;
- event.SetEventObject(m_mouseWindow);
-
- m_mouseWindow->ProcessEvent(event);
- }
- }
-
- //??? Need to work with floating windows... isn't there a toolbox call to find the
- // top window intersecting a point is screen coordinates??
-#if 0
- else // will only work for one floating window at the moment... ?
- {
- WindowPtr frontDocPtr = findFrontNonFloatingWindow();
- WindowPtr frontFloatingPtr = ::FrontWindow();
-
- int hitX = cCurrentEvent.where.h;
- int hitY = cCurrentEvent.where.v;
-
- wxFrame* macWxFrame = findMacWxFrame(frontDocPtr);
-
- if ((frontFloatingPtr != frontDocPtr) & (frontFloatingPtr != NULL))
- {
- RgnHandle frontFloatStrRgn = getStructureRegion(frontFloatingPtr);
- Rect frontFloatRect = (**frontFloatStrRgn).rgnBBox;
-
- if ((hitX >= frontFloatRect.left) &
- (hitX <= frontFloatRect.right) &
- (hitY >= frontFloatRect.top) &
- (hitY <= frontFloatRect.bottom))