// wxDataViewModel
// ---------------------------------------------------------
-#include <wx/listimpl.cpp>
+#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxDataViewModelNotifiers);
wxDataViewModel::wxDataViewModel()
// items must be different
unsigned long litem1 = (unsigned long) item1.GetID();
unsigned long litem2 = (unsigned long) item2.GetID();
-
+
if (!ascending)
return litem2-litem2;
return wxDataViewItem( m_hash[row] );
}
-int wxDataViewIndexListModel::Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
- unsigned int column, bool ascending )
+int wxDataViewIndexListModel::Compare(const wxDataViewItem& item1,
+ const wxDataViewItem& item2,
+ unsigned int WXUNUSED(column),
+ bool ascending)
{
if (ascending)
return GetRow(item1) - GetRow(item2);
-
+
return GetRow(item2) - GetRow(item1);
}
return false;
}
-wxDataViewItem wxDataViewIndexListModel::GetFirstChild( const wxDataViewItem &parent ) const
-{
- if (!parent.IsOk())
- {
- if (m_hash.GetCount() == 0)
- return wxDataViewItem(0);
-
- return wxDataViewItem( m_hash[0]);
- }
-
- return wxDataViewItem(0);
-}
-
-wxDataViewItem wxDataViewIndexListModel::GetNextSibling( const wxDataViewItem &item ) const
+unsigned int wxDataViewIndexListModel::GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const
{
- if (!item.IsOk())
- return wxDataViewItem(0);
+ if (item.IsOk())
+ return 0;
- int pos = m_hash.Index( item.GetID() );
- if ((pos == wxNOT_FOUND) || (pos == (int) (m_hash.GetCount()-1)))
- return wxDataViewItem(0);
+ children = m_hash;
- return wxDataViewItem( m_hash[pos+1] );
+ return m_hash.GetCount();
}
//-----------------------------------------------------------------------------
GetOwner()->GetOwner()->GetModel()->ValueChanged( m_item, col );
// m_editorCtrl->PopEventHandler( true );
-
+
// Now we should send Editing Done event
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, GetOwner()->GetOwner()->GetId() );
event.SetDataViewColumn( GetOwner() );
wxDataViewCtrlBase::AppendToggleColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
-
+
wxDataViewColumn *ret = new wxDataViewColumn( label,
new wxDataViewToggleRenderer( wxT("bool"), mode, (int)align ),
model_column, width, align, flags );
IMPLEMENT_DYNAMIC_CLASS(wxDataViewEvent,wxNotifyEvent)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_SELECTED)
-DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_DESELECTED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED)
+
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED)