X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f0c8f31f407ecfce909060464c0ea655221cdab..817d057840b17a106f7b66e64ec2a7526e42dd20:/src/osx/carbon/dataview.cpp?ds=sidebyside diff --git a/src/osx/carbon/dataview.cpp b/src/osx/carbon/dataview.cpp index e6435e32fb..775ef9e4cc 100644 --- a/src/osx/carbon/dataview.cpp +++ b/src/osx/carbon/dataview.cpp @@ -220,7 +220,7 @@ public: bool noFailureFlag = (!(parent.IsOk()) && (this->m_dataViewControlPtr->AddItem(kDataBrowserNoItem,&itemID) == noErr) || parent.IsOk() && (this->m_dataViewControlPtr->AddItem(reinterpret_cast(parent.GetID()),&itemID) == noErr)); - wxDataViewCtrl *dvc = (wxDataViewCtrl*) this->m_dataViewControlPtr->GetPeer(); + wxDataViewCtrl *dvc = (wxDataViewCtrl*) this->m_dataViewControlPtr->GetWXPeer(); if (dvc->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { wxDataViewModel *model = GetOwner(); @@ -270,7 +270,7 @@ public: // give allocated array space free again: delete[] itemIDs; - wxDataViewCtrl *dvc = (wxDataViewCtrl*) this->m_dataViewControlPtr->GetPeer(); + wxDataViewCtrl *dvc = (wxDataViewCtrl*) this->m_dataViewControlPtr->GetWXPeer(); if (dvc->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) { wxDataViewModel *model = GetOwner(); @@ -321,7 +321,7 @@ public: wxCHECK_MSG(item.IsOk(),false,_("Changed item is invalid.")); if (this->m_dataViewControlPtr->UpdateItems(&itemID) == noErr) { - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetPeer())); + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetWXPeer())); // sent the equivalent wxWidget event: wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED,dataViewCtrlPtr->GetId()); // variable defintion @@ -356,7 +356,7 @@ public: noFailureFlag = (this->m_dataViewControlPtr->UpdateItems(kDataBrowserNoItem,noOfEntries,itemIDs,kDataBrowserItemNoProperty,kDataBrowserItemNoProperty) == noErr); if (noFailureFlag) { - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetPeer())); + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetWXPeer())); // send for all changed items a wxWidget event: wxDataViewEvent dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED,dataViewCtrlPtr->GetId()); // variable defintion @@ -385,7 +385,7 @@ public: // variable definition and initialization: DataBrowserItemID itemID(reinterpret_cast(item.GetID())); OSStatus errorStatus; - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetPeer())); + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetWXPeer())); // when this method is called and currently an item is being edited this item may have already been deleted in the model (the passed item and the being edited item have // not to be identical because the being edited item might be below the passed item in the hierarchy); @@ -407,7 +407,7 @@ public: DataBrowserItemID* itemIDs; - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetPeer())); + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetWXPeer())); size_t noOfEntries; @@ -439,7 +439,7 @@ public: DataBrowserPropertyID propertyID; - wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetPeer())); + wxDataViewCtrl* dataViewCtrlPtr(dynamic_cast(this->m_dataViewControlPtr->GetWXPeer())); wxCHECK_MSG(item.IsOk(), false,_("Passed item is invalid.")); @@ -475,6 +475,7 @@ public: wxDataViewItemArray array; GetOwner()->GetChildren( item, array ); ItemsAdded( item, array ); + this->m_dataViewControlPtr->SetScrollPosition(0, 0); return noFailureFlag; } /* Cleared() */ @@ -1096,7 +1097,7 @@ void wxDataViewCtrl::Init() bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator ) { - if (!(this->wxControl::Create(parent,id,pos,size,(style | wxSUNKEN_BORDER) & ~(wxHSCROLL | wxVSCROLL),validator))) + if (!(this->wxControl::Create(parent,id,pos,size,style & ~(wxHSCROLL | wxVSCROLL),validator))) return false; #ifdef __WXMAC__ @@ -1104,6 +1105,10 @@ bool wxDataViewCtrl::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, #endif this->m_peer = new wxMacDataViewDataBrowserListViewControl(this,pos,size,style); + + if ( style & wxBORDER_NONE ) + this->m_peer->SetData( kControlNoPart, kControlDataBrowserIncludesFrameAndFocusTag, (Boolean) false ) ; + this->MacPostControlCreate(pos,size); ::SetAutomaticControlDragTrackingEnabledForWindow(::GetControlOwner(this->m_peer->GetControlRef()),true);