From: Michael Bedward Date: Wed, 9 Feb 2000 03:49:52 +0000 (+0000) Subject: Added more 3d rendering to row and col labels and removed sunken border style from... X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b0d6ff2f7fb82e1ba838579ae0ddda70f5de0f8a 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 --- diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 5f052f0d81..a999ea3e08 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -854,7 +854,7 @@ wxGridWindow::wxGridWindow( wxGrid *parent, wxGridRowLabelWindow *rowLblWin, wxGridColLabelWindow *colLblWin, 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_rowLabelWin = rowLblWin; @@ -1124,8 +1124,8 @@ void wxGrid::CalcDimensions() if ( m_numRows > 0 && m_numCols > 0 ) { - int right = m_colRights[ m_numCols-1 ] + 20; - int bottom = m_rowBottoms[ m_numRows-1 ] + 20; + int right = m_colRights[ m_numCols-1 ] + 50; + int bottom = m_rowBottoms[ m_numRows-1 ] + 50; // 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; - // draw the label's horizontal border (the vertical border is - // provided by the cell area window margin) - // + int rowTop = m_rowBottoms[row] - m_rowHeights[row]; + dc.SetPen( *wxBLACK_PEN ); - - dc.DrawLine( 0, m_rowBottoms[row]+1, - m_rowLabelWidth, m_rowBottoms[row]+1 ); - + dc.DrawLine( m_rowLabelWidth-1, rowTop, + m_rowLabelWidth-1, m_rowBottoms[row]-1 ); + + dc.DrawLine( 0, m_rowBottoms[row]-1, + m_rowLabelWidth-1, m_rowBottoms[row]-1 ); + dc.SetPen( *wxWHITE_PEN ); - - dc.DrawLine( 0, m_rowBottoms[row]+2, - m_rowLabelWidth, m_rowBottoms[row]+2 ); + dc.DrawLine( 0, rowTop, 0, m_rowBottoms[row]-1 ); + dc.DrawLine( 0, rowTop, m_rowLabelWidth-1, rowTop ); dc.SetBackgroundMode( wxTRANSPARENT ); dc.SetTextForeground( GetLabelTextColour() ); @@ -2861,18 +2861,22 @@ void wxGrid::DrawColLabel( wxDC& dc, int col ) { if ( m_colWidths[col] <= 0 ) return; - // draw the label's vertical border (the horizontal border is - // provided by the cell area window margin) - // + int colLeft = m_colRights[col] - m_colWidths[col]; + dc.SetPen( *wxBLACK_PEN ); - - dc.DrawLine( m_colRights[col]+1, 0, - m_colRights[col]+1, m_colLabelHeight ); - + dc.DrawLine( m_colRights[col]-1, 0, + m_colRights[col]-1, m_colLabelHeight-1 ); + + dc.DrawLine( colLeft, m_colLabelHeight-1, + m_colRights[col]-1, m_colLabelHeight-1 ); + 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, - m_colRights[col]+2, m_colLabelHeight ); + dc.SetBackgroundMode( wxTRANSPARENT ); + dc.SetTextForeground( GetLabelTextColour() ); + dc.SetFont( GetLabelFont() ); dc.SetBackgroundMode( wxTRANSPARENT ); dc.SetTextForeground( GetLabelTextColour() );