wxWindow* g_MacLastWindow = NULL ;
-static EventMouseButton lastButton = 0 ;
+EventMouseButton g_lastButton = 0 ;
-static void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
+void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent )
{
UInt32 modifiers = cEvent.GetParameter<UInt32>(kEventParamKeyModifiers, typeUInt32) ;
Point screenMouseLocation = cEvent.GetParameter<Point>(kEventParamMouseLocation) ;
button = kEventMouseButtonSecondary ;
// otherwise we report double clicks by connecting a left click with a ctrl-left click
- if ( clickCount > 1 && button != lastButton )
+ if ( clickCount > 1 && button != g_lastButton )
clickCount = 1 ;
// we must make sure that our synthetic 'right' button corresponds in
// mouse down, moved and mouse up, and does not deliver a right down and left up
if ( cEvent.GetKind() == kEventMouseDown )
- lastButton = button ;
+ g_lastButton = button ;
if ( button == 0 )
- lastButton = 0 ;
- else if ( lastButton )
- button = lastButton ;
+ g_lastButton = 0 ;
+ else if ( g_lastButton )
+ button = g_lastButton ;
// determine the correct down state, wx does not want a 'down' for a mouseUp event,
// while mac delivers this button
{
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
- // EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
+ EventMouseWheelAxis axis = cEvent.GetParameter<EventMouseWheelAxis>(kEventParamMouseWheelAxis, typeMouseWheelAxis) ;
SInt32 delta = cEvent.GetParameter<SInt32>(kEventParamMouseWheelDelta, typeSInt32) ;
wxevent.m_wheelRotation = delta;
wxevent.m_wheelDelta = 1;
wxevent.m_linesPerAction = 1;
+ if ( axis == kEventMouseWheelAxisX )
+ wxevent.m_wheelAxis = 1;
}
break ;
if ( wxevent.GetEventType() == wxEVT_LEFT_DOWN )
{
// ... that is set focus to this window
- if (currentMouseWindow->AcceptsFocus() && wxWindow::FindFocus()!=currentMouseWindow)
+ if (currentMouseWindow->CanAcceptFocus() && wxWindow::FindFocus()!=currentMouseWindow)
currentMouseWindow->SetFocus();
}
m_windowId = id == -1 ? NewControlId() : id;
wxWindow::SetLabel( title ) ;
- MacCreateRealWindow( title, pos , size , MacRemoveBordersFromStyle(style) , name ) ;
+ MacCreateRealWindow( title, pos , size , style , name ) ;
SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE));
return wxPoint(0, 0) ;
}
-void wxTopLevelWindowMac::SetIcon(const wxIcon& icon)
-{
- // this sets m_icon
- wxTopLevelWindowBase::SetIcon(icon);
-}
-
void wxTopLevelWindowMac::MacSetBackgroundBrush( const wxBrush &brush )
{
wxTopLevelWindowBase::MacSetBackgroundBrush( brush ) ;
wclass = kPlainWindowClass ;
}
}
+ else if ( HasFlag( wxPOPUP_WINDOW ) )
+ {
+ // TEMPORARY HACK!
+ // Until we've got a real wxPopupWindow class on wxMac make it a
+ // little easier for wxFrame to be used to emulate it and workaround
+ // the lack of wxPopupWindow.
+ if ( HasFlag( wxBORDER_NONE ) )
+ wclass = kHelpWindowClass ; // has no border
+ else
+ wclass = kPlainWindowClass ; // has a single line border, it will have to do for now
+ //attr |= kWindowNoShadowAttribute; // turn off the shadow Should we??
+ group = GetWindowGroupOfClass( // float above other windows
+ kFloatingWindowClass) ;
+ }
else if ( HasFlag( wxCAPTION ) )
{
wclass = kDocumentWindowClass ;
if ( HasFlag(wxSTAY_ON_TOP) )
group = GetWindowGroupOfClass(kUtilityWindowClass) ;
+ if ( HasFlag( wxFRAME_FLOAT_ON_PARENT ) )
+ group = GetWindowGroupOfClass(kFloatingWindowClass) ;
+
attr |= kWindowCompositingAttribute;
#if 0 // wxMAC_USE_CORE_GRAPHICS ; TODO : decide on overall handling of high dpi screens (pixel vs userscale)
attr |= kWindowFrameworkScaledAttribute;