]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/dataview.cpp
check that the version of __sync_sub_and_fetch that returns a value is supported...
[wxWidgets.git] / src / mac / carbon / dataview.cpp
index dc95fa24c12f5980dd48cc70e6a698f12a0b56b0..845c0dd9b029ff749ac781a494d26b452d508a8f 100644 (file)
@@ -84,7 +84,7 @@ static pascal OSStatus wxMacDataViewCtrlEventHandler(EventHandlerCallRef handler
         DataViewEvent.SetColumn(columnIndex);
         DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex));
        // finally sent the equivalent wxWidget event:
         DataViewEvent.SetColumn(columnIndex);
         DataViewEvent.SetDataViewColumn(DataViewCtrlPtr->GetColumn(columnIndex));
        // finally sent the equivalent wxWidget event:
-        DataViewCtrlPtr->GetEventHandler()->ProcessEvent(DataViewEvent);
+        DataViewCtrlPtr->HandleWindowEvent(DataViewEvent);
         return ::CallNextEventHandler(handler,EventReference);
       } /* if */
       else
         return ::CallNextEventHandler(handler,EventReference);
       } /* if */
       else
@@ -238,7 +238,7 @@ public:
       dataViewEvent.SetEventObject(dataViewCtrlPtr);
       dataViewEvent.SetItem(item);
      // sent the equivalent wxWidget event:
       dataViewEvent.SetEventObject(dataViewCtrlPtr);
       dataViewEvent.SetItem(item);
      // sent the equivalent wxWidget event:
-      dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+      dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
      // done
       return true;
     } /* if */
      // done
       return true;
     } /* if */
@@ -270,7 +270,7 @@ public:
       for (size_t i=0; i<noOfEntries; ++i)
       {
         dataViewEvent.SetItem(reinterpret_cast<void*>(itemIDs[i]));
       for (size_t i=0; i<noOfEntries; ++i)
       {
         dataViewEvent.SetItem(reinterpret_cast<void*>(itemIDs[i]));
-        dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+        dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
       } /* for */
     } /* if */
    // release allocated array space:
       } /* for */
     } /* if */
    // release allocated array space:
@@ -357,7 +357,7 @@ public:
       dataViewEvent.SetColumn(col);
       dataViewEvent.SetItem(item);
      // send the equivalent wxWidget event:
       dataViewEvent.SetColumn(col);
       dataViewEvent.SetItem(item);
      // send the equivalent wxWidget event:
-      dataViewCtrlPtr->GetEventHandler()->ProcessEvent(dataViewEvent);
+      dataViewCtrlPtr->HandleWindowEvent(dataViewEvent);
      // done
       return true;
     } /* if */
      // done
       return true;
     } /* if */
@@ -445,7 +445,7 @@ wxDataViewCustomRenderer::~wxDataViewCustomRenderer(void)
 void wxDataViewCustomRenderer::RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state )
 {
     wxDataViewCtrl *view = GetOwner()->GetOwner();
 void wxDataViewCustomRenderer::RenderText( const wxString &text, int xoffset, wxRect cell, wxDC *dc, int state )
 {
     wxDataViewCtrl *view = GetOwner()->GetOwner();
-    wxColour col = (state & wxDATAVIEW_CELL_SELECTED) ? wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT) : view->GetForegroundColour();
+    wxColour col = (state & wxDATAVIEW_CELL_SELECTED) ? *wxWHITE : view->GetForegroundColour();
     dc->SetTextForeground(col);
     dc->DrawText( text, cell.x + xoffset, cell.y + ((cell.height - dc->GetCharHeight()) / 2));
 }
     dc->SetTextForeground(col);
     dc->DrawText( text, cell.x + xoffset, cell.y + ((cell.height - dc->GetCharHeight()) / 2));
 }
@@ -456,7 +456,7 @@ wxDC* wxDataViewCustomRenderer::GetDC(void)
   {
     if ((GetOwner() == NULL) || (GetOwner()->GetOwner() == NULL))
       return NULL;
   {
     if ((GetOwner() == NULL) || (GetOwner()->GetOwner() == NULL))
       return NULL;
-    this->m_DCPtr = new wxClientDC(this->GetOwner()->GetOwner());
+    this->m_DCPtr = new wxWindowDC(this->GetOwner()->GetOwner());
   } /* if */
   return this->m_DCPtr;
 } /* wxDataViewCustomRenderer::GetDC(void) */
   } /* if */
   return this->m_DCPtr;
 } /* wxDataViewCustomRenderer::GetDC(void) */
@@ -571,9 +571,14 @@ bool wxDataViewIconTextRenderer::Render(void)
 
    // variable definition:
     wxMacCFStringHolder cfString(iconText.GetText(),(this->GetView()->GetFont().Ok() ? this->GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
 
    // variable definition:
     wxMacCFStringHolder cfString(iconText.GetText(),(this->GetView()->GetFont().Ok() ? this->GetView()->GetFont().GetEncoding() : wxLocale::GetSystemEncoding()));
+
+    if (iconText.GetIcon().IsOk())
+    {
+       if (::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) != noErr)
+          return false;
+    }
     
     
-    return ((::SetDataBrowserItemDataIcon(this->GetDataReference(),MAC_WXHICON(iconText.GetIcon().GetHICON())) == noErr) &&
-            (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr));
+    return (::SetDataBrowserItemDataText(this->GetDataReference(),cfString) == noErr);
   } /* if */
   else
     return false;
   } /* if */
   else
     return false;
@@ -928,6 +933,8 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos,
 
   InstallControlEventHandler(this->m_peer->GetControlRef(),GetwxMacDataViewCtrlEventHandlerUPP(),GetEventTypeCount(eventList),eventList,this,NULL);
 
 
   InstallControlEventHandler(this->m_peer->GetControlRef(),GetwxMacDataViewCtrlEventHandlerUPP(),GetEventTypeCount(eventList),eventList,this,NULL);
 
+  ::SetDataBrowserTableViewHiliteStyle( this->m_peer->GetControlRef(), kDataBrowserTableViewFillHilite );
+
   return true;
 } /* wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) */
 
   return true;
 } /* wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator) */