1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/dataview_osx.cpp
3 // Purpose: wxDataViewCtrl native mac implementation
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
13 #if (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))
19 #include "wx/settings.h"
20 #include "wx/dcclient.h"
24 #include "wx/osx/carbon/dataview.h"
27 #include "wx/osx/core/dataview.h"
28 #include "wx/osx/private.h"
29 #include "wx/renderer.h"
31 // ============================================================================
32 // Helper functions for dataviewe implementation on OSX
33 // ============================================================================
34 wxString
ConcatenateDataViewItemValues(wxDataViewCtrl
const* dataViewCtrlPtr
, wxDataViewItem
const& dataViewItem
)
36 wxString dataString
; // contains the TAB concatenated data
39 for (size_t i
=0; i
<dataViewCtrlPtr
->GetColumnCount(); i
++)
41 // variable definition:
44 dataViewCtrlPtr
->GetModel()->GetValue(dataValue
,dataViewItem
,dataViewCtrlPtr
->GetColumn(i
)->GetModelColumn());
46 dataString
<< wxT('\t');
47 dataString
<< dataValue
.MakeString();
52 // ============================================================================
53 // wxOSXDataViewModelNotifier
54 // ============================================================================
55 class wxOSXDataViewModelNotifier
: public wxDataViewModelNotifier
59 // constructors / destructor
61 wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
);
64 // inherited methods from wxDataViewModelNotifier
66 virtual bool ItemAdded (wxDataViewItem
const &parent
, wxDataViewItem
const &item
);
67 virtual bool ItemsAdded (wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
68 virtual bool ItemChanged (wxDataViewItem
const& item
);
69 virtual bool ItemsChanged(wxDataViewItemArray
const& items
);
70 virtual bool ItemDeleted (wxDataViewItem
const& parent
, wxDataViewItem
const& item
);
71 virtual bool ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
72 virtual bool ValueChanged(wxDataViewItem
const& item
, unsigned int col
);
73 virtual bool Cleared();
74 virtual void Resort();
77 // if the dataview control can have a variable row height this method sets the dataview's control row height of
78 // the passed item to the maximum value occupied by the item in all columns
79 void AdjustRowHeight(wxDataViewItem
const& item
);
80 // ... and the same method for a couple of items:
81 void AdjustRowHeights(wxDataViewItemArray
const& items
);
82 // adjust wxCOL_WIDTH_AUTOSIZE columns to fit the data
83 void AdjustAutosizedColumns();
86 wxDataViewCtrl
* m_DataViewCtrlPtr
;
90 // constructors / destructor
92 wxOSXDataViewModelNotifier::wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
)
93 :m_DataViewCtrlPtr(initDataViewCtrlPtr
)
95 if (initDataViewCtrlPtr
== NULL
)
96 wxFAIL_MSG("Pointer to dataview control must not be NULL");
99 bool wxOSXDataViewModelNotifier::ItemAdded(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
104 wxCHECK_MSG(item
.IsOk(),false,"Added item is invalid.");
105 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,item
);
106 AdjustRowHeight(item
);
107 return noFailureFlag
;
110 bool wxOSXDataViewModelNotifier::ItemsAdded(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
115 // insert all valid items into control:
116 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,items
);
117 // adjust row heights:
118 AdjustRowHeights(items
);
120 return noFailureFlag
;
123 bool wxOSXDataViewModelNotifier::ItemChanged(wxDataViewItem
const& item
)
125 wxCHECK_MSG(item
.IsOk(), false,"Changed item is invalid.");
126 wxCHECK_MSG(GetOwner() != NULL
,false,"Owner not initialized.");
127 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(item
),item
))
129 // sent the equivalent wxWidget event:
130 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
132 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
133 dataViewEvent
.SetItem(item
);
134 // sent the equivalent wxWidget event:
135 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
136 // row height may have to be adjusted:
137 AdjustRowHeight(item
);
138 AdjustAutosizedColumns();
146 bool wxOSXDataViewModelNotifier::ItemsChanged(wxDataViewItemArray
const& items
)
148 size_t const noOfItems
= items
.GetCount();
150 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
153 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
154 for (size_t indexItem
=0; indexItem
<noOfItems
; ++indexItem
)
155 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(items
[indexItem
]),items
[indexItem
]))
157 // send for all changed items a wxWidget event:
158 dataViewEvent
.SetItem(items
[indexItem
]);
159 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
163 // if this location is reached all items have been updated:
164 AdjustRowHeights(items
);
165 AdjustAutosizedColumns();
170 bool wxOSXDataViewModelNotifier::ItemDeleted(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
175 wxCHECK_MSG(item
.IsOk(),false,"To be deleted item is invalid.");
176 // 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
177 // not to be identical because the being edited item might be below the passed item in the hierarchy);
178 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
179 // has been started and that variables can currently not be updated even when requested by the system:
180 m_DataViewCtrlPtr
->SetDeleting(true);
181 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,item
);
182 // enable automatic updating again:
183 m_DataViewCtrlPtr
->SetDeleting(false);
185 AdjustAutosizedColumns();
187 return noFailureFlag
;
190 bool wxOSXDataViewModelNotifier::ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
195 // 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
196 // not to be identical because the being edited item might be below the passed item in the hierarchy);
197 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
198 // has been started and that variables can currently not be updated even when requested by the system:
199 m_DataViewCtrlPtr
->SetDeleting(true);
200 // delete all specified items:
201 noFailureFlag
= m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,items
);
202 // enable automatic updating again:
203 m_DataViewCtrlPtr
->SetDeleting(false);
205 AdjustAutosizedColumns();
207 return noFailureFlag
;
210 bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem
const& item
, unsigned int col
)
212 wxCHECK_MSG(item
.IsOk(), false,"Passed item is invalid.");
213 wxCHECK_MSG(GetOwner() != NULL
,false,"Owner not initialized.");
214 if (m_DataViewCtrlPtr
->GetDataViewPeer()->Update(GetOwner()->GetParent(item
),item
))
216 wxDataViewEvent
dataViewEvent(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
,m_DataViewCtrlPtr
->GetId());
218 dataViewEvent
.SetEventObject(m_DataViewCtrlPtr
);
219 dataViewEvent
.SetColumn(col
);
220 dataViewEvent
.SetItem(item
);
221 // send the equivalent wxWidget event:
222 m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
224 AdjustAutosizedColumns();
232 bool wxOSXDataViewModelNotifier::Cleared()
234 return m_DataViewCtrlPtr
->GetDataViewPeer()->Reload();
237 void wxOSXDataViewModelNotifier::Resort()
239 m_DataViewCtrlPtr
->GetDataViewPeer()->Resort();
242 void wxOSXDataViewModelNotifier::AdjustRowHeight(wxDataViewItem
const& item
)
244 if ((m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
246 wxDataViewModel
*model
= GetOwner();
248 int height
= 20; // TODO find out standard height
249 unsigned int num
= m_DataViewCtrlPtr
->GetColumnCount();
251 for (col
= 0; col
< num
; col
++)
253 wxDataViewColumn
* column(m_DataViewCtrlPtr
->GetColumnPtr(col
));
255 if (!(column
->IsHidden()))
257 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
261 model
->GetValue( value
, item
, column
->GetModelColumn() );
262 renderer
->SetValue( value
);
263 height
= wxMax( height
, renderer
->GetSize().y
);
268 m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(item
,height
);
272 void wxOSXDataViewModelNotifier::AdjustRowHeights(wxDataViewItemArray
const& items
)
274 if ((m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
276 size_t const noOfItems
= items
.GetCount();
278 wxDataViewModel
*model
= GetOwner();
280 for (size_t itemIndex
=0; itemIndex
<noOfItems
; ++itemIndex
)
282 int height
= 20; // TODO find out standard height
283 unsigned int num
= m_DataViewCtrlPtr
->GetColumnCount();
286 for (col
= 0; col
< num
; col
++)
288 wxDataViewColumn
* column(m_DataViewCtrlPtr
->GetColumnPtr(col
));
290 if (!(column
->IsHidden()))
292 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
296 model
->GetValue( value
, items
[itemIndex
], column
->GetModelColumn() );
297 renderer
->SetValue( value
);
298 height
= wxMax( height
, renderer
->GetSize().y
);
303 m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(items
[itemIndex
],height
);
308 void wxOSXDataViewModelNotifier::AdjustAutosizedColumns()
310 unsigned count
= m_DataViewCtrlPtr
->GetColumnCount();
311 for ( unsigned col
= 0; col
< count
; col
++ )
313 wxDataViewColumn
*column
= m_DataViewCtrlPtr
->GetColumnPtr(col
);
315 if ( column
->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE
)
316 m_DataViewCtrlPtr
->GetDataViewPeer()->FitColumnWidthToContent(col
);
320 // ---------------------------------------------------------
321 // wxDataViewCustomRenderer
322 // The constructor, the implementation macro and environment
323 // dependent methods can be found in the environment's
325 // ---------------------------------------------------------
326 wxDataViewCustomRenderer::~wxDataViewCustomRenderer()
331 wxDC
* wxDataViewCustomRenderer::GetDC()
333 if ((m_DCPtr
== NULL
) && (GetOwner() != NULL
) && (GetOwner()->GetOwner() != NULL
))
334 m_DCPtr
= new wxClientDC(GetOwner()->GetOwner());
338 void wxDataViewCustomRenderer::SetDC(wxDC
* newDCPtr
)
344 //-----------------------------------------------------------------------------
346 //-----------------------------------------------------------------------------
348 wxDataViewCtrl::~wxDataViewCtrl()
352 // Ensure that the already destructed controls is not notified about changes
353 // in the model any more.
354 if (m_ModelNotifier
!= NULL
)
355 m_ModelNotifier
->GetOwner()->RemoveNotifier(m_ModelNotifier
);
358 void wxDataViewCtrl::Init()
360 m_CustomRendererPtr
= NULL
;
363 m_ModelNotifier
= NULL
;
366 bool wxDataViewCtrl::Create(wxWindow
*parent
,
371 const wxValidator
& validator
,
372 const wxString
& name
)
375 if (!(wxControl::Create(parent
,id
,pos
,size
,style
,validator
,name
)))
377 SetPeer(::CreateDataView(this,parent
,id
,pos
,size
,style
,GetExtraStyle()));
379 MacPostControlCreate(pos
,size
);
384 bool wxDataViewCtrl::AssociateModel(wxDataViewModel
* model
)
386 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer());
389 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
,false,"Pointer to native control must not be NULL.");
391 // We could have been associated with another model previously, break the
392 // association in this case.
393 if ( m_ModelNotifier
)
394 m_ModelNotifier
->GetOwner()->RemoveNotifier(m_ModelNotifier
);
396 if (wxDataViewCtrlBase::AssociateModel(model
) && dataViewWidgetPtr
->AssociateModel(model
))
400 m_ModelNotifier
= new wxOSXDataViewModelNotifier(this);
401 model
->AddNotifier(m_ModelNotifier
);
409 bool wxDataViewCtrl::AppendColumn(wxDataViewColumn
* columnPtr
)
411 return wxDataViewCtrl::InsertColumn( GetColumnCount(), columnPtr
);
414 bool wxDataViewCtrl::PrependColumn(wxDataViewColumn
* columnPtr
)
416 return wxDataViewCtrl::InsertColumn( 0, columnPtr
);
419 bool wxDataViewCtrl::InsertColumn(unsigned int pos
, wxDataViewColumn
* columnPtr
)
421 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer());
423 // first, some error checking:
424 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
, false,"Pointer to native control must not be NULL.");
425 wxCHECK_MSG(columnPtr
!= NULL
, false,"Column pointer must not be NULL.");
426 wxCHECK_MSG(columnPtr
->GetRenderer() != NULL
, false,"Column does not have a renderer.");
427 wxCHECK_MSG(GetModel() != NULL
, false,"No model associated with control.");
428 wxCHECK_MSG(columnPtr
->GetModelColumn() < GetModel()->GetColumnCount(),false,"Column's model column has no equivalent in the associated model.");
430 // add column to wxWidget's internal structure:
431 if (wxDataViewCtrlBase::InsertColumn(pos
,columnPtr
))
433 m_ColumnPtrs
.Add(columnPtr
);
434 // if the insertion in the native control is successful the rest can also be initialized:
435 if (dataViewWidgetPtr
->InsertColumn(pos
,columnPtr
))
437 // make sure that the data is up-to-date...
438 // if the newly appended column is the first column add the initial data to the control and mark the column as an expander column,
439 // otherwise ask the control to 'update' the data in the newly appended column:
440 if (GetColumnCount() == 1)
441 SetExpanderColumn(columnPtr
);
448 m_ColumnPtrs
.Remove(columnPtr
);
450 // and send a message in debug mode:
451 wxFAIL_MSG("Column could not be added to native control.");
460 wxFAIL_MSG("Could not add column to internal structures.");
466 bool wxDataViewCtrl::ClearColumns()
468 if (GetDataViewPeer()->ClearColumns())
470 WX_CLEAR_ARRAY(m_ColumnPtrs
);
477 bool wxDataViewCtrl::DeleteColumn(wxDataViewColumn
* columnPtr
)
479 if (GetDataViewPeer()->DeleteColumn(columnPtr
))
481 m_ColumnPtrs
.Remove(columnPtr
);
489 wxDataViewColumn
* wxDataViewCtrl::GetColumn(unsigned int pos
) const
491 return GetDataViewPeer()->GetColumn(pos
);
494 unsigned int wxDataViewCtrl::GetColumnCount() const
496 return m_ColumnPtrs
.GetCount();
499 int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn
const* columnPtr
) const
501 return GetDataViewPeer()->GetColumnPosition(columnPtr
);
504 void wxDataViewCtrl::Collapse(wxDataViewItem
const& item
)
506 GetDataViewPeer()->Collapse(item
);
509 void wxDataViewCtrl::EnsureVisible(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
)
513 ExpandAncestors(item
); // make sure that the item exists in the control
514 GetDataViewPeer()->EnsureVisible(item
,columnPtr
);
518 void wxDataViewCtrl::Expand(wxDataViewItem
const& item
)
520 return GetDataViewPeer()->Expand(item
);
523 bool wxDataViewCtrl::IsExpanded( const wxDataViewItem
& item
) const
525 return (item
.IsOk() && GetDataViewPeer()->IsExpanded(item
));
528 wxDataViewColumn
* wxDataViewCtrl::GetSortingColumn() const
530 return GetDataViewPeer()->GetSortingColumn();
533 unsigned int wxDataViewCtrl::GetCount() const
535 return GetDataViewPeer()->GetCount();
538 wxDataViewItem
wxDataViewCtrl::DoGetCurrentItem() const
540 return GetDataViewPeer()->GetCurrentItem();
543 void wxDataViewCtrl::DoSetCurrentItem(const wxDataViewItem
& item
)
545 GetDataViewPeer()->SetCurrentItem(item
);
548 wxDataViewColumn
*wxDataViewCtrl::GetCurrentColumn() const
550 return GetDataViewPeer()->GetCurrentColumn();
553 wxRect
wxDataViewCtrl::GetItemRect(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
) const
555 if (item
.IsOk() && (columnPtr
!= NULL
))
556 return GetDataViewPeer()->GetRectangle(item
,columnPtr
);
561 int wxDataViewCtrl::GetSelectedItemsCount() const
563 return GetDataViewPeer()->GetSelectedItemsCount();
566 int wxDataViewCtrl::GetSelections(wxDataViewItemArray
& sel
) const
568 return GetDataViewPeer()->GetSelections(sel
);
571 void wxDataViewCtrl::HitTest(wxPoint
const& point
, wxDataViewItem
& item
, wxDataViewColumn
*& columnPtr
) const
573 return GetDataViewPeer()->HitTest(point
,item
,columnPtr
);
576 bool wxDataViewCtrl::IsSelected(wxDataViewItem
const& item
) const
578 return GetDataViewPeer()->IsSelected(item
);
581 void wxDataViewCtrl::Select(wxDataViewItem
const& item
)
585 ExpandAncestors(item
); // make sure that the item exists in the control
586 GetDataViewPeer()->Select(item
);
590 void wxDataViewCtrl::SelectAll()
592 GetDataViewPeer()->SelectAll();
595 void wxDataViewCtrl::SetSelections(wxDataViewItemArray
const& sel
)
597 size_t const noOfSelections
= sel
.GetCount();
601 wxDataViewItem last_parent
;
604 // make sure that all to be selected items are visible in the control:
605 for (i
= 0; i
< noOfSelections
; i
++)
607 wxDataViewItem item
= sel
[i
];
608 wxDataViewItem parent
= GetModel()->GetParent( item
);
610 if (parent
.IsOk() && (parent
!= last_parent
))
611 ExpandAncestors(item
);
612 last_parent
= parent
;
615 // finally select the items:
616 wxDataViewWidgetImpl
* dataViewWidgetPtr(GetDataViewPeer()); // variable definition for abbreviational purposes
618 for (i
=0; i
<noOfSelections
; ++i
)
619 dataViewWidgetPtr
->Select(sel
[i
]);
622 void wxDataViewCtrl::Unselect(wxDataViewItem
const& item
)
625 GetDataViewPeer()->Unselect(item
);
628 void wxDataViewCtrl::UnselectAll()
630 GetDataViewPeer()->UnselectAll();
636 wxDataViewWidgetImpl
* wxDataViewCtrl::GetDataViewPeer() const
638 return dynamic_cast<wxDataViewWidgetImpl
*>(GetPeer());
641 void wxDataViewCtrl::AddChildren(wxDataViewItem
const& parentItem
)
645 wxDataViewItemArray items
;
648 wxCHECK_RET(GetModel() != NULL
,"Model pointer not initialized.");
649 noOfChildren
= GetModel()->GetChildren(parentItem
,items
);
650 (void) GetModel()->ItemsAdded(parentItem
,items
);
653 void wxDataViewCtrl::EditItem(const wxDataViewItem
& item
, const wxDataViewColumn
*column
)
655 GetDataViewPeer()->StartEditor(item
, GetColumnPosition(column
));
658 void wxDataViewCtrl::FinishCustomItemEditing()
660 if (GetCustomRendererItem().IsOk())
662 GetCustomRendererPtr()->FinishEditing();
663 SetCustomRendererItem(wxDataViewItem());
664 SetCustomRendererPtr (NULL
);
670 wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant
WXUNUSED(variant
))
672 wxVisualAttributes attr
;
674 attr
.colFg
= wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT
);
675 attr
.colBg
= wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX
);
676 static wxFont font
= wxFont(wxOSX_SYSTEM_FONT_VIEWS
);
682 // inherited methods from wxDataViewCtrlBase
683 void wxDataViewCtrl::DoSetExpanderColumn()
685 if (GetExpanderColumn() != NULL
)
686 GetDataViewPeer()->DoSetExpanderColumn(GetExpanderColumn());
689 void wxDataViewCtrl::DoSetIndent()
691 GetDataViewPeer()->DoSetIndent(GetIndent());
695 void wxDataViewCtrl::OnSize(wxSizeEvent
& event
)
697 unsigned int const noOfColumns
= GetColumnCount();
700 // reset DC of all custom renderers because DC has changed:
701 for (unsigned int i
=0; i
<noOfColumns
; ++i
)
703 wxDataViewColumn
* dataViewColumnPtr(GetColumn(i
));
705 if (dataViewColumnPtr
!= NULL
)
707 wxDataViewCustomRenderer
* dataViewCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer
*>(dataViewColumnPtr
->GetRenderer()));
709 if (dataViewCustomRendererPtr
!= NULL
)
710 dataViewCustomRendererPtr
->SetDC(NULL
);
714 // update the layout of the native control after a size event:
715 GetDataViewPeer()->OnSize();
720 wxSize
wxDataViewCtrl::DoGetBestSize() const
722 wxSize best
= wxControl::DoGetBestSize();
728 void wxDataViewCtrl::OnMouse(wxMouseEvent
& event
)
733 if (GetModel() == NULL
)
736 wxMacDataViewDataBrowserListViewControlPointer
MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer
>(GetPeer()));
739 wxDataViewItemArray items
;
740 NoOfChildren
= GetModel()->GetChildren( wxDataViewItem(), items
);
741 if (NoOfChildren
== 0)
743 wxDataViewItem firstChild
= items
[0];
745 UInt16 headerHeight
= 0;
746 MacDataViewListCtrlPtr
->GetHeaderButtonHeight(&headerHeight
);
749 if (event
.GetY() < headerHeight
)
751 unsigned int col_count
= GetColumnCount();
753 for (col
= 0; col
< col_count
; col
++)
755 wxDataViewColumn
*column
= GetColumn( col
);
756 if (column
->IsHidden())
760 ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr
->GetControlRef(),
761 reinterpret_cast<DataBrowserItemID
>(firstChild
.GetID()), column
->GetNativeData()->GetPropertyID(),
762 kDataBrowserPropertyEnclosingPart
, &itemrect
);
764 if (abs( event
.GetX() - itemrect
.right
) < 3)
766 if (column
->GetFlags() & wxDATAVIEW_COL_RESIZABLE
)
767 SetCursor( wxCursor( wxCURSOR_SIZEWE
) );
769 SetCursor( *wxSTANDARD_CURSOR
);
775 SetCursor( *wxSTANDARD_CURSOR
);
779 IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl
,wxDataViewCtrlBase
)
781 BEGIN_EVENT_TABLE(wxDataViewCtrl
,wxDataViewCtrlBase
)
782 EVT_SIZE(wxDataViewCtrl::OnSize
)
783 EVT_MOTION(wxDataViewCtrl::OnMouse
)
786 #endif // (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))