static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param);
+void SetupMouseEvent( wxMouseEvent &wxevent , wxMacCarbonEvent &cEvent );
// ---------------------------------------------------------------------------
// Carbon Events
break ;
}
break ;
-
- case kEventMouseWheelMoved :
+ // TODO http://developer.apple.com/qa/qa2005/qa1453.html
+ // add declaration for 10.4 and change to kEventMouseScroll
+ case kEventMouseWheelMoved :
{
wxevent.SetEventType( wxEVT_MOUSEWHEEL ) ;
// mix this in from window.cpp
pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) ;
-pascal OSStatus wxNonOwnedEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
+static pascal OSStatus wxNonOwnedEventHandler( EventHandlerCallRef handler , EventRef event , void *data )
{
OSStatus result = eventNotHandledErr ;
m_macEventHandler = NULL ;
}
- if ( m_macWindow )
+ if ( m_macWindow && !m_wxPeer->IsNativeWindowWrapper())
DisposeWindow( m_macWindow );
FullScreenData *data = (FullScreenData *) m_macFullScreenData ;
}
}
-void wxNonOwnedWindowInstallTopLevelWindowEventHandler(WindowRef window, EventHandlerRef* handler, void *ref)
+static void wxNonOwnedWindowInstallTopLevelWindowEventHandler(WindowRef window, EventHandlerRef* handler, void *ref)
{
InstallWindowEventHandler(window, GetwxNonOwnedEventHandlerUPP(),
GetEventTypeCount(eventList), eventList, ref, handler );
}
void wxNonOwnedWindowCarbonImpl::Create(
- wxWindow* parent,
- const wxPoint& pos,
- const wxSize& size,
- long style, long extraStyle,
- const wxString& WXUNUSED(name) )
+ wxWindow* WXUNUSED(parent),
+ WXWindow nativeWindow )
+{
+ m_macWindow = nativeWindow;
+}
+
+void wxNonOwnedWindowCarbonImpl::Create(
+ wxWindow* parent,
+ const wxPoint& pos,
+ const wxSize& size,
+ long style, long extraStyle,
+ const wxString& WXUNUSED(name) )
{
OSStatus err = noErr ;
customWindowDefSpec.defType = kWindowDefProcPtr;
customWindowDefSpec.u.defProc =
#ifdef __LP64__
- (WindowDefUPP) wxShapedMacWindowDef;
+ (WindowDefUPP) wxShapedMacWindowDef;
#else
- NewWindowDefUPP(wxShapedMacWindowDef);
+ NewWindowDefUPP(wxShapedMacWindowDef);
#endif
err = ::CreateCustomWindow( &customWindowDefSpec, wclass,
- attr, &theBoundsRect,
- (WindowRef*) &m_macWindow);
+ attr, &theBoundsRect,
+ (WindowRef*) &m_macWindow);
}
else
{
now->Create( parent, pos, size, style , extraStyle, name );
return now;
}
+
+wxNonOwnedWindowImpl* wxNonOwnedWindowImpl::CreateNonOwnedWindow( wxNonOwnedWindow* wxpeer, wxWindow* parent, WXWindow nativeWindow )
+{
+ wxNonOwnedWindowCarbonImpl* now = new wxNonOwnedWindowCarbonImpl( wxpeer );
+ now->Create( parent, nativeWindow );
+ return now;
+}
+