]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/cocoa/notebook.mm
Add wxDataViewCtrl::SetRowHeight() and provide its generic implementation.
[wxWidgets.git] / src / osx / cocoa / notebook.mm
index 36abc047db64ffafc2c02cd4a22c3c116668597d..2adea3cbbc6dbb0aa35991fbdd71b3f0b59632ec 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Stefan Csomor
 // Modified by:
 // Created:     1998-01-01
-// RCS-ID:      $Id: notebmac.cpp 55079 2008-08-13 14:56:42Z PC $
+// RCS-ID:      $Id$
 // Copyright:   (c) Stefan Csomor
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -30,7 +30,7 @@
 // controller
 //
 
-@interface wxTabViewController : NSObject
+@interface wxTabViewController : NSObject wxOSX_10_6_AND_LATER(<NSTabViewDelegate>)
 {
 }
 
@@ -55,6 +55,7 @@
 
 - (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem
 {
+    wxUnusedVar(tabViewItem);
     wxNSTabView* view = (wxNSTabView*) tabView;
     wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( view );
 
@@ -65,9 +66,9 @@
     return YES;
 }
 
-- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem;
-
+- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem
 {
+    wxUnusedVar(tabViewItem);
     wxNSTabView* view = (wxNSTabView*) tabView;
     wxWidgetCocoaImpl* viewimpl = (wxWidgetCocoaImpl* ) wxWidgetImpl::FindFromWXWidget( view );
     if ( viewimpl )
@@ -84,7 +85,7 @@
 + (void)initialize
 {
     static BOOL initialized = NO;
-    if (!initialized) 
+    if (!initialized)
     {
         initialized = YES;
         wxOSXCocoaClassAddWXMethods( self );
@@ -99,18 +100,18 @@ public:
     wxCocoaTabView( wxWindowMac* peer , WXWidget w ) : wxWidgetCocoaImpl(peer, w)
     {
     }
-    
-    void GetContentArea( int &left , int &top , int &width , int &height ) const 
+
+    void GetContentArea( int &left , int &top , int &width , int &height ) const
     {
         wxNSTabView* slf = (wxNSTabView*) m_osxView;
         NSRect r = [slf contentRect];
-        left = r.origin.x;
-        top = r.origin.y;
-        width = r.size.width;
-        height = r.size.height;
+        left = (int)r.origin.x;
+        top = (int)r.origin.y;
+        width = (int)r.size.width;
+        height = (int)r.size.height;
     }
-    
-    void SetValue( wxInt32 value ) 
+
+    void SetValue( wxInt32 value )
     {
         wxNSTabView* slf = (wxNSTabView*) m_osxView;
         // avoid 'changed' events when setting the tab programmatically
@@ -119,7 +120,7 @@ public:
         [slf selectTabViewItemAtIndex:(value-1)];
         [slf setDelegate:controller];
     }
-    
+
     wxInt32 GetValue() const
     {
         wxNSTabView* slf = (wxNSTabView*) m_osxView;
@@ -129,7 +130,7 @@ public:
         else
             return [slf indexOfTabViewItem:selectedItem]+1;
     }
-    
+
     void SetMaximum( wxInt32 maximum )
     {
         wxNSTabView* slf = (wxNSTabView*) m_osxView;
@@ -137,7 +138,7 @@ public:
         // avoid 'changed' events when setting the tab programmatically
         wxTabViewController* controller = [slf delegate];
         [slf setDelegate:nil];
-        
+
         if ( maximum > cocoacount )
         {
             for ( int i = cocoacount ; i < maximum ; ++i )
@@ -161,9 +162,9 @@ public:
     void SetupTabs( const wxNotebook& notebook)
     {
         int pcount = notebook.GetPageCount();
-        
+
         SetMaximum( pcount );
-        
+
         for ( int i = 0 ; i < pcount ; ++i )
         {
             wxNotebookPage* page = notebook.GetPage(i);
@@ -174,7 +175,7 @@ public:
             if ( notebook.GetImageList() && notebook.GetPageImage(i) >= 0 )
             {
                 const wxBitmap bmap = notebook.GetImageList()->GetBitmap( notebook.GetPageImage( i ) ) ;
-                if ( bmap.Ok() )
+                if ( bmap.IsOk() )
                 {
                     // TODO how to set an image on a tab
                 }
@@ -220,17 +221,17 @@ public:
     m_peer = new wxMacControl( this );
     OSStatus err = CreateTabsControl(
         MAC_WXHWND(parent->MacGetTopLevelWindowRef()), &bounds,
-        tabsize, tabstyle, 0, NULL, m_peer->GetControlRefAddr() );
+        tabsize, tabstyle, 0, NULL, GetPeer()->GetControlRefAddr() );
     verify_noerr( err );
 #endif
 */
-wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer, 
-                                    wxWindowMac* parent, 
-                                    wxWindowID id, 
-                                    const wxPoint& pos, 
+wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
+                                    wxWindowMac* WXUNUSED(parent),
+                                    wxWindowID WXUNUSED(id),
+                                    const wxPoint& pos,
                                     const wxSize& size,
-                                    long style, 
-                                    long extraStyle)
+                                    long style,
+                                    long WXUNUSED(extraStyle))
 {
     static wxTabViewController* controller = NULL;
 
@@ -238,7 +239,7 @@ wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
         controller =[[wxTabViewController alloc] init];
 
     NSRect r = wxOSXGetFrameForControl( wxpeer, pos , size ) ;
-    
+
     NSTabViewType tabstyle = NSTopTabsBezelBorder;
     if ( style & wxBK_LEFT )
         tabstyle = NSLeftTabsBezelBorder;
@@ -246,7 +247,7 @@ wxWidgetImplType* wxWidgetImpl::CreateTabView( wxWindowMac* wxpeer,
         tabstyle = NSRightTabsBezelBorder;
     else if ( style & wxBK_BOTTOM )
         tabstyle = NSBottomTabsBezelBorder;
-    
+
     wxNSTabView* v = [[wxNSTabView alloc] initWithFrame:r];
     [v setTabViewType:tabstyle];
     wxWidgetCocoaImpl* c = new wxCocoaTabView( wxpeer, v );