More alignment issues
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49194 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -459,11 +459,11 @@ public:
|
|||||||
// short cuts
|
// short cuts
|
||||||
wxDataViewColumn *AppendTextColumn( const wxString &label, unsigned int model_column,
|
wxDataViewColumn *AppendTextColumn( const wxString &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendIconTextColumn( const wxString &label, unsigned int model_column,
|
wxDataViewColumn *AppendIconTextColumn( const wxString &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendToggleColumn( const wxString &label, unsigned int model_column,
|
wxDataViewColumn *AppendToggleColumn( const wxString &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
|
||||||
@@ -475,7 +475,7 @@ public:
|
|||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendDateColumn( const wxString &label, unsigned int model_column,
|
wxDataViewColumn *AppendDateColumn( const wxString &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendBitmapColumn( const wxString &label, unsigned int model_column,
|
wxDataViewColumn *AppendBitmapColumn( const wxString &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
||||||
@@ -483,11 +483,11 @@ public:
|
|||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendTextColumn( const wxBitmap &label, unsigned int model_column,
|
wxDataViewColumn *AppendTextColumn( const wxBitmap &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendIconTextColumn( const wxBitmap &label, unsigned int model_column,
|
wxDataViewColumn *AppendIconTextColumn( const wxBitmap &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendToggleColumn( const wxBitmap &label, unsigned int model_column,
|
wxDataViewColumn *AppendToggleColumn( const wxBitmap &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
|
||||||
@@ -499,7 +499,7 @@ public:
|
|||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
wxDataViewColumn *AppendDateColumn( const wxBitmap &label, unsigned int model_column,
|
wxDataViewColumn *AppendDateColumn( const wxBitmap &label, unsigned int model_column,
|
||||||
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
|
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
|
||||||
wxAlignment align = wxALIGN_LEFT,
|
wxAlignment align = (wxAlignment)(wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL),
|
||||||
int flags = wxDATAVIEW_COL_RESIZABLE );
|
int flags = wxDATAVIEW_COL_RESIZABLE );
|
||||||
|
|
||||||
wxDataViewColumn *AppendBitmapColumn( const wxBitmap &label, unsigned int model_column,
|
wxDataViewColumn *AppendBitmapColumn( const wxBitmap &label, unsigned int model_column,
|
||||||
|
@@ -56,9 +56,6 @@ static const int SCROLL_UNIT_X = 15;
|
|||||||
// the cell padding on the left/right
|
// the cell padding on the left/right
|
||||||
static const int PADDING_RIGHTLEFT = 3;
|
static const int PADDING_RIGHTLEFT = 3;
|
||||||
|
|
||||||
// the cell padding on the top/bottom
|
|
||||||
static const int PADDING_TOPBOTTOM = 1;
|
|
||||||
|
|
||||||
// the expander space margin
|
// the expander space margin
|
||||||
static const int EXPANDER_MARGIN = 4;
|
static const int EXPANDER_MARGIN = 4;
|
||||||
|
|
||||||
@@ -1908,7 +1905,6 @@ wxDataViewMainWindow::wxDataViewMainWindow( wxDataViewCtrl *parent, wxWindowID i
|
|||||||
#else
|
#else
|
||||||
20;
|
20;
|
||||||
#endif
|
#endif
|
||||||
wxASSERT(m_lineHeight > 2*PADDING_TOPBOTTOM);
|
|
||||||
|
|
||||||
m_dragCount = 0;
|
m_dragCount = 0;
|
||||||
m_dragStart = wxPoint(0,0);
|
m_dragStart = wxPoint(0,0);
|
||||||
@@ -2460,7 +2456,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
wxSize size = cell->GetSize();
|
wxSize size = cell->GetSize();
|
||||||
// Because of the tree structure indent, here we should minus the width of the cell for drawing
|
// Because of the tree structure indent, here we should minus the width of the cell for drawing
|
||||||
size.x = wxMin( size.x + 2*PADDING_RIGHTLEFT, cell_rect.width - indent );
|
size.x = wxMin( size.x + 2*PADDING_RIGHTLEFT, cell_rect.width - indent );
|
||||||
size.y = wxMin( size.y + 1*PADDING_TOPBOTTOM, cell_rect.height );
|
size.y = wxMin( size.y, cell_rect.height );
|
||||||
|
|
||||||
wxRect item_rect(cell_rect.GetTopLeft(), size);
|
wxRect item_rect(cell_rect.GetTopLeft(), size);
|
||||||
int align = cell->GetAlignment();
|
int align = cell->GetAlignment();
|
||||||
@@ -2483,9 +2479,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
|
|||||||
|
|
||||||
// add padding
|
// add padding
|
||||||
item_rect.x += PADDING_RIGHTLEFT;
|
item_rect.x += PADDING_RIGHTLEFT;
|
||||||
//item_rect.y += PADDING_TOPBOTTOM;
|
|
||||||
item_rect.width = size.x - 2 * PADDING_RIGHTLEFT;
|
item_rect.width = size.x - 2 * PADDING_RIGHTLEFT;
|
||||||
item_rect.height = size.y - 1 * PADDING_TOPBOTTOM;
|
|
||||||
|
|
||||||
//Here we add the tree indent
|
//Here we add the tree indent
|
||||||
item_rect.x += indent;
|
item_rect.x += indent;
|
||||||
|
Reference in New Issue
Block a user