Test header and renderer aligment separately
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53067 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -569,9 +569,7 @@ public:
|
|||||||
class MyCustomRenderer: public wxDataViewCustomRenderer
|
class MyCustomRenderer: public wxDataViewCustomRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyCustomRenderer( wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
|
MyCustomRenderer( wxDataViewCellMode mode, int alignment ) :
|
||||||
// MyCustomRenderer( wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
|
|
||||||
int alignment = wxDVR_DEFAULT_ALIGNMENT ) :
|
|
||||||
wxDataViewCustomRenderer( wxString("long"), mode, alignment ) { }
|
wxDataViewCustomRenderer( wxString("long"), mode, alignment ) { }
|
||||||
|
|
||||||
virtual bool Render( wxRect rect, wxDC *dc, int WXUNUSED(state) )
|
virtual bool Render( wxRect rect, wxDC *dc, int WXUNUSED(state) )
|
||||||
@@ -789,15 +787,14 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
m_music_model = new MyMusicModel;
|
m_music_model = new MyMusicModel;
|
||||||
m_musicCtrl->AssociateModel( m_music_model.get() );
|
m_musicCtrl->AssociateModel( m_music_model.get() );
|
||||||
|
|
||||||
|
wxDataViewTextRenderer *tr = new wxDataViewTextRenderer( wxT("string"), wxDATAVIEW_CELL_INERT, wxALIGN_RIGHT );
|
||||||
|
wxDataViewColumn *column0 = new wxDataViewColumn( wxT("title"), tr, 0, 200, wxALIGN_CENTRE,
|
||||||
|
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE );
|
||||||
|
m_musicCtrl->AppendColumn( column0 );
|
||||||
#if 0
|
#if 0
|
||||||
// Call this and sorting is enabled
|
// Call this and sorting is enabled
|
||||||
// immediatly upon start up.
|
// immediatly upon start up.
|
||||||
wxDataViewColumn *col = m_musicCtrl->AppendTextColumn( wxT("Title"), 0, wxDATAVIEW_CELL_INERT, 200, DEFAULT_ALIGN,
|
column0->SetSortOrder( true );
|
||||||
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE);
|
|
||||||
col->SetSortOrder( true );
|
|
||||||
#else
|
|
||||||
m_musicCtrl->AppendTextColumn( wxT("Title"), 0, wxDATAVIEW_CELL_INERT, 200, wxALIGN_RIGHT,
|
|
||||||
wxDATAVIEW_COL_SORTABLE | wxDATAVIEW_COL_REORDERABLE | wxDATAVIEW_COL_RESIZABLE);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
m_musicCtrl->AppendTextColumn( wxT("Artist"), 1, wxDATAVIEW_CELL_EDITABLE, 150, wxALIGN_RIGHT,
|
m_musicCtrl->AppendTextColumn( wxT("Artist"), 1, wxDATAVIEW_CELL_EDITABLE, 150, wxALIGN_RIGHT,
|
||||||
@@ -808,8 +805,8 @@ MyFrame::MyFrame(wxFrame *frame, const wxString &title, int x, int y, int w, int
|
|||||||
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 );
|
||||||
|
|
||||||
MyCustomRenderer *cr = new MyCustomRenderer;
|
MyCustomRenderer *cr = new MyCustomRenderer( wxDATAVIEW_CELL_ACTIVATABLE, wxALIGN_RIGHT );
|
||||||
wxDataViewColumn *column2 = new wxDataViewColumn( wxT("custom"), cr, 2, -1, wxALIGN_RIGHT,
|
wxDataViewColumn *column2 = new wxDataViewColumn( wxT("custom"), cr, 2, -1, wxALIGN_LEFT,
|
||||||
wxDATAVIEW_COL_RESIZABLE );
|
wxDATAVIEW_COL_RESIZABLE );
|
||||||
m_musicCtrl->AppendColumn( column2 );
|
m_musicCtrl->AppendColumn( column2 );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user