1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/dataview_osx.cpp
3 // Purpose: wxDataViewCtrl native mac implementation
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 // For compilers that support precompilation, includes "wx.h".
10 #include "wx/wxprec.h"
12 #if (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
18 #include "wx/settings.h"
19 #include "wx/dcclient.h"
23 #include "wx/osx/carbon/dataview.h"
26 #include "wx/osx/core/dataview.h"
27 #include "wx/osx/private.h"
28 #include "wx/renderer.h"
30 // ============================================================================
31 // Helper functions for dataviewe implementation on OSX
32 // ============================================================================
33 wxString
ConcatenateDataViewItemValues(wxDataViewCtrl
const* dataViewCtrlPtr
, wxDataViewItem
const& dataViewItem
)
35 wxString dataString
; // contains the TAB concatenated data
38 for (size_t i
=0; i
<dataViewCtrlPtr
->GetColumnCount(); i
++)
40 // variable definition:
43 dataViewCtrlPtr
->GetModel()->GetValue(dataValue
,dataViewItem
,dataViewCtrlPtr
->GetColumn(i
)->GetModelColumn());
45 dataString
<< wxT('\t');
46 dataString
<< dataValue
.MakeString();
51 // ============================================================================
52 // wxOSXDataViewModelNotifier
53 // ============================================================================
54 class wxOSXDataViewModelNotifier
: public wxDataViewModelNotifier
58 // constructors / destructor
60 wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
);
63 // inherited methods from wxDataViewModelNotifier
65 virtual bool ItemAdded (wxDataViewItem
const &parent
, wxDataViewItem
const &item
);
66 virtual bool ItemsAdded (wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
67 virtual bool ItemChanged (wxDataViewItem
const& item
);
68 virtual bool ItemsChanged(wxDataViewItemArray
const& items
);
69 virtual bool ItemDeleted (wxDataViewItem
const& parent
, wxDataViewItem
const& item
);
70 virtual bool ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
71 virtual bool ValueChanged(wxDataViewItem
const& item
, unsigned int col
);
72 virtual bool Cleared();
73 virtual void Resort();
76 // if the dataview control can have a variable row height this method sets the dataview's control row height of
77 // the passed item to the maximum value occupied by the item in all columns
78 void AdjustRowHeight(wxDataViewItem
const& item
);
79 // ... and the same method for a couple of items:
80 void AdjustRowHeights(wxDataViewItemArray
const& items
);
81 // adjust wxCOL_WIDTH_AUTOSIZE columns to fit the data
82 void AdjustAutosizedColumns();
85 wxDataViewCtrl
* m_DataViewCtrlPtr
;
89 // constructors / destructor
91 wxOSXDataViewModelNotifier::wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
)
92 :m_DataViewCtrlPtr(initDataViewCtrlPtr
)
94 if (initDataViewCtrlPtr
== NULL
)
95 wxFAIL_MSG("Pointer to dataview control must not be NULL");
98 bool wxOSXDataViewModelNotifier::ItemAdded(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
103 wxCHECK_MSG(item
.IsOk(),false,"Added item is invalid.");
104 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,item
);
105 AdjustRowHeight(item
);
106 return noFailureFlag
;
109 bool wxOSXDataViewModelNotifier::ItemsAdded(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
114 // insert all valid items into control:
115 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,items
);
116 // adjust row heights:
117 AdjustRowHeights(items
);
119 return noFailureFlag
;
122 bool wxOSXDataViewModelNotifier::ItemChanged(wxDataViewItem
const& item
)
124 wxCHECK_MSG(item
.IsOk(), false,"Changed item is invalid.");
125 wxCHECK_MSG(GetOwner() != NULL
,false,"Owner not initialized.");
126 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(item
),item
))
128 // sent the equivalent wxWidget event:
129 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
131 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
132 dataViewEvent
.SetItem(item
);
133 // sent the equivalent wxWidget event:
134 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
135 // row height may have to be adjusted:
136 AdjustRowHeight(item
);
137 AdjustAutosizedColumns();
145 bool wxOSXDataViewModelNotifier::ItemsChanged(wxDataViewItemArray
const& items
)
147 size_t const noOfItems
= items
.GetCount();
149 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
152 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
153 for (size_t indexItem
=0; indexItem
<noOfItems
; ++indexItem
)
154 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(items
[indexItem
]),items
[indexItem
]))
156 // send for all changed items a wxWidget event:
157 dataViewEvent
.SetItem(items
[indexItem
]);
158 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
162 // if this location is reached all items have been updated:
163 AdjustRowHeights(items
);
164 AdjustAutosizedColumns();
169 bool wxOSXDataViewModelNotifier::ItemDeleted(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
174 wxCHECK_MSG(item
.IsOk(),false,"To be deleted item is invalid.");
175 // 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
176 // not to be identical because the being edited item might be below the passed item in the hierarchy);
177 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
178 // has been started and that variables can currently not be updated even when requested by the system:
179 m_DataViewCtrlPtr
->SetDeleting(true);
180 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,item
);
181 // enable automatic updating again:
182 m_DataViewCtrlPtr
->SetDeleting(false);
184 AdjustAutosizedColumns();
186 return noFailureFlag
;
189 bool wxOSXDataViewModelNotifier::ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
194 // 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
195 // not to be identical because the being edited item might be below the passed item in the hierarchy);
196 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
197 // has been started and that variables can currently not be updated even when requested by the system:
198 m_DataViewCtrlPtr
->SetDeleting(true);
199 // delete all specified items:
200 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,items
);
201 // enable automatic updating again:
202 m_DataViewCtrlPtr
->SetDeleting(false);
204 AdjustAutosizedColumns();
206 return noFailureFlag
;
209 bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem
const& item
, unsigned int col
)
211 wxCHECK_MSG(item
.IsOk(), false,"Passed item is invalid.");
212 wxCHECK_MSG(GetOwner() != NULL
,false,"Owner not initialized.");
213 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(item
),item
))
215 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
217 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
218 dataViewEvent
.SetColumn(col
);
219 dataViewEvent
.SetItem(item
);
220 // send the equivalent wxWidget event:
221 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
223 AdjustAutosizedColumns();
231 bool wxOSXDataViewModelNotifier::Cleared()
233 return m_DataViewCtrlPtr
->GetDataViewPeer()->Reload();
236 void wxOSXDataViewModelNotifier::Resort()
238 m_DataViewCtrlPtr
->GetDataViewPeer()->Resort();
241 void wxOSXDataViewModelNotifier::AdjustRowHeight(wxDataViewItem
const& item
)
243 if ((m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
245 wxDataViewModel
*model
= GetOwner();
247 int height
= 20; // TODO find out standard height
248 unsigned int num
= m_DataViewCtrlPtr
->GetColumnCount();
250 for (col
= 0; col
< num
; col
++)
252 wxDataViewColumn
* column(m_DataViewCtrlPtr
->GetColumnPtr(col
));
254 if (!(column
->IsHidden()))
256 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
260 model
->GetValue( value
, item
, column
->GetModelColumn() );
261 renderer
->SetValue( value
);
262 height
= wxMax( height
, renderer
->GetSize().y
);
267 m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(item
,height
);
271 void wxOSXDataViewModelNotifier::AdjustRowHeights(wxDataViewItemArray
const& items
)
273 if ((m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
275 size_t const noOfItems
= items
.GetCount();
277 wxDataViewModel
*model
= GetOwner();
279 for (size_t itemIndex
=0; itemIndex
<noOfItems
; ++itemIndex
)
281 int height
= 20; // TODO find out standard height
282 unsigned int num
= m_DataViewCtrlPtr
->GetColumnCount();
285 for (col
= 0; col
< num
; col
++)
287 wxDataViewColumn
* column(m_DataViewCtrlPtr
->GetColumnPtr(col
));
289 if (!(column
->IsHidden()))
291 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
295 model
->GetValue( value
, items
[itemIndex
], column
->GetModelColumn() );
296 renderer
->SetValue( value
);
297 height
= wxMax( height
, renderer
->GetSize().y
);
302 m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(items
[itemIndex
],height
);
307 void wxOSXDataViewModelNotifier::AdjustAutosizedColumns()
309 unsigned count
= m_DataViewCtrlPtr
->GetColumnCount();
310 for ( unsigned col
= 0; col
< count
; col
++ )
312 wxDataViewColumn
*column
= m_DataViewCtrlPtr
->GetColumnPtr(col
);
314 if ( column
->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE
)
315 m_DataViewCtrlPtr
->GetDataViewPeer()->FitColumnWidthToContent(col
);
319 // ---------------------------------------------------------
320 // wxDataViewCustomRenderer
321 // The constructor, the implementation macro and environment
322 // dependent methods can be found in the environment's
324 // ---------------------------------------------------------
325 wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
330 wxDC
* wxDataViewCustomRenderer::GetDC()
332 if ((m_DCPtr
== NULL
) && (GetOwner() != NULL
) && (GetOwner()->GetOwner() != NULL
))
333 m_DCPtr
= new wxClientDC(GetOwner()->GetOwner());
337 void wxDataViewCustomRenderer::SetDC(wxDC
* newDCPtr
)
343 //-----------------------------------------------------------------------------
345 //-----------------------------------------------------------------------------
347 wxDataViewCtrl::~wxDataViewCtrl()
351 // Ensure that the already destructed controls is not notified about changes
352 // in the model any more.
353 if (m_ModelNotifier
!= NULL
)
354 m_ModelNotifier
->GetOwner()->RemoveNotifier(m_ModelNotifier
);
357 void wxDataViewCtrl::Init()
359 m_CustomRendererPtr
= NULL
;
362 m_ModelNotifier
= NULL
;
365 bool wxDataViewCtrl::Create(wxWindow
*parent
,
370 const wxValidator
& validator
,
371 const wxString
& name
)
374 if (!(wxControl::Create(parent
,id
,pos
,size
,style
,validator
,name
)))
376 SetPeer(::CreateDataView(this,parent
,id
,pos
,size
,style
,GetExtraStyle()));
378 MacPostControlCreate(pos
,size
);
383 bool wxDataViewCtrl::AssociateModel(wxDataViewModel
* model
)
385 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer());
388 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
,false,"Pointer to native control must not be NULL.");
390 // We could have been associated with another model previously, break the
391 // association in this case.
392 if ( m_ModelNotifier
)
393 m_ModelNotifier
->GetOwner()->RemoveNotifier(m_ModelNotifier
);
395 if (wxDataViewCtrlBase::AssociateModel(model
) && dataViewWidgetPtr
->AssociateModel(model
))
399 m_ModelNotifier
= new wxOSXDataViewModelNotifier(this);
400 model
->AddNotifier(m_ModelNotifier
);
408 bool wxDataViewCtrl::AppendColumn(wxDataViewColumn
* columnPtr
)
410 return wxDataViewCtrl::InsertColumn( GetColumnCount(), columnPtr
);
413 bool wxDataViewCtrl::PrependColumn(wxDataViewColumn
* columnPtr
)
415 return wxDataViewCtrl::InsertColumn( 0, columnPtr
);
418 bool wxDataViewCtrl::InsertColumn(unsigned int pos
, wxDataViewColumn
* columnPtr
)
420 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer());
422 // first, some error checking:
423 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
, false,"Pointer to native control must not be NULL.");
424 wxCHECK_MSG(columnPtr
!= NULL
, false,"Column pointer must not be NULL.");
425 wxCHECK_MSG(columnPtr
->GetRenderer() != NULL
, false,"Column does not have a renderer.");
426 wxCHECK_MSG(GetModel() != NULL
, false,"No model associated with control.");
427 wxCHECK_MSG(columnPtr
->GetModelColumn() < GetModel()->GetColumnCount(),false,"Column's model column has no equivalent in the associated model.");
429 // add column to wxWidget's internal structure:
430 if (wxDataViewCtrlBase::InsertColumn(pos
,columnPtr
))
432 m_ColumnPtrs
.Add(columnPtr
);
433 // if the insertion in the native control is successful the rest can also be initialized:
434 if (dataViewWidgetPtr
->InsertColumn(pos
,columnPtr
))
436 // make sure that the data is up-to-date...
437 // if the newly appended column is the first column add the initial data to the control and mark the column as an expander column,
438 // otherwise ask the control to 'update' the data in the newly appended column:
439 if (GetColumnCount() == 1)
440 SetExpanderColumn(columnPtr
);
447 m_ColumnPtrs
.Remove(columnPtr
);
449 // and send a message in debug mode:
450 wxFAIL_MSG("Column could not be added to native control.");
459 wxFAIL_MSG("Could not add column to internal structures.");
465 bool wxDataViewCtrl::ClearColumns()
467 if (GetDataViewPeer()->ClearColumns())
469 WX_CLEAR_ARRAY(m_ColumnPtrs
);
476 bool wxDataViewCtrl::DeleteColumn(wxDataViewColumn
* columnPtr
)
478 if (GetDataViewPeer()->DeleteColumn(columnPtr
))
480 m_ColumnPtrs
.Remove(columnPtr
);
488 wxDataViewColumn
* wxDataViewCtrl::GetColumn(unsigned int pos
) const
490 return GetDataViewPeer()->GetColumn(pos
);
493 unsigned int wxDataViewCtrl::GetColumnCount() const
495 return m_ColumnPtrs
.GetCount();
498 int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn
const* columnPtr
) const
500 return GetDataViewPeer()->GetColumnPosition(columnPtr
);
503 void wxDataViewCtrl::Collapse(wxDataViewItem
const& item
)
505 GetDataViewPeer()->Collapse(item
);
508 void wxDataViewCtrl::EnsureVisible(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
)
512 ExpandAncestors(item
); // make sure that the item exists in the control
513 GetDataViewPeer()->EnsureVisible(item
,columnPtr
);
517 void wxDataViewCtrl::Expand(wxDataViewItem
const& item
)
519 return GetDataViewPeer()->Expand(item
);
522 bool wxDataViewCtrl::IsExpanded( const wxDataViewItem
& item
) const
524 return (item
.IsOk() && GetDataViewPeer()->IsExpanded(item
));
527 wxDataViewColumn
* wxDataViewCtrl::GetSortingColumn() const
529 return GetDataViewPeer()->GetSortingColumn();
532 unsigned int wxDataViewCtrl::GetCount() const
534 return GetDataViewPeer()->GetCount();
537 wxDataViewItem
wxDataViewCtrl::DoGetCurrentItem() const
539 return GetDataViewPeer()->GetCurrentItem();
542 void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem
& item
)
544 GetDataViewPeer()->SetCurrentItem(item
);
547 wxDataViewColumn
*wxDataViewCtrl::GetCurrentColumn() const
549 return GetDataViewPeer()->GetCurrentColumn();
552 wxRect
wxDataViewCtrl::GetItemRect(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
) const
554 if (item
.IsOk() && (columnPtr
!= NULL
))
555 return GetDataViewPeer()->GetRectangle(item
,columnPtr
);
560 int wxDataViewCtrl::GetSelectedItemsCount() const
562 return GetDataViewPeer()->GetSelectedItemsCount();
565 int wxDataViewCtrl::GetSelections(wxDataViewItemArray
& sel
) const
567 return GetDataViewPeer()->GetSelections(sel
);
570 void wxDataViewCtrl::HitTest(wxPoint
const& point
, wxDataViewItem
& item
, wxDataViewColumn
*& columnPtr
) const
572 return GetDataViewPeer()->HitTest(point
,item
,columnPtr
);
575 bool wxDataViewCtrl::IsSelected(wxDataViewItem
const& item
) const
577 return GetDataViewPeer()->IsSelected(item
);
580 void wxDataViewCtrl::Select(wxDataViewItem
const& item
)
584 ExpandAncestors(item
); // make sure that the item exists in the control
585 GetDataViewPeer()->Select(item
);
589 void wxDataViewCtrl::SelectAll()
591 GetDataViewPeer()->SelectAll();
594 void wxDataViewCtrl::SetSelections(wxDataViewItemArray
const& sel
)
596 size_t const noOfSelections
= sel
.GetCount();
600 wxDataViewItem last_parent
;
603 // make sure that all to be selected items are visible in the control:
604 for (i
= 0; i
< noOfSelections
; i
++)
606 wxDataViewItem item
= sel
[i
];
607 wxDataViewItem parent
= GetModel()->GetParent( item
);
609 if (parent
.IsOk() && (parent
!= last_parent
))
610 ExpandAncestors(item
);
611 last_parent
= parent
;
614 // finally select the items:
615 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer()); // variable definition for abbreviational purposes
617 for (i
=0; i
<noOfSelections
; ++i
)
618 dataViewWidgetPtr
->Select(sel
[i
]);
621 void wxDataViewCtrl::Unselect(wxDataViewItem
const& item
)
624 GetDataViewPeer()->Unselect(item
);
627 void wxDataViewCtrl::UnselectAll()
629 GetDataViewPeer()->UnselectAll();
635 wxDataViewWidgetImpl
* wxDataViewCtrl::GetDataViewPeer() const
637 return dynamic_cast<wxDataViewWidgetImpl
*>(GetPeer());
640 void wxDataViewCtrl::AddChildren(wxDataViewItem
const& parentItem
)
644 wxDataViewItemArray items
;
647 wxCHECK_RET(GetModel() != NULL
,"Model pointer not initialized.");
648 noOfChildren
= GetModel()->GetChildren(parentItem
,items
);
649 (void) GetModel()->ItemsAdded(parentItem
,items
);
652 void wxDataViewCtrl::EditItem(const wxDataViewItem
& item
, const wxDataViewColumn
*column
)
654 GetDataViewPeer()->StartEditor(item
, GetColumnPosition(column
));
657 void wxDataViewCtrl::FinishCustomItemEditing()
659 if (GetCustomRendererItem().IsOk())
661 GetCustomRendererPtr()->FinishEditing();
662 SetCustomRendererItem(wxDataViewItem());
663 SetCustomRendererPtr (NULL
);
669 wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant
WXUNUSED(variant
))
671 wxVisualAttributes attr
;
673 attr
.colFg
= wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT
);
674 attr
.colBg
= wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX
);
675 static wxFont font
= wxFont(wxOSX_SYSTEM_FONT_VIEWS
);
681 // inherited methods from wxDataViewCtrlBase
682 void wxDataViewCtrl::DoSetExpanderColumn()
684 if (GetExpanderColumn() != NULL
)
685 GetDataViewPeer()->DoSetExpanderColumn(GetExpanderColumn());
688 void wxDataViewCtrl::DoSetIndent()
690 GetDataViewPeer()->DoSetIndent(GetIndent());
694 void wxDataViewCtrl::OnSize(wxSizeEvent
& event
)
696 unsigned int const noOfColumns
= GetColumnCount();
699 // reset DC of all custom renderers because DC has changed:
700 for (unsigned int i
=0; i
<noOfColumns
; ++i
)
702 wxDataViewColumn
* dataViewColumnPtr(GetColumn(i
));
704 if (dataViewColumnPtr
!= NULL
)
706 wxDataViewCustomRenderer
* dataViewCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer
*>(dataViewColumnPtr
->GetRenderer()));
708 if (dataViewCustomRendererPtr
!= NULL
)
709 dataViewCustomRendererPtr
->SetDC(NULL
);
713 // update the layout of the native control after a size event:
714 GetDataViewPeer()->OnSize();
719 wxSize
wxDataViewCtrl::DoGetBestSize() const
721 wxSize best
= wxControl::DoGetBestSize();
727 void wxDataViewCtrl::OnMouse(wxMouseEvent
& event
)
732 if (GetModel() == NULL
)
735 wxMacDataViewDataBrowserListViewControlPointer
MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer
>(GetPeer()));
738 wxDataViewItemArray items
;
739 NoOfChildren
= GetModel()->GetChildren( wxDataViewItem(), items
);
740 if (NoOfChildren
== 0)
742 wxDataViewItem firstChild
= items
[0];
744 UInt16 headerHeight
= 0;
745 MacDataViewListCtrlPtr
->GetHeaderButtonHeight(&headerHeight
);
748 if (event
.GetY() < headerHeight
)
750 unsigned int col_count
= GetColumnCount();
752 for (col
= 0; col
< col_count
; col
++)
754 wxDataViewColumn
*column
= GetColumn( col
);
755 if (column
->IsHidden())
759 ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr
->GetControlRef(),
760 reinterpret_cast<DataBrowserItemID
>(firstChild
.GetID()), column
->GetNativeData()->GetPropertyID(),
761 kDataBrowserPropertyEnclosingPart
, &itemrect
);
763 if (abs( event
.GetX() - itemrect
.right
) < 3)
765 if (column
->GetFlags() & wxDATAVIEW_COL_RESIZABLE
)
766 SetCursor( wxCursor( wxCURSOR_SIZEWE
) );
768 SetCursor( *wxSTANDARD_CURSOR
);
774 SetCursor( *wxSTANDARD_CURSOR
);
778 IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl
,wxDataViewCtrlBase
)
780 BEGIN_EVENT_TABLE(wxDataViewCtrl
,wxDataViewCtrlBase
)
781 EVT_SIZE(wxDataViewCtrl::OnSize
)
782 EVT_MOTION(wxDataViewCtrl::OnMouse
)
785 #endif // (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))