#endif
#ifndef WX_PRECOMP
-#include "wx/wx.h"
+ #include "wx/wx.h"
#endif
#include "wx/datetime.h"
#ifndef __WXMSW__
-#include "mondrian.xpm"
+ #include "../sample.xpm"
#endif
#include "wx/dataview.h"
MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
-#ifdef __WXMSW__
- SetIcon(wxIcon(_T("mondrian")));
-#else
- SetIcon(wxIcon(mondrian_xpm));
-#endif
+ SetIcon(wxICON(sample));
wxMenu *file_menu = new wxMenu;
CreateStatusBar();
+ wxPanel *panel = new wxPanel( this, wxID_ANY );
+
// Left wxDataViewCtrl
- dataview_left = new wxDataViewCtrl( this, wxID_ANY );
+ dataview_left = new wxDataViewCtrl( panel, wxID_ANY );
MyTextModel *model = new MyTextModel;
dataview_left->AssociateModel( model );
dataview_left->AppendDateColumn( wxT("date"), 6 );
// Right wxDataViewCtrl using the same model
- dataview_right = new wxDataViewCtrl( this, wxID_ANY );
+ dataview_right = new wxDataViewCtrl( panel, wxID_ANY );
dataview_right->AssociateModel( model );
text_cell = new wxDataViewTextCell( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
sizer->Add( dataview_left, 3, wxGROW );
sizer->Add(10,10);
sizer->Add( dataview_right, 2, wxGROW );
- SetSizer( sizer );
+ panel->SetSizer( sizer );
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event) )
MySortingFrame::MySortingFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h))
{
-#ifdef __WXMSW__
- SetIcon(wxIcon(_T("mondrian")));
-#else
- SetIcon(wxIcon(mondrian_xpm));
-#endif
+ SetIcon(wxICON(sample));
wxMenu *file_menu = new wxMenu;
// Left wxDataViewCtrl
- dataview_left = new wxDataViewCtrl( this, wxID_ANY );
+ dataview_left = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDV_MULTIPLE );
MyUnsortedTextModel *model = new MyUnsortedTextModel;
dataview_left->AssociateModel( model );