X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c4825ef73a5f190b8f39c59df098c3f39fa4464b..c443ff6f5350df36902af42d0193e53d79dd6a14:/src/osx/cocoa/notebook.mm diff --git a/src/osx/cocoa/notebook.mm b/src/osx/cocoa/notebook.mm index d4acf6b320..05bce718e8 100644 --- a/src/osx/cocoa/notebook.mm +++ b/src/osx/cocoa/notebook.mm @@ -41,13 +41,8 @@ @interface wxNSTabView : NSTabView { - wxWidgetCocoaImpl* impl; } -- (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation; -- (wxWidgetCocoaImpl*) implementation; -- (BOOL) isFlipped; - @end @implementation wxTabViewController @@ -60,11 +55,13 @@ - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem { + wxUnusedVar(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; } @@ -72,12 +69,13 @@ - (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; { + wxUnusedVar(tabViewItem); 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); } } @@ -85,19 +83,14 @@ @implementation wxNSTabView -- (void)setImplementation: (wxWidgetCocoaImpl *) theImplementation -{ - impl = theImplementation; -} - -- (wxWidgetCocoaImpl*) implementation ++ (void)initialize { - return impl; -} - -- (BOOL) isFlipped -{ - return YES; + static BOOL initialized = NO; + if (!initialized) + { + initialized = YES; + wxOSXCocoaClassAddWXMethods( self ); + } } @end @@ -234,12 +227,12 @@ public: #endif */ wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer, - wxWindowMac* parent, - wxWindowID id, + wxWindowMac* WXUNUSED(parent), + wxWindowID WXUNUSED(id), const wxPoint& pos, const wxSize& size, long style, - long extraStyle) + long WXUNUSED(extraStyle)) { static wxTabViewController* controller = NULL; @@ -259,7 +252,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; }