1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/osx/dataview_osx.cpp
3 // Purpose: wxDataViewCtrl native mac implementation
5 // Id: $Id: dataview_osx.cpp 58317 2009-01-27
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))
15 #include <carbon/carbon.h>
20 #include "wx/settings.h"
21 #include "wx/dcclient.h"
25 #include "wx/osx/core/dataview.h"
26 #include "wx/osx/private.h"
27 #include "wx/renderer.h"
29 // ============================================================================
30 // Helper functions for dataviewe implementation on OSX
31 // ============================================================================
32 wxString
ConcatenateDataViewItemValues(wxDataViewCtrl
const* dataViewCtrlPtr
, wxDataViewItem
const& dataViewItem
)
34 wxString dataString
; // contains the TAB concatenated data
37 for (size_t i
=0; i
<dataViewCtrlPtr
->GetColumnCount(); i
++)
39 // variable definition:
42 dataViewCtrlPtr
->GetModel()->GetValue(dataValue
,dataViewItem
,dataViewCtrlPtr
->GetColumn(i
)->GetModelColumn());
44 dataString
<< wxT('\t');
45 dataString
<< dataValue
.MakeString();
50 // ============================================================================
51 // wxOSXDataViewModelNotifier
52 // ============================================================================
53 class wxOSXDataViewModelNotifier
: public wxDataViewModelNotifier
57 // constructors / destructor
59 wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
);
62 // inherited methods from wxDataViewModelNotifier
64 virtual bool ItemAdded (wxDataViewItem
const &parent
, wxDataViewItem
const &item
);
65 virtual bool ItemsAdded (wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
66 virtual bool ItemChanged (wxDataViewItem
const& item
);
67 virtual bool ItemsChanged(wxDataViewItemArray
const& items
);
68 virtual bool ItemDeleted (wxDataViewItem
const& parent
, wxDataViewItem
const& item
);
69 virtual bool ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
70 virtual bool ValueChanged(wxDataViewItem
const& item
, unsigned int col
);
71 virtual bool Cleared();
72 virtual void Resort();
75 // if the dataview control can have a variable row height this method sets the dataview's control row height of
76 // the passed item to the maximum value occupied by the item in all columns
77 void AdjustRowHeight(wxDataViewItem
const& item
);
78 // ... and the same method for a couple of items:
79 void AdjustRowHeights(wxDataViewItemArray
const& items
);
82 wxDataViewCtrl
* m_DataViewCtrlPtr
;
86 // constructors / destructor
88 wxOSXDataViewModelNotifier::wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
)
89 :m_DataViewCtrlPtr(initDataViewCtrlPtr
)
91 if (initDataViewCtrlPtr
== NULL
)
92 wxFAIL_MSG(_("Pointer to dataview control must not be NULL"));
95 bool wxOSXDataViewModelNotifier::ItemAdded(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
100 wxCHECK_MSG(item
.IsOk(),false,_("Added item is invalid."));
101 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,item
);
102 this->AdjustRowHeight(item
);
103 return noFailureFlag
;
106 bool wxOSXDataViewModelNotifier::ItemsAdded(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
111 // insert all valid items into control:
112 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,items
);
113 // adjust row heights:
114 this->AdjustRowHeights(items
);
116 return noFailureFlag
;
119 bool wxOSXDataViewModelNotifier::ItemChanged(wxDataViewItem
const& item
)
121 wxCHECK_MSG(item
.IsOk(), false,_("Changed item is invalid."));
122 wxCHECK_MSG(this->GetOwner() != NULL
,false,_("Owner not initialized."));
123 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(item
),item
))
125 // sent the equivalent wxWidget event:
126 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
128 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
129 dataViewEvent
.SetItem(item
);
130 // sent the equivalent wxWidget event:
131 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
132 // row height may have to be adjusted:
133 this->AdjustRowHeight(item
);
141 bool wxOSXDataViewModelNotifier::ItemsChanged(wxDataViewItemArray
const& items
)
143 size_t const noOfItems
= items
.GetCount();
145 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
148 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
149 for (size_t indexItem
=0; indexItem
<noOfItems
; ++indexItem
)
150 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(items
[indexItem
]),items
[indexItem
]))
152 // send for all changed items a wxWidget event:
153 dataViewEvent
.SetItem(items
[indexItem
]);
154 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
158 // if this location is reached all items have been updated:
159 this->AdjustRowHeights(items
);
164 bool wxOSXDataViewModelNotifier::ItemDeleted(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
169 wxCHECK_MSG(item
.IsOk(),false,_("To be deleted item is invalid."));
170 // 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
171 // not to be identical because the being edited item might be below the passed item in the hierarchy);
172 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
173 // has been started and that variables can currently not be updated even when requested by the system:
174 this->m_DataViewCtrlPtr
->SetDeleting(true);
175 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,item
);
176 // enable automatic updating again:
177 this->m_DataViewCtrlPtr
->SetDeleting(false);
179 return noFailureFlag
;
182 bool wxOSXDataViewModelNotifier::ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
187 // 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
188 // not to be identical because the being edited item might be below the passed item in the hierarchy);
189 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
190 // has been started and that variables can currently not be updated even when requested by the system:
191 this->m_DataViewCtrlPtr
->SetDeleting(true);
192 // delete all specified items:
193 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,items
);
194 // enable automatic updating again:
195 this->m_DataViewCtrlPtr
->SetDeleting(false);
197 return noFailureFlag
;
200 bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem
const& item
, unsigned int col
)
202 wxCHECK_MSG(item
.IsOk(), false,_("Passed item is invalid."));
203 wxCHECK_MSG(this->GetOwner() != NULL
,false,_("Owner not initialized."));
204 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(item
),item
))
206 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
208 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
209 dataViewEvent
.SetColumn(col
);
210 dataViewEvent
.SetItem(item
);
211 // send the equivalent wxWidget event:
212 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
220 bool wxOSXDataViewModelNotifier::Cleared()
222 return this->m_DataViewCtrlPtr
->GetDataViewPeer()->Reload();
225 void wxOSXDataViewModelNotifier::Resort()
227 this->m_DataViewCtrlPtr
->GetDataViewPeer()->Resort();
230 void wxOSXDataViewModelNotifier::AdjustRowHeight(wxDataViewItem
const& item
)
232 if ((this->m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
234 wxDataViewModel
*model
= this->GetOwner();
236 int height
= 20; // TODO find out standard height
237 unsigned int num
= this->m_DataViewCtrlPtr
->GetColumnCount();
239 for (col
= 0; col
< num
; col
++)
241 wxDataViewColumn
* column(this->m_DataViewCtrlPtr
->GetColumnPtr(col
));
243 if (!(column
->IsHidden()))
245 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
249 model
->GetValue( value
, item
, column
->GetModelColumn() );
250 renderer
->SetValue( value
);
251 height
= wxMax( height
, renderer
->GetSize().y
);
256 this->m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(item
,height
);
260 void wxOSXDataViewModelNotifier::AdjustRowHeights(wxDataViewItemArray
const& items
)
262 if ((this->m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
264 size_t const noOfItems
= items
.GetCount();
266 wxDataViewModel
*model
= this->GetOwner();
268 for (size_t itemIndex
=0; itemIndex
<noOfItems
; ++itemIndex
)
270 int height
= 20; // TODO find out standard height
271 unsigned int num
= this->m_DataViewCtrlPtr
->GetColumnCount();
274 for (col
= 0; col
< num
; col
++)
276 wxDataViewColumn
* column(this->m_DataViewCtrlPtr
->GetColumnPtr(col
));
278 if (!(column
->IsHidden()))
280 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
284 model
->GetValue( value
, items
[itemIndex
], column
->GetModelColumn() );
285 renderer
->SetValue( value
);
286 height
= wxMax( height
, renderer
->GetSize().y
);
291 this->m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(items
[itemIndex
],height
);
296 // ---------------------------------------------------------
297 // wxDataViewCustomRenderer
298 // The constructor, the implementation macro and environment
299 // dependent methods can be found in the environment's
301 // ---------------------------------------------------------
302 wxDataViewCustomRenderer::~wxDataViewCustomRenderer(void)
304 delete this->m_DCPtr
;
307 void wxDataViewCustomRenderer::RenderText( const wxString
&text
, int xoffset
, wxRect cell
, wxDC
*dc
, int state
)
309 wxDataViewCtrl
*view
= GetOwner()->GetOwner();
311 wxColour col
= (state
& wxDATAVIEW_CELL_SELECTED
) ? *wxWHITE
: view
->GetForegroundColour();
312 dc
->SetTextForeground(col
);
313 dc
->DrawText( text
, cell
.x
+ xoffset
, cell
.y
+ ((cell
.height
- dc
->GetCharHeight()) / 2));
316 wxDC
* wxDataViewCustomRenderer::GetDC()
318 if ((this->m_DCPtr
== NULL
) && (this->GetOwner() != NULL
) && (this->GetOwner()->GetOwner() != NULL
))
319 this->m_DCPtr
= new wxClientDC(this->GetOwner()->GetOwner());
320 return this->m_DCPtr
;
323 void wxDataViewCustomRenderer::SetDC(wxDC
* newDCPtr
)
329 // ---------------------------------------------------------
330 // wxDataViewTextRendererAttr
331 // ---------------------------------------------------------
332 wxDataViewTextRendererAttr::wxDataViewTextRendererAttr(wxString
const& varianttype
, wxDataViewCellMode mode
, int align
)
333 :wxDataViewTextRenderer(varianttype
,mode
,align
)
337 IMPLEMENT_CLASS(wxDataViewTextRendererAttr
,wxDataViewTextRenderer
)
339 //-----------------------------------------------------------------------------
341 //-----------------------------------------------------------------------------
343 wxDataViewCtrl::~wxDataViewCtrl()
345 this->ClearColumns();
348 void wxDataViewCtrl::Init()
350 m_CustomRendererPtr
= NULL
;
352 m_macIsUserPane
= false;
356 bool wxDataViewCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
, const wxValidator
& validator
)
358 if (!(this->wxControl::Create(parent
,id
,pos
,size
,style
& ~(wxHSCROLL
| wxVSCROLL
),validator
)))
360 m_peer
= ::CreateDataView(this,parent
,id
,pos
,size
,style
,this->GetExtraStyle());
362 this->MacPostControlCreate(pos
,size
);
367 bool wxDataViewCtrl::AssociateModel(wxDataViewModel
* model
)
369 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer());
372 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
,false,_("Pointer to native control must not be NULL."));
373 if (wxDataViewCtrlBase::AssociateModel(model
) && dataViewWidgetPtr
->AssociateModel(model
))
376 model
->AddNotifier(new wxOSXDataViewModelNotifier(this));
383 bool wxDataViewCtrl::AppendColumn(wxDataViewColumn
* columnPtr
)
385 return wxDataViewCtrl::InsertColumn( GetColumnCount(), columnPtr
);
388 bool wxDataViewCtrl::PrependColumn(wxDataViewColumn
* columnPtr
)
390 return wxDataViewCtrl::InsertColumn( 0, columnPtr
);
393 bool wxDataViewCtrl::InsertColumn(unsigned int pos
, wxDataViewColumn
* columnPtr
)
395 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer());
397 // first, some error checking:
398 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
, false,_("Pointer to native control must not be NULL."));
399 wxCHECK_MSG(columnPtr
!= NULL
, false,_("Column pointer must not be NULL."));
400 wxCHECK_MSG(columnPtr
->GetRenderer() != NULL
, false,_("Column does not have a renderer."));
401 wxCHECK_MSG(this->GetModel() != NULL
, false,_("No model associated with control."));
402 wxCHECK_MSG((columnPtr
->GetModelColumn() >= 0) &&
403 (columnPtr
->GetModelColumn() < this->GetModel()->GetColumnCount()),false,_("Column's model column has no equivalent in the associated model."));
405 // add column to wxWidget's internal structure:
406 if (this->wxDataViewCtrlBase::InsertColumn(pos
,columnPtr
))
408 this->m_ColumnPtrs
.Add(columnPtr
);
409 // if the insertion in the native control is successful the rest can also be initialized:
410 if (dataViewWidgetPtr
->InsertColumn(pos
,columnPtr
))
412 // make sure that the data is up-to-date...
413 // if the newly appended column is the first column add the initial data to the control and mark the column as an expander column,
414 // otherwise ask the control to 'update' the data in the newly appended column:
415 if (this->GetColumnCount() == 1)
416 this->SetExpanderColumn(columnPtr
);
423 this->m_ColumnPtrs
.Remove(columnPtr
);
425 // and send a message in debug mode:
426 wxFAIL_MSG(_("Column could not be added to native control."));
435 wxFAIL_MSG(_("Could not add column to internal structures."));
441 bool wxDataViewCtrl::ClearColumns()
443 if (this->GetDataViewPeer()->ClearColumns())
445 WX_CLEAR_ARRAY(this->m_ColumnPtrs
);
452 bool wxDataViewCtrl::DeleteColumn(wxDataViewColumn
* columnPtr
)
454 if (this->GetDataViewPeer()->DeleteColumn(columnPtr
))
456 this->m_ColumnPtrs
.Remove(columnPtr
);
464 wxDataViewColumn
* wxDataViewCtrl::GetColumn(unsigned int pos
) const
466 return this->GetDataViewPeer()->GetColumn(pos
);
469 unsigned int wxDataViewCtrl::GetColumnCount() const
471 return this->m_ColumnPtrs
.GetCount();
474 int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn
const* columnPtr
) const
476 return this->GetDataViewPeer()->GetColumnPosition(columnPtr
);
479 void wxDataViewCtrl::Collapse(wxDataViewItem
const& item
)
481 this->GetDataViewPeer()->Collapse(item
);
484 void wxDataViewCtrl::EnsureVisible(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
)
488 this->ExpandAncestors(item
); // make sure that the item exists in the control
489 this->GetDataViewPeer()->EnsureVisible(item
,columnPtr
);
493 void wxDataViewCtrl::Expand(wxDataViewItem
const& item
)
495 return this->GetDataViewPeer()->Expand(item
);
498 bool wxDataViewCtrl::IsExpanded( const wxDataViewItem
& item
) const
500 return (item
.IsOk() && this->GetDataViewPeer()->IsExpanded(item
));
503 wxDataViewColumn
* wxDataViewCtrl::GetSortingColumn() const
505 return this->GetDataViewPeer()->GetSortingColumn();
508 unsigned int wxDataViewCtrl::GetCount() const
510 return this->GetDataViewPeer()->GetCount();
513 wxRect
wxDataViewCtrl::GetItemRect(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
) const
515 if (item
.IsOk() && (columnPtr
!= NULL
))
516 return this->GetDataViewPeer()->GetRectangle(item
,columnPtr
);
521 wxDataViewItem
wxDataViewCtrl::GetSelection() const
523 wxDataViewItemArray itemIDs
;
526 if (this->GetDataViewPeer()->GetSelections(itemIDs
) > 0)
529 return wxDataViewItem();
532 int wxDataViewCtrl::GetSelections(wxDataViewItemArray
& sel
) const
534 return this->GetDataViewPeer()->GetSelections(sel
);
537 void wxDataViewCtrl::HitTest(wxPoint
const& point
, wxDataViewItem
& item
, wxDataViewColumn
*& columnPtr
) const
539 return this->GetDataViewPeer()->HitTest(point
,item
,columnPtr
);
542 bool wxDataViewCtrl::IsSelected(wxDataViewItem
const& item
) const
544 return this->GetDataViewPeer()->IsSelected(item
);
547 void wxDataViewCtrl::Select(wxDataViewItem
const& item
)
551 this->ExpandAncestors(item
); // make sure that the item exists in the control
552 this->GetDataViewPeer()->Select(item
);
556 void wxDataViewCtrl::SelectAll(void)
558 this->GetDataViewPeer()->SelectAll();
561 void wxDataViewCtrl::SetSelections(wxDataViewItemArray
const& sel
)
563 size_t const noOfSelections
= sel
.GetCount();
567 wxDataViewItem last_parent
;
570 // make sure that all to be selected items are visible in the control:
571 for (i
= 0; i
< noOfSelections
; i
++)
573 wxDataViewItem item
= sel
[i
];
574 wxDataViewItem parent
= this->GetModel()->GetParent( item
);
576 if (parent
.IsOk() && (parent
!= last_parent
))
577 this->ExpandAncestors(item
);
578 last_parent
= parent
;
581 // finally select the items:
582 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer()); // variable definition for abbreviational purposes
584 for (i
=0; i
<noOfSelections
; ++i
)
585 dataViewWidgetPtr
->Select(sel
[i
]);
588 void wxDataViewCtrl::Unselect(wxDataViewItem
const& item
)
591 this->GetDataViewPeer()->Unselect(item
);
594 void wxDataViewCtrl::UnselectAll(void)
596 this->GetDataViewPeer()->UnselectAll();
602 wxDataViewWidgetImpl
* wxDataViewCtrl::GetDataViewPeer(void) const
604 return dynamic_cast<wxDataViewWidgetImpl
*>(this->GetPeer());
607 void wxDataViewCtrl::AddChildren(wxDataViewItem
const& parentItem
)
611 wxDataViewItemArray items
;
614 wxCHECK_RET(this->GetModel() != NULL
,_("Model pointer not initialized."));
615 noOfChildren
= this->GetModel()->GetChildren(parentItem
,items
);
616 (void) this->GetModel()->ItemsAdded(parentItem
,items
);
619 void wxDataViewCtrl::FinishCustomItemEditing(void)
621 if (this->GetCustomRendererItem().IsOk())
623 this->GetCustomRendererPtr()->FinishEditing();
624 this->SetCustomRendererItem(wxDataViewItem());
625 this->SetCustomRendererPtr (NULL
);
630 wxVisualAttributes
wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant variant
)
632 wxVisualAttributes attr
;
634 attr
.colFg
= wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOWTEXT
);
635 attr
.colBg
= wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOX
);
636 attr
.font
.CreateSystemFont(wxOSX_SYSTEM_FONT_VIEWS
);
641 // inherited methods from wxDataViewCtrlBase
642 void wxDataViewCtrl::DoSetExpanderColumn()
644 if (this->GetExpanderColumn() != NULL
)
645 this->GetDataViewPeer()->DoSetExpanderColumn(this->GetExpanderColumn());
648 void wxDataViewCtrl::DoSetIndent()
650 this->GetDataViewPeer()->DoSetIndent(this->GetIndent());
654 void wxDataViewCtrl::OnSize(wxSizeEvent
& event
)
656 unsigned int const noOfColumns
= this->GetColumnCount();
659 // reset DC of all custom renderers because DC has changed:
660 for (unsigned int i
=0; i
<noOfColumns
; ++i
)
662 wxDataViewColumn
* dataViewColumnPtr(this->GetColumn(i
));
664 if (dataViewColumnPtr
!= NULL
)
666 wxDataViewCustomRenderer
* dataViewCustomRendererPtr(dynamic_cast<wxDataViewCustomRenderer
*>(dataViewColumnPtr
->GetRenderer()));
668 if (dataViewCustomRendererPtr
!= NULL
)
669 dataViewCustomRendererPtr
->SetDC(NULL
);
673 // update the layout of the native control after a size event:
674 this->GetDataViewPeer()->OnSize();
679 wxSize
wxDataViewCtrl::DoGetBestSize() const
681 wxSize best
= wxControl::DoGetBestSize();
687 void wxDataViewCtrl::OnMouse(wxMouseEvent
& event
)
691 if (GetModel() == NULL
)
695 // Doesn't compile anymore
696 wxMacDataViewDataBrowserListViewControlPointer
MacDataViewListCtrlPtr(dynamic_cast<wxMacDataViewDataBrowserListViewControlPointer
>(m_peer
));
699 wxDataViewItemArray items
;
700 NoOfChildren
= GetModel()->GetChildren( wxDataViewItem(), items
);
701 if (NoOfChildren
== 0)
703 wxDataViewItem firstChild
= items
[0];
705 UInt16 headerHeight
= 0;
706 MacDataViewListCtrlPtr
->GetHeaderButtonHeight(&headerHeight
);
709 if (event
.GetY() < headerHeight
)
711 unsigned int col_count
= GetColumnCount();
713 for (col
= 0; col
< col_count
; col
++)
715 wxDataViewColumn
*column
= GetColumn( col
);
716 if (column
->IsHidden())
720 ::GetDataBrowserItemPartBounds( MacDataViewListCtrlPtr
->GetControlRef(),
721 reinterpret_cast<DataBrowserItemID
>(firstChild
.GetID()), column
->GetPropertyID(),
722 kDataBrowserPropertyEnclosingPart
, &itemrect
);
724 if (abs( event
.GetX() - itemrect
.right
) < 3)
726 if (column
->GetFlags() & wxDATAVIEW_COL_RESIZABLE
)
727 SetCursor( wxCursor( wxCURSOR_SIZEWE
) );
729 SetCursor( *wxSTANDARD_CURSOR
);
736 SetCursor( *wxSTANDARD_CURSOR
);
740 IMPLEMENT_DYNAMIC_CLASS(wxDataViewCtrl
,wxDataViewCtrlBase
)
742 BEGIN_EVENT_TABLE(wxDataViewCtrl
,wxDataViewCtrlBase
)
743 EVT_SIZE(wxDataViewCtrl::OnSize
)
744 EVT_MOTION(wxDataViewCtrl::OnMouse
)
747 #endif // (wxUSE_DATAVIEWCTRL != 0) && (!defined(wxUSE_GENERICDATAVIEWCTRL) || (wxUSE_GENERICDATAVIEWCTRL == 0))