Added wxDataViewListCtrl, use it in the sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58136 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1458,6 +1458,94 @@ bool wxDataViewListStore::SetValueByRow( const wxVariant &value, unsigned int ro
|
||||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDataViewListCtrl
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxDataViewListCtrl,wxDataViewCtrl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxDataViewListCtrl,wxDataViewCtrl)
|
||||
EVT_SIZE( wxDataViewListCtrl::OnSize )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
wxDataViewListCtrl::wxDataViewListCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
wxDataViewListCtrl::wxDataViewListCtrl( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style,
|
||||
const wxValidator& validator )
|
||||
{
|
||||
Create( parent, id, pos, size, style, validator );
|
||||
|
||||
wxDataViewListStore *store = new wxDataViewListStore;
|
||||
AssociateModel( store );
|
||||
store->DecRef();
|
||||
}
|
||||
|
||||
wxDataViewListCtrl::~wxDataViewListCtrl()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool wxDataViewListCtrl::Create( wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size, long style,
|
||||
const wxValidator& validator )
|
||||
{
|
||||
return wxDataViewCtrl::Create( parent, id, pos, size, style, validator );
|
||||
}
|
||||
|
||||
void wxDataViewListCtrl::AppendCol( wxDataViewColumn *column, const wxString &varianttype )
|
||||
{
|
||||
GetStore()->AppendColumn( varianttype );
|
||||
AppendColumn( column );
|
||||
}
|
||||
|
||||
void wxDataViewListCtrl::PrependCol( wxDataViewColumn *column, const wxString &varianttype )
|
||||
{
|
||||
GetStore()->PrependColumn( varianttype );
|
||||
PrependColumn( column );
|
||||
}
|
||||
|
||||
void wxDataViewListCtrl::InsertCol( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype )
|
||||
{
|
||||
GetStore()->InsertColumn( pos, varianttype );
|
||||
InsertColumn( pos, column );
|
||||
}
|
||||
|
||||
wxDataViewColumn *wxDataViewListCtrl::AppendTextCol( const wxString &label,
|
||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||
{
|
||||
GetStore()->AppendColumn( wxT("string") );
|
||||
return AppendTextColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
|
||||
}
|
||||
|
||||
wxDataViewColumn *wxDataViewListCtrl::AppendToggleCol( const wxString &label,
|
||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||
{
|
||||
GetStore()->AppendColumn( wxT("bool") );
|
||||
return AppendToggleColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
|
||||
}
|
||||
|
||||
wxDataViewColumn *wxDataViewListCtrl::AppendProgressCol( const wxString &label,
|
||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||
{
|
||||
GetStore()->AppendColumn( wxT("long") );
|
||||
return AppendProgressColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
|
||||
}
|
||||
|
||||
wxDataViewColumn *wxDataViewListCtrl::AppendIconTextCol( const wxString &label,
|
||||
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
|
||||
{
|
||||
GetStore()->AppendColumn( wxT("wxDataViewIconText") );
|
||||
return AppendIconTextColumn( label, GetStore()->GetColumnCount()-1, mode, width, align, flags );
|
||||
}
|
||||
|
||||
void wxDataViewListCtrl::OnSize( wxSizeEvent &event )
|
||||
{
|
||||
event.Skip( true );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// wxDataViewTreeStore
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user