]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/notebook.mm
fixing native font info support bugs
[wxWidgets.git] / src / osx / cocoa / notebook.mm
index bf86c4fbdf8f6f4dcea22f93c6a932bcf36d5dbc..05bce718e85e42ea94fa12cb67287331375711ad 100644 (file)
 
 @interface wxNSTabView : NSTabView
 {
-    WXCOCOAIMPL_COMMON_MEMBERS
 }
 
-WXCOCOAIMPL_COMMON_INTERFACE
-
 @end
 
 @implementation wxTabViewController
@@ -58,11 +55,13 @@ WXCOCOAIMPL_COMMON_INTERFACE
 
 - (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;
 }
@@ -70,12 +69,13 @@ WXCOCOAIMPL_COMMON_INTERFACE
 - (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);
     }
 }
 
@@ -83,7 +83,15 @@ WXCOCOAIMPL_COMMON_INTERFACE
 
 @implementation wxNSTabView
 
-WXCOCOAIMPL_COMMON_IMPLEMENTATION
++ (void)initialize
+{
+    static BOOL initialized = NO;
+    if (!initialized) 
+    {
+        initialized = YES;
+        wxOSXCocoaClassAddWXMethods( self );
+    }
+}
 
 @end
 
@@ -219,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;
 
@@ -244,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;
 }