Added more 3d rendering to row and col labels and removed sunken border style from the grid cell window so that labels and cells line up better.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -854,7 +854,7 @@ wxGridWindow::wxGridWindow( wxGrid *parent,
|
|||||||
wxGridRowLabelWindow *rowLblWin,
|
wxGridRowLabelWindow *rowLblWin,
|
||||||
wxGridColLabelWindow *colLblWin,
|
wxGridColLabelWindow *colLblWin,
|
||||||
wxWindowID id, const wxPoint &pos, const wxSize &size )
|
wxWindowID id, const wxPoint &pos, const wxSize &size )
|
||||||
: wxPanel( parent, id, pos, size, wxSUNKEN_BORDER, "grid window" )
|
: wxPanel( parent, id, pos, size, 0, "grid window" )
|
||||||
{
|
{
|
||||||
m_owner = parent;
|
m_owner = parent;
|
||||||
m_rowLabelWin = rowLblWin;
|
m_rowLabelWin = rowLblWin;
|
||||||
@@ -1124,8 +1124,8 @@ void wxGrid::CalcDimensions()
|
|||||||
|
|
||||||
if ( m_numRows > 0 && m_numCols > 0 )
|
if ( m_numRows > 0 && m_numCols > 0 )
|
||||||
{
|
{
|
||||||
int right = m_colRights[ m_numCols-1 ] + 20;
|
int right = m_colRights[ m_numCols-1 ] + 50;
|
||||||
int bottom = m_rowBottoms[ m_numRows-1 ] + 20;
|
int bottom = m_rowBottoms[ m_numRows-1 ] + 50;
|
||||||
|
|
||||||
// TODO: restore the scroll position that we had before sizing
|
// TODO: restore the scroll position that we had before sizing
|
||||||
//
|
//
|
||||||
@@ -2814,18 +2814,18 @@ void wxGrid::DrawRowLabel( wxDC& dc, int row )
|
|||||||
{
|
{
|
||||||
if ( m_rowHeights[row] <= 0 ) return;
|
if ( m_rowHeights[row] <= 0 ) return;
|
||||||
|
|
||||||
// draw the label's horizontal border (the vertical border is
|
int rowTop = m_rowBottoms[row] - m_rowHeights[row];
|
||||||
// provided by the cell area window margin)
|
|
||||||
//
|
|
||||||
dc.SetPen( *wxBLACK_PEN );
|
dc.SetPen( *wxBLACK_PEN );
|
||||||
|
dc.DrawLine( m_rowLabelWidth-1, rowTop,
|
||||||
dc.DrawLine( 0, m_rowBottoms[row]+1,
|
m_rowLabelWidth-1, m_rowBottoms[row]-1 );
|
||||||
m_rowLabelWidth, m_rowBottoms[row]+1 );
|
|
||||||
|
dc.DrawLine( 0, m_rowBottoms[row]-1,
|
||||||
|
m_rowLabelWidth-1, m_rowBottoms[row]-1 );
|
||||||
|
|
||||||
dc.SetPen( *wxWHITE_PEN );
|
dc.SetPen( *wxWHITE_PEN );
|
||||||
|
dc.DrawLine( 0, rowTop, 0, m_rowBottoms[row]-1 );
|
||||||
dc.DrawLine( 0, m_rowBottoms[row]+2,
|
dc.DrawLine( 0, rowTop, m_rowLabelWidth-1, rowTop );
|
||||||
m_rowLabelWidth, m_rowBottoms[row]+2 );
|
|
||||||
|
|
||||||
dc.SetBackgroundMode( wxTRANSPARENT );
|
dc.SetBackgroundMode( wxTRANSPARENT );
|
||||||
dc.SetTextForeground( GetLabelTextColour() );
|
dc.SetTextForeground( GetLabelTextColour() );
|
||||||
@@ -2861,18 +2861,22 @@ void wxGrid::DrawColLabel( wxDC& dc, int col )
|
|||||||
{
|
{
|
||||||
if ( m_colWidths[col] <= 0 ) return;
|
if ( m_colWidths[col] <= 0 ) return;
|
||||||
|
|
||||||
// draw the label's vertical border (the horizontal border is
|
int colLeft = m_colRights[col] - m_colWidths[col];
|
||||||
// provided by the cell area window margin)
|
|
||||||
//
|
|
||||||
dc.SetPen( *wxBLACK_PEN );
|
dc.SetPen( *wxBLACK_PEN );
|
||||||
|
dc.DrawLine( m_colRights[col]-1, 0,
|
||||||
dc.DrawLine( m_colRights[col]+1, 0,
|
m_colRights[col]-1, m_colLabelHeight-1 );
|
||||||
m_colRights[col]+1, m_colLabelHeight );
|
|
||||||
|
dc.DrawLine( colLeft, m_colLabelHeight-1,
|
||||||
|
m_colRights[col]-1, m_colLabelHeight-1 );
|
||||||
|
|
||||||
dc.SetPen( *wxWHITE_PEN );
|
dc.SetPen( *wxWHITE_PEN );
|
||||||
|
dc.DrawLine( colLeft, 0, colLeft, m_colLabelHeight-1 );
|
||||||
|
dc.DrawLine( colLeft, 0, m_colRights[col]-1, 0 );
|
||||||
|
|
||||||
dc.DrawLine( m_colRights[col]+2, 0,
|
dc.SetBackgroundMode( wxTRANSPARENT );
|
||||||
m_colRights[col]+2, m_colLabelHeight );
|
dc.SetTextForeground( GetLabelTextColour() );
|
||||||
|
dc.SetFont( GetLabelFont() );
|
||||||
|
|
||||||
dc.SetBackgroundMode( wxTRANSPARENT );
|
dc.SetBackgroundMode( wxTRANSPARENT );
|
||||||
dc.SetTextForeground( GetLabelTextColour() );
|
dc.SetTextForeground( GetLabelTextColour() );
|
||||||
|
Reference in New Issue
Block a user