]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/databrow.cpp
correction to last commit: Korean and Romanian translations will only be in 2.9.1...
[wxWidgets.git] / src / osx / carbon / databrow.cpp
index d84ee4ba2c37dee2b21406493e9d9d2b04fc3e5e..e202a9dc9553e74aec6bea0061879e083726bb35 100644 (file)
@@ -972,7 +972,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
         {
          // initialize wxWidget event:
           wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED,dataViewCtrlPtr->GetId()); // variable definition
-
+          dataViewEvent.SetItem( dataViewCtrlPtr->GetSelection() );
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetModel      (dataViewCtrlPtr->GetModel());
          // finally send the equivalent wxWidget event:
@@ -1030,7 +1030,12 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
     } /* switch */
 } /* wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(DataBrowserItemID, DataBrowserItemNotification, DataBrowserItemDataRef) */
 
-void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, DataBrowserItemState state, Rect const* rectangle, SInt16 bitDepth, Boolean colorDevice)
+void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItemID itemID, 
+                                DataBrowserPropertyID propertyID, 
+                                DataBrowserItemState state, 
+                                Rect const* rectangle, 
+                                SInt16 WXUNUSED(bitDepth), 
+                                Boolean WXUNUSED(colorDevice))
 {
   DataBrowserTableViewColumnIndex columnIndex;
 
@@ -1059,14 +1064,19 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowse
 
  // try to determine the content's size (drawable part):
   Rect      content;
-  RgnHandle rgn(NewRgn());
+  HIShapeRef rgn = NULL;
+  
   UInt16    headerHeight;
 
-  if (this->GetRegion(kControlContentMetaPart,rgn) == noErr)
-    GetRegionBounds(rgn,&content);
+  if ( HIViewCopyShape(m_controlRef, kHIViewContentMetaPart, &rgn) == noErr)
+  {
+    CGRect cgrect;
+    HIShapeGetBounds(rgn, &cgrect);
+    content = (Rect){ cgrect.origin.y, cgrect.origin.x, cgrect.origin.y+cgrect.size.height, cgrect.origin.x+cgrect.size.width };
+    CFRelease(rgn);
+  }
   else
     GetControlBounds(m_controlRef, &content);
-  ::DisposeRgn(rgn);
  // space for the header
   this->GetHeaderButtonHeight(&headerHeight);
   content.top += headerHeight;
@@ -1124,7 +1134,11 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowse
   dataViewCustomRendererPtr->SetDC(NULL);
 } /* wxMacDataViewDataBrowserListViewControl::DataBrowserDrawItemProc(DataBrowserItemID, DataBrowserPropertyID, DataBrowserItemState, Rect const*, SInt16, Boolean) */
 
-Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserEditItemProc(DataBrowserItemID itemID, DataBrowserPropertyID propertyID, CFStringRef theString, Rect* maxEditTextRect, Boolean* shrinkToFit)
+Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserEditItemProc(DataBrowserItemID WXUNUSED(itemID), 
+                                        DataBrowserPropertyID WXUNUSED(propertyID), 
+                                        CFStringRef WXUNUSED(theString), 
+                                        Rect* WXUNUSED(maxEditTextRect), 
+                                        Boolean* WXUNUSED(shrinkToFit))
 {
   return false;
 } /* wxMacDataViewDataBrowserListViewControl::DataBrowserEditItemProc(DataBrowserItemID, DataBrowserPropertyID, CFStringRef, Rect*, Boolean*) */