]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/dataview.cpp
use correct scale when drawing
[wxWidgets.git] / src / osx / carbon / dataview.cpp
index 13765f900dfddc9d6fc126e9671f16b3bf5ec936..e0a91af6b605f27c38917ef77249c3ddd9f3d79b 100644 (file)
@@ -99,7 +99,7 @@ static pascal OSStatus DataBrowserCtrlEventHandler(EventHandlerCallRef handler,
         unsigned long         columnIndex;
         wxDataViewColumn*     column;
         OSStatus              status;
         unsigned long         columnIndex;
         wxDataViewColumn*     column;
         OSStatus              status;
-        wxDataViewEvent       DataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK,DataViewCtrlPtr->GetId());
+        wxDataViewEvent       DataViewEvent(wxEVT_DATAVIEW_COLUMN_HEADER_CLICK,DataViewCtrlPtr->GetId());
 
         CarbonEvent.GetParameter(kEventParamDirectObject,&controlReference);
        // determine the column that triggered the event (this is the column that is responsible for sorting the data view):
 
         CarbonEvent.GetParameter(kEventParamDirectObject,&controlReference);
        // determine the column that triggered the event (this is the column that is responsible for sorting the data view):
@@ -1102,6 +1102,12 @@ wxDataViewItem wxMacDataViewDataBrowserListViewControl::GetCurrentItem() const
     return wxDataViewItem();
 }
 
     return wxDataViewItem();
 }
 
+wxDataViewColumn *wxMacDataViewDataBrowserListViewControl::GetCurrentColumn() const
+{
+    wxFAIL_MSG( "unimplemented for Carbon" );
+    return NULL;
+}
+
 void wxMacDataViewDataBrowserListViewControl::SetCurrentItem(const wxDataViewItem& WXUNUSED(item))
 {
     wxFAIL_MSG( "unimplemented for Carbon" );
 void wxMacDataViewDataBrowserListViewControl::SetCurrentItem(const wxDataViewItem& WXUNUSED(item))
 {
     wxFAIL_MSG( "unimplemented for Carbon" );
@@ -1253,7 +1259,7 @@ void wxMacDataViewDataBrowserListViewControl::OnSize()
     SetHasScrollBars(true,true);
 }
 
     SetHasScrollBars(true,true);
 }
 
-void wxMacDataViewDataBrowserListViewControl::StartEditor( const wxDataViewItem & item, unsigned int column )
+void wxMacDataViewDataBrowserListViewControl::StartEditor( const wxDataViewItem & WXUNUSED(item), unsigned int WXUNUSED(column) )
 {
     // implement me
 }
 {
     // implement me
 }
@@ -1288,7 +1294,7 @@ Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserCompareProc(DataBrow
 }
 
 void wxMacDataViewDataBrowserListViewControl::DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* WXUNUSED(selection))
 }
 
 void wxMacDataViewDataBrowserListViewControl::DataBrowserGetContextualMenuProc(MenuRef* menu, UInt32* helpType, CFStringRef* helpItemString, AEDesc* WXUNUSED(selection))
- // In this method we do not supply a contextual menu handler at all but only send a wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU.
+ // In this method we do not supply a contextual menu handler at all but only send a wxEVT_DATAVIEW_ITEM_CONTEXT_MENU.
 {
   wxArrayDataBrowserItemID itemIDs;
 
 {
   wxArrayDataBrowserItemID itemIDs;
 
@@ -1301,7 +1307,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserGetContextualMenuProc(M
   *helpType       = kCMHelpItemNoHelp;
   *helpItemString = NULL;
  // create information for a context menu event:
   *helpType       = kCMHelpItemNoHelp;
   *helpItemString = NULL;
  // create information for a context menu event:
-  wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU,dataViewCtrlPtr->GetId());
+  wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_CONTEXT_MENU,dataViewCtrlPtr->GetId());
 
   dataViewEvent.SetEventObject(dataViewCtrlPtr);
   dataViewEvent.SetModel(dataViewCtrlPtr->GetModel());
 
   dataViewEvent.SetEventObject(dataViewCtrlPtr);
   dataViewEvent.SetModel(dataViewCtrlPtr->GetModel());
@@ -1437,7 +1443,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
 
             wxCHECK_MSG(dataViewCtrlPtr != NULL,errDataBrowserNotConfigured,_("Pointer to data view control not set correctly."));
            // initialize wxWidget event:
 
             wxCHECK_MSG(dataViewCtrlPtr != NULL,errDataBrowserNotConfigured,_("Pointer to data view control not set correctly."));
            // initialize wxWidget event:
-            wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING,dataViewCtrlPtr->GetId()); // variable definition
+            wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_COLLAPSING,dataViewCtrlPtr->GetId()); // variable definition
 
             dataViewEvent.SetEventObject(dataViewCtrlPtr);
             dataViewEvent.SetItem       (wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
             dataViewEvent.SetEventObject(dataViewCtrlPtr);
             dataViewEvent.SetItem       (wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1454,7 +1460,7 @@ OSStatus wxMacDataViewDataBrowserListViewControl::DataBrowserGetSetItemDataProc(
 
             wxCHECK_MSG(dataViewCtrlPtr != NULL,errDataBrowserNotConfigured,_("Pointer to data view control not set correctly."));
            // initialize wxWidget event:
 
             wxCHECK_MSG(dataViewCtrlPtr != NULL,errDataBrowserNotConfigured,_("Pointer to data view control not set correctly."));
            // initialize wxWidget event:
-            wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING,dataViewCtrlPtr->GetId()); // variable definition
+            wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_EXPANDING,dataViewCtrlPtr->GetId()); // variable definition
 
             dataViewEvent.SetEventObject(dataViewCtrlPtr);
             dataViewEvent.SetItem       (wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
             dataViewEvent.SetEventObject(dataViewCtrlPtr);
             dataViewEvent.SetItem       (wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1494,7 +1500,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
         dataViewCtrlPtr->FinishCustomItemEditing(); // stop editing of a custom item first (if necessary)
         {
          // initialize wxWidget event:
         dataViewCtrlPtr->FinishCustomItemEditing(); // stop editing of a custom item first (if necessary)
         {
          // initialize wxWidget event:
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_COLLAPSED,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1506,7 +1512,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
         dataViewCtrlPtr->FinishCustomItemEditing(); // stop editing of a custom item first (if necessary)
         {
          // initialize wxWidget event:
         dataViewCtrlPtr->FinishCustomItemEditing(); // stop editing of a custom item first (if necessary)
         {
          // initialize wxWidget event:
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_EXPANDED,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1521,7 +1527,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
         {
          // initialize wxWidget event:
           DataBrowserPropertyID propertyID;
         {
          // initialize wxWidget event:
           DataBrowserPropertyID propertyID;
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_EDITING_STARTED,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1542,7 +1548,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
         {
          // initialize wxWidget event:
           DataBrowserPropertyID propertyID;
         {
          // initialize wxWidget event:
           DataBrowserPropertyID propertyID;
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_EDITING_DONE,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1568,7 +1574,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
       case kDataBrowserItemDoubleClicked:
         {
          // initialize wxWidget event:
       case kDataBrowserItemDoubleClicked:
         {
          // initialize wxWidget event:
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_ACTIVATED,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetItem(wxDataViewItem(reinterpret_cast<void*>(itemID)));
@@ -1584,7 +1590,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
       case kDataBrowserSelectionSetChanged:
         {
          // initialize wxWidget event:
       case kDataBrowserSelectionSetChanged:
         {
          // initialize wxWidget event:
-          wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED,dataViewCtrlPtr->GetId()); // variable definition
+          wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_SELECTION_CHANGED,dataViewCtrlPtr->GetId()); // variable definition
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetModel      (dataViewCtrlPtr->GetModel());
 
           dataViewEvent.SetEventObject(dataViewCtrlPtr);
           dataViewEvent.SetModel      (dataViewCtrlPtr->GetModel());
@@ -1628,7 +1634,7 @@ void wxMacDataViewDataBrowserListViewControl::DataBrowserItemNotificationProc(Da
               {
                 columnPtr->SetSortOrder(!(columnPtr->IsSortOrderAscending()));
                // initialize wxWidget event:
               {
                 columnPtr->SetSortOrder(!(columnPtr->IsSortOrderAscending()));
                // initialize wxWidget event:
-                wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED,dataViewCtrlPtr->GetId()); // variable defintion
+                wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_COLUMN_SORTED,dataViewCtrlPtr->GetId()); // variable definition
 
                 dataViewEvent.SetEventObject(dataViewCtrlPtr);
                 dataViewEvent.SetColumn(columnIndex);
 
                 dataViewEvent.SetEventObject(dataViewCtrlPtr);
                 dataViewEvent.SetColumn(columnIndex);
@@ -1828,7 +1834,7 @@ Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserAcceptDragProc(DragR
     ::GetDragItemReferenceNumber(dragRef,indexDraggedItem,&itemRef); // the index begins with 1!
     dataObjects = GetDnDDataObjects(dragRef,itemRef);
    // create wxWidget's event:
     ::GetDragItemReferenceNumber(dragRef,indexDraggedItem,&itemRef); // the index begins with 1!
     dataObjects = GetDnDDataObjects(dragRef,itemRef);
    // create wxWidget's event:
-    wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE,dataViewCtrlPtr->GetId());
+    wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE,dataViewCtrlPtr->GetId());
 
     dataViewEvent.SetEventObject(dataViewCtrlPtr);
 
 
     dataViewEvent.SetEventObject(dataViewCtrlPtr);
 
@@ -1872,7 +1878,7 @@ Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserAddDragItemProc(Drag
   wxCHECK_MSG(dataViewItem.IsOk(),false,_("Invalid data view item"));
 
  // send a begin drag event and proceed with dragging unless the event is vetoed:
   wxCHECK_MSG(dataViewItem.IsOk(),false,_("Invalid data view item"));
 
  // send a begin drag event and proceed with dragging unless the event is vetoed:
-  wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG,dataViewCtrlPtr->GetId());
+  wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_BEGIN_DRAG,dataViewCtrlPtr->GetId());
 
   dataViewEvent.SetEventObject(dataViewCtrlPtr);
   dataViewEvent.SetItem(dataViewItem);
 
   dataViewEvent.SetEventObject(dataViewCtrlPtr);
   dataViewEvent.SetItem(dataViewItem);
@@ -2005,7 +2011,7 @@ Boolean wxMacDataViewDataBrowserListViewControl::DataBrowserReceiveDragProc(Drag
     ::GetDragItemReferenceNumber(dragRef,indexDraggedItem,&itemRef); // the index begins with 1!
     dataObjects = GetDnDDataObjects(dragRef,itemRef);
   // create wxWidget's event:
     ::GetDragItemReferenceNumber(dragRef,indexDraggedItem,&itemRef); // the index begins with 1!
     dataObjects = GetDnDDataObjects(dragRef,itemRef);
   // create wxWidget's event:
-    wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_DROP,dataViewCtrlPtr->GetId());
+    wxDataViewEvent dataViewEvent(wxEVT_DATAVIEW_ITEM_DROP,dataViewCtrlPtr->GetId());
 
     dataViewEvent.SetEventObject(dataViewCtrlPtr);
 
 
     dataViewEvent.SetEventObject(dataViewCtrlPtr);