For some reason, wxMac now requires explicit sizes in this sample
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56339 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -822,7 +822,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
// MyMusic
|
// MyMusic
|
||||||
|
|
||||||
m_musicCtrl = new wxDataViewCtrl( this, ID_MUSIC_CTRL, wxDefaultPosition,
|
m_musicCtrl = new wxDataViewCtrl( this, ID_MUSIC_CTRL, wxDefaultPosition,
|
||||||
wxDefaultSize, wxDV_MULTIPLE|wxDV_VARIABLE_LINE_HEIGHT );
|
wxSize(400,200), wxDV_MULTIPLE|wxDV_VARIABLE_LINE_HEIGHT );
|
||||||
|
|
||||||
m_music_model = new MyMusicModel;
|
m_music_model = new MyMusicModel;
|
||||||
m_musicCtrl->AssociateModel( m_music_model.get() );
|
m_musicCtrl->AssociateModel( m_music_model.get() );
|
||||||
@@ -838,10 +838,11 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
tr = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
|
tr = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_EDITABLE );
|
||||||
wxDataViewColumn *column1 = new wxDataViewColumn( wxT("artist"), tr, 1, 150, wxALIGN_RIGHT,
|
wxDataViewColumn *column1 = new wxDataViewColumn( wxT("artist"), tr, 1, 150, wxALIGN_LEFT,
|
||||||
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
|
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
|
||||||
m_musicCtrl->AppendColumn( column1 );
|
m_musicCtrl->AppendColumn( column1 );
|
||||||
|
|
||||||
|
#if 1
|
||||||
wxDataViewSpinRenderer *sr = new wxDataViewSpinRenderer( 0, 2010, wxDATAVIEW_CELL_EDITABLE, wxALIGN_RIGHT );
|
wxDataViewSpinRenderer *sr = new wxDataViewSpinRenderer( 0, 2010, wxDATAVIEW_CELL_EDITABLE, wxALIGN_RIGHT );
|
||||||
wxDataViewColumn *column2 = new wxDataViewColumn( wxT("year"), sr, 2, 80, wxALIGN_LEFT,
|
wxDataViewColumn *column2 = new wxDataViewColumn( wxT("year"), sr, 2, 80, wxALIGN_LEFT,
|
||||||
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
|
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
|
||||||
@@ -853,15 +854,14 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
wxDataViewColumn *column3 = new wxDataViewColumn( wxT("custom"), cr, 4, -1, wxALIGN_LEFT,
|
wxDataViewColumn *column3 = new wxDataViewColumn( wxT("custom"), cr, 4, -1, wxALIGN_LEFT,
|
||||||
wxDATAVIEW_COL_RESIZABLE );
|
wxDATAVIEW_COL_RESIZABLE );
|
||||||
m_musicCtrl->AppendColumn( column3 );
|
m_musicCtrl->AppendColumn( column3 );
|
||||||
|
#endif
|
||||||
|
|
||||||
data_sizer->Add( m_musicCtrl, 3, wxGROW );
|
data_sizer->Add( m_musicCtrl, 3, wxGROW );
|
||||||
|
|
||||||
#if 1
|
|
||||||
|
|
||||||
// MyList
|
// MyList
|
||||||
|
|
||||||
m_listCtrl = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition,
|
m_listCtrl = new wxDataViewCtrl( this, wxID_ANY, wxDefaultPosition,
|
||||||
wxDefaultSize, wxDV_MULTIPLE | wxDV_ROW_LINES);
|
wxSize(400,200), wxDV_MULTIPLE | wxDV_ROW_LINES);
|
||||||
|
|
||||||
m_list_model = new MyListModel;
|
m_list_model = new MyListModel;
|
||||||
m_listCtrl->AssociateModel( m_list_model.get() );
|
m_listCtrl->AssociateModel( m_list_model.get() );
|
||||||
@@ -880,8 +880,6 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
|
|
||||||
data_sizer->Add( m_listCtrl, 2, wxGROW );
|
data_sizer->Add( m_listCtrl, 2, wxGROW );
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
main_sizer->Add( data_sizer, 2, wxGROW );
|
main_sizer->Add( data_sizer, 2, wxGROW );
|
||||||
|
|
||||||
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
|
wxBoxSizer *button_sizer = new wxBoxSizer( wxHORIZONTAL );
|
||||||
@@ -908,6 +906,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
|
|
||||||
bottom_sizer->Add( m_log, 1, wxGROW );
|
bottom_sizer->Add( m_log, 1, wxGROW );
|
||||||
|
|
||||||
|
#if 1
|
||||||
// wxDataViewTreeStore
|
// wxDataViewTreeStore
|
||||||
|
|
||||||
wxDataViewCtrl *treectrl = new wxDataViewCtrl( this, -1,
|
wxDataViewCtrl *treectrl = new wxDataViewCtrl( this, -1,
|
||||||
@@ -940,6 +939,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
child = treectrl2->AppendItem( parent,wxT("Child 3, very long, long, long, long"), 0 );
|
child = treectrl2->AppendItem( parent,wxT("Child 3, very long, long, long, long"), 0 );
|
||||||
|
|
||||||
bottom_sizer->Add( treectrl2, 1 );
|
bottom_sizer->Add( treectrl2, 1 );
|
||||||
|
#endif
|
||||||
|
|
||||||
// main sizer
|
// main sizer
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user