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))
19 #include "wx/settings.h"
20 #include "wx/dcclient.h"
24 #include "wx/osx/core/dataview.h"
25 #include "wx/osx/private.h"
26 #include "wx/renderer.h"
28 // ============================================================================
29 // Helper functions for dataviewe implementation on OSX
30 // ============================================================================
31 wxString
ConcatenateDataViewItemValues(wxDataViewCtrl
const* dataViewCtrlPtr
, wxDataViewItem
const& dataViewItem
)
33 wxString dataString
; // contains the TAB concatenated data
36 for (size_t i
=0; i
<dataViewCtrlPtr
->GetColumnCount(); i
++)
38 // variable definition:
41 dataViewCtrlPtr
->GetModel()->GetValue(dataValue
,dataViewItem
,dataViewCtrlPtr
->GetColumn(i
)->GetModelColumn());
43 dataString
<< wxT('\t');
44 dataString
<< dataValue
.MakeString();
49 // ============================================================================
50 // wxOSXDataViewModelNotifier
51 // ============================================================================
52 class wxOSXDataViewModelNotifier
: public wxDataViewModelNotifier
56 // constructors / destructor
58 wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
);
61 // inherited methods from wxDataViewModelNotifier
63 virtual bool ItemAdded (wxDataViewItem
const &parent
, wxDataViewItem
const &item
);
64 virtual bool ItemsAdded (wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
65 virtual bool ItemChanged (wxDataViewItem
const& item
);
66 virtual bool ItemsChanged(wxDataViewItemArray
const& items
);
67 virtual bool ItemDeleted (wxDataViewItem
const& parent
, wxDataViewItem
const& item
);
68 virtual bool ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
);
69 virtual bool ValueChanged(wxDataViewItem
const& item
, unsigned int col
);
70 virtual bool Cleared();
71 virtual void Resort();
74 // if the dataview control can have a variable row height this method sets the dataview's control row height of
75 // the passed item to the maximum value occupied by the item in all columns
76 void AdjustRowHeight(wxDataViewItem
const& item
);
77 // ... and the same method for a couple of items:
78 void AdjustRowHeights(wxDataViewItemArray
const& items
);
81 wxDataViewCtrl
* m_DataViewCtrlPtr
;
85 // constructors / destructor
87 wxOSXDataViewModelNotifier::wxOSXDataViewModelNotifier(wxDataViewCtrl
* initDataViewCtrlPtr
)
88 :m_DataViewCtrlPtr(initDataViewCtrlPtr
)
90 if (initDataViewCtrlPtr
== NULL
)
91 wxFAIL_MSG(_("Pointer to dataview control must not be NULL"));
94 bool wxOSXDataViewModelNotifier::ItemAdded(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
99 wxCHECK_MSG(item
.IsOk(),false,_("Added item is invalid."));
100 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,item
);
101 this->AdjustRowHeight(item
);
102 return noFailureFlag
;
105 bool wxOSXDataViewModelNotifier::ItemsAdded(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
110 // insert all valid items into control:
111 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Add(parent
,items
);
112 // adjust row heights:
113 this->AdjustRowHeights(items
);
115 return noFailureFlag
;
118 bool wxOSXDataViewModelNotifier::ItemChanged(wxDataViewItem
const& item
)
120 wxCHECK_MSG(item
.IsOk(), false,_("Changed item is invalid."));
121 wxCHECK_MSG(this->GetOwner() != NULL
,false,_("Owner not initialized."));
122 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(item
),item
))
124 // sent the equivalent wxWidget event:
125 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
127 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
128 dataViewEvent
.SetItem(item
);
129 // sent the equivalent wxWidget event:
130 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
131 // row height may have to be adjusted:
132 this->AdjustRowHeight(item
);
140 bool wxOSXDataViewModelNotifier::ItemsChanged(wxDataViewItemArray
const& items
)
142 size_t const noOfItems
= items
.GetCount();
144 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
147 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
148 for (size_t indexItem
=0; indexItem
<noOfItems
; ++indexItem
)
149 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(items
[indexItem
]),items
[indexItem
]))
151 // send for all changed items a wxWidget event:
152 dataViewEvent
.SetItem(items
[indexItem
]);
153 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
157 // if this location is reached all items have been updated:
158 this->AdjustRowHeights(items
);
163 bool wxOSXDataViewModelNotifier::ItemDeleted(wxDataViewItem
const& parent
, wxDataViewItem
const& item
)
168 wxCHECK_MSG(item
.IsOk(),false,_("To be deleted item is invalid."));
169 // 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
170 // not to be identical because the being edited item might be below the passed item in the hierarchy);
171 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
172 // has been started and that variables can currently not be updated even when requested by the system:
173 this->m_DataViewCtrlPtr
->SetDeleting(true);
174 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,item
);
175 // enable automatic updating again:
176 this->m_DataViewCtrlPtr
->SetDeleting(false);
178 return noFailureFlag
;
181 bool wxOSXDataViewModelNotifier::ItemsDeleted(wxDataViewItem
const& parent
, wxDataViewItemArray
const& items
)
186 // 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
187 // not to be identical because the being edited item might be below the passed item in the hierarchy);
188 // to prevent the control trying to ask the model to update an already deleted item the control is informed that currently a deleting process
189 // has been started and that variables can currently not be updated even when requested by the system:
190 this->m_DataViewCtrlPtr
->SetDeleting(true);
191 // delete all specified items:
192 noFailureFlag
= this->m_DataViewCtrlPtr
->GetDataViewPeer()->Remove(parent
,items
);
193 // enable automatic updating again:
194 this->m_DataViewCtrlPtr
->SetDeleting(false);
196 return noFailureFlag
;
199 bool wxOSXDataViewModelNotifier::ValueChanged(wxDataViewItem
const& item
, unsigned int col
)
201 wxCHECK_MSG(item
.IsOk(), false,_("Passed item is invalid."));
202 wxCHECK_MSG(this->GetOwner() != NULL
,false,_("Owner not initialized."));
203 if (this->m_DataViewCtrlPtr
->GetDataViewPeer()->Update(this->GetOwner()->GetParent(item
),item
))
205 wxDataViewEvent
dataViewEvent(wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED
,this->m_DataViewCtrlPtr
->GetId());
207 dataViewEvent
.SetEventObject(this->m_DataViewCtrlPtr
);
208 dataViewEvent
.SetColumn(col
);
209 dataViewEvent
.SetItem(item
);
210 // send the equivalent wxWidget event:
211 this->m_DataViewCtrlPtr
->HandleWindowEvent(dataViewEvent
);
219 bool wxOSXDataViewModelNotifier::Cleared()
221 return this->m_DataViewCtrlPtr
->GetDataViewPeer()->Reload();
224 void wxOSXDataViewModelNotifier::Resort()
226 this->m_DataViewCtrlPtr
->GetDataViewPeer()->Resort();
229 void wxOSXDataViewModelNotifier::AdjustRowHeight(wxDataViewItem
const& item
)
231 if ((this->m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
233 wxDataViewModel
*model
= this->GetOwner();
235 int height
= 20; // TODO find out standard height
236 unsigned int num
= this->m_DataViewCtrlPtr
->GetColumnCount();
238 for (col
= 0; col
< num
; col
++)
240 wxDataViewColumn
* column(this->m_DataViewCtrlPtr
->GetColumnPtr(col
));
242 if (!(column
->IsHidden()))
244 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
248 model
->GetValue( value
, item
, column
->GetModelColumn() );
249 renderer
->SetValue( value
);
250 height
= wxMax( height
, renderer
->GetSize().y
);
255 this->m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(item
,height
);
259 void wxOSXDataViewModelNotifier::AdjustRowHeights(wxDataViewItemArray
const& items
)
261 if ((this->m_DataViewCtrlPtr
->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT
) != 0)
263 size_t const noOfItems
= items
.GetCount();
265 wxDataViewModel
*model
= this->GetOwner();
267 for (size_t itemIndex
=0; itemIndex
<noOfItems
; ++itemIndex
)
269 int height
= 20; // TODO find out standard height
270 unsigned int num
= this->m_DataViewCtrlPtr
->GetColumnCount();
273 for (col
= 0; col
< num
; col
++)
275 wxDataViewColumn
* column(this->m_DataViewCtrlPtr
->GetColumnPtr(col
));
277 if (!(column
->IsHidden()))
279 wxDataViewCustomRenderer
*renderer
= dynamic_cast<wxDataViewCustomRenderer
*>(column
->GetRenderer());
283 model
->GetValue( value
, items
[itemIndex
], column
->GetModelColumn() );
284 renderer
->SetValue( value
);
285 height
= wxMax( height
, renderer
->GetSize().y
);
290 this->m_DataViewCtrlPtr
->GetDataViewPeer()->SetRowHeight(items
[itemIndex
],height
);
295 // ---------------------------------------------------------
296 // wxDataViewCustomRenderer
297 // The constructor, the implementation macro and environment
298 // dependent methods can be found in the environment's
300 // ---------------------------------------------------------
301 wxDataViewCustomRenderer::~wxDataViewCustomRenderer(void)
303 delete this->m_DCPtr
;
306 void wxDataViewCustomRenderer::RenderText( const wxString
&text
, int xoffset
, wxRect cell
, wxDC
*dc
, int state
)
308 wxDataViewCtrl
*view
= GetOwner()->GetOwner();
310 wxColour col
= (state
& wxDATAVIEW_CELL_SELECTED
) ? *wxWHITE
: view
->GetForegroundColour();
311 dc
->SetTextForeground(col
);
312 dc
->DrawText( text
, cell
.x
+ xoffset
, cell
.y
+ ((cell
.height
- dc
->GetCharHeight()) / 2));
315 wxDC
* wxDataViewCustomRenderer::GetDC()
317 if ((this->m_DCPtr
== NULL
) && (this->GetOwner() != NULL
) && (this->GetOwner()->GetOwner() != NULL
))
318 this->m_DCPtr
= new wxClientDC(this->GetOwner()->GetOwner());
319 return this->m_DCPtr
;
322 void wxDataViewCustomRenderer::SetDC(wxDC
* newDCPtr
)
328 // ---------------------------------------------------------
329 // wxDataViewTextRendererAttr
330 // ---------------------------------------------------------
331 wxDataViewTextRendererAttr::wxDataViewTextRendererAttr(wxString
const& varianttype
, wxDataViewCellMode mode
, int align
)
332 :wxDataViewTextRenderer(varianttype
,mode
,align
)
336 IMPLEMENT_CLASS(wxDataViewTextRendererAttr
,wxDataViewTextRenderer
)
338 //-----------------------------------------------------------------------------
340 //-----------------------------------------------------------------------------
342 wxDataViewCtrl::~wxDataViewCtrl()
344 this->ClearColumns();
347 void wxDataViewCtrl::Init()
349 m_CustomRendererPtr
= NULL
;
351 m_macIsUserPane
= false;
355 bool wxDataViewCtrl::Create(wxWindow
*parent
, wxWindowID id
, const wxPoint
& pos
, const wxSize
& size
, long style
, const wxValidator
& validator
)
357 if (!(this->wxControl::Create(parent
,id
,pos
,size
,style
& ~(wxHSCROLL
| wxVSCROLL
),validator
)))
359 m_peer
= ::CreateDataView(this,parent
,id
,pos
,size
,style
,this->GetExtraStyle());
361 this->MacPostControlCreate(pos
,size
);
366 bool wxDataViewCtrl::AssociateModel(wxDataViewModel
* model
)
368 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer());
371 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
,false,_("Pointer to native control must not be NULL."));
372 if (wxDataViewCtrlBase::AssociateModel(model
) && dataViewWidgetPtr
->AssociateModel(model
))
375 model
->AddNotifier(new wxOSXDataViewModelNotifier(this));
382 bool wxDataViewCtrl::AppendColumn(wxDataViewColumn
* columnPtr
)
384 return wxDataViewCtrl::InsertColumn( GetColumnCount(), columnPtr
);
387 bool wxDataViewCtrl::PrependColumn(wxDataViewColumn
* columnPtr
)
389 return wxDataViewCtrl::InsertColumn( 0, columnPtr
);
392 bool wxDataViewCtrl::InsertColumn(unsigned int pos
, wxDataViewColumn
* columnPtr
)
394 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer());
396 // first, some error checking:
397 wxCHECK_MSG(dataViewWidgetPtr
!= NULL
, false,_("Pointer to native control must not be NULL."));
398 wxCHECK_MSG(columnPtr
!= NULL
, false,_("Column pointer must not be NULL."));
399 wxCHECK_MSG(columnPtr
->GetRenderer() != NULL
, false,_("Column does not have a renderer."));
400 wxCHECK_MSG(this->GetModel() != NULL
, false,_("No model associated with control."));
401 wxCHECK_MSG((columnPtr
->GetModelColumn() >= 0) &&
402 (columnPtr
->GetModelColumn() < this->GetModel()->GetColumnCount()),false,_("Column's model column has no equivalent in the associated model."));
404 // add column to wxWidget's internal structure:
405 if (this->wxDataViewCtrlBase::InsertColumn(pos
,columnPtr
))
407 this->m_ColumnPtrs
.Add(columnPtr
);
408 // if the insertion in the native control is successful the rest can also be initialized:
409 if (dataViewWidgetPtr
->InsertColumn(pos
,columnPtr
))
411 // make sure that the data is up-to-date...
412 // if the newly appended column is the first column add the initial data to the control and mark the column as an expander column,
413 // otherwise ask the control to 'update' the data in the newly appended column:
414 if (this->GetColumnCount() == 1)
415 this->SetExpanderColumn(columnPtr
);
422 this->m_ColumnPtrs
.Remove(columnPtr
);
424 // and send a message in debug mode:
425 wxFAIL_MSG(_("Column could not be added to native control."));
434 wxFAIL_MSG(_("Could not add column to internal structures."));
440 bool wxDataViewCtrl::ClearColumns()
442 if (this->GetDataViewPeer()->ClearColumns())
444 WX_CLEAR_ARRAY(this->m_ColumnPtrs
);
451 bool wxDataViewCtrl::DeleteColumn(wxDataViewColumn
* columnPtr
)
453 if (this->GetDataViewPeer()->DeleteColumn(columnPtr
))
455 this->m_ColumnPtrs
.Remove(columnPtr
);
463 wxDataViewColumn
* wxDataViewCtrl::GetColumn(unsigned int pos
) const
465 return this->GetDataViewPeer()->GetColumn(pos
);
468 unsigned int wxDataViewCtrl::GetColumnCount() const
470 return this->m_ColumnPtrs
.GetCount();
473 int wxDataViewCtrl::GetColumnPosition(wxDataViewColumn
const* columnPtr
) const
475 return this->GetDataViewPeer()->GetColumnPosition(columnPtr
);
478 void wxDataViewCtrl::Collapse(wxDataViewItem
const& item
)
480 this->GetDataViewPeer()->Collapse(item
);
483 void wxDataViewCtrl::EnsureVisible(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
)
487 this->ExpandAncestors(item
); // make sure that the item exists in the control
488 this->GetDataViewPeer()->EnsureVisible(item
,columnPtr
);
492 void wxDataViewCtrl::Expand(wxDataViewItem
const& item
)
494 return this->GetDataViewPeer()->Expand(item
);
497 bool wxDataViewCtrl::IsExpanded( const wxDataViewItem
& item
) const
499 return (item
.IsOk() && this->GetDataViewPeer()->IsExpanded(item
));
502 wxDataViewColumn
* wxDataViewCtrl::GetSortingColumn() const
504 return this->GetDataViewPeer()->GetSortingColumn();
507 unsigned int wxDataViewCtrl::GetCount() const
509 return this->GetDataViewPeer()->GetCount();
512 wxRect
wxDataViewCtrl::GetItemRect(wxDataViewItem
const& item
, wxDataViewColumn
const* columnPtr
) const
514 if (item
.IsOk() && (columnPtr
!= NULL
))
515 return this->GetDataViewPeer()->GetRectangle(item
,columnPtr
);
520 wxDataViewItem
wxDataViewCtrl::GetSelection() const
522 wxDataViewItemArray itemIDs
;
525 if (this->GetDataViewPeer()->GetSelections(itemIDs
) > 0)
528 return wxDataViewItem();
531 int wxDataViewCtrl::GetSelections(wxDataViewItemArray
& sel
) const
533 return this->GetDataViewPeer()->GetSelections(sel
);
536 void wxDataViewCtrl::HitTest(wxPoint
const& point
, wxDataViewItem
& item
, wxDataViewColumn
*& columnPtr
) const
538 return this->GetDataViewPeer()->HitTest(point
,item
,columnPtr
);
541 bool wxDataViewCtrl::IsSelected(wxDataViewItem
const& item
) const
543 return this->GetDataViewPeer()->IsSelected(item
);
546 void wxDataViewCtrl::Select(wxDataViewItem
const& item
)
550 this->ExpandAncestors(item
); // make sure that the item exists in the control
551 this->GetDataViewPeer()->Select(item
);
555 void wxDataViewCtrl::SelectAll(void)
557 this->GetDataViewPeer()->SelectAll();
560 void wxDataViewCtrl::SetSelections(wxDataViewItemArray
const& sel
)
562 size_t const noOfSelections
= sel
.GetCount();
566 wxDataViewItem last_parent
;
569 // make sure that all to be selected items are visible in the control:
570 for (i
= 0; i
< noOfSelections
; i
++)
572 wxDataViewItem item
= sel
[i
];
573 wxDataViewItem parent
= this->GetModel()->GetParent( item
);
575 if (parent
.IsOk() && (parent
!= last_parent
))
576 this->ExpandAncestors(item
);
577 last_parent
= parent
;
580 // finally select the items:
581 wxDataViewWidgetImpl
* dataViewWidgetPtr(this->GetDataViewPeer()); // variable definition for abbreviational purposes
583 for (i
=0; i
<noOfSelections
; ++i
)
584 dataViewWidgetPtr
->Select(sel
[i
]);
587 void wxDataViewCtrl::Unselect(wxDataViewItem
const& item
)
590 this->GetDataViewPeer()->Unselect(item
);
593 void wxDataViewCtrl::UnselectAll(void)
595 this->GetDataViewPeer()->UnselectAll();
601 wxDataViewWidgetImpl
* wxDataViewCtrl::GetDataViewPeer(void) const
603 return dynamic_cast<wxDataViewWidgetImpl
*>(this->GetPeer());
606 void wxDataViewCtrl::AddChildren(wxDataViewItem
const& parentItem
)
610 wxDataViewItemArray items
;
613 wxCHECK_RET(this->GetModel() != NULL
,_("Model pointer not initialized."));
614 noOfChildren
= this->GetModel()->GetChildren(parentItem
,items
);
615 (void) this->GetModel()->ItemsAdded(parentItem
,items
);
618 void wxDataViewCtrl::FinishCustomItemEditing(void)
620 if (this->GetCustomRendererItem().IsOk())
622 this->GetCustomRendererPtr()->FinishEditing();
623 this->SetCustomRendererItem(wxDataViewItem());
624 this->SetCustomRendererPtr (NULL
);
630 wxDataViewCtrl::GetClassDefaultAttributes(wxWindowVariant
WXUNUSED(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))