X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b466e85a7e81db84545bc44c83cbe4ccacd4fe8e..b13d363b87017dbac11e74d11447288f17b62998:/src/osx/cocoa/notebook.mm diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index bf86c4fbdf..36abc047db 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -41,11 +41,8 @@ @interface wxNSTabView : NSTabView { - WXCOCOAIMPL_COMMON_MEMBERS } -WXCOCOAIMPL_COMMON_INTERFACE - @end @implementation wxTabViewController @@ -59,10 +56,11 @@ WXCOCOAIMPL_COMMON_INTERFACE - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem { wxNSTabView* view = (wxNSTabView*) tabView; - wxWidgetCocoaImpl* viewimpl = [view implementation]; + wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( view ); + if ( viewimpl ) { - wxNotebook* wxpeer = (wxNotebook*) viewimpl->GetWXPeer(); + // wxNotebook* wxpeer = (wxNotebook*) viewimpl->GetWXPeer(); } return YES; } @@ -71,11 +69,11 @@ WXCOCOAIMPL_COMMON_INTERFACE { wxNSTabView* view = (wxNSTabView*) tabView; - wxWidgetCocoaImpl* viewimpl = [view implementation]; + wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( view ); if ( viewimpl ) { wxNotebook* wxpeer = (wxNotebook*) viewimpl->GetWXPeer(); - wxpeer->HandleClicked(0); + wxpeer->OSXHandleClicked(0); } } @@ -83,7 +81,15 @@ WXCOCOAIMPL_COMMON_INTERFACE @implementation wxNSTabView -WXCOCOAIMPL_COMMON_IMPLEMENTATION ++ (void)initialize +{ + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } +} @end @@ -244,7 +250,6 @@ wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer, wxNSTabView* v = [[wxNSTabView alloc] initWithFrame:r]; [v setTabViewType:tabstyle]; wxWidgetCocoaImpl* c = new wxCocoaTabView( wxpeer, v ); - [v setImplementation:c]; [v setDelegate: controller]; return c; }