X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/615b7e6ab086c41946145d3f98af4e2bf9a284f9..05a98b6d5d201eb8edea04b1ab022e4a9a46e9f0:/src/generic/grid.cpp diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 28923facce..bf62e90e3e 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -18,6 +18,8 @@ #if wxUSE_GRID +#include "wx/grid.h" + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dcclient.h" @@ -37,9 +39,10 @@ #include "wx/tokenzr.h" #include "wx/renderer.h" -#include "wx/grid.h" #include "wx/generic/gridsel.h" +const wxChar wxGridNameStr[] = wxT("grid"); + #if defined(__WXMOTIF__) #define WXUNUSED_MOTIF(identifier) WXUNUSED(identifier) #else @@ -2289,6 +2292,7 @@ wxGridCellAttr *wxGridCellAttr::Clone() const if ( IsReadOnly() ) attr->SetReadOnly(); + attr->SetOverflow( m_overflow == Overflow ); attr->SetKind( m_attrkind ); return attr; @@ -7519,12 +7523,6 @@ void wxGrid::DrawCellHighlight( wxDC& dc, const wxGridCellAttr *attr ) rect.width -= penWidth - 1; rect.height -= penWidth - 1; -#ifdef __WXGTK__ - // FIXME: why is the rect drawn off-by-one? - if ((penWidth == 2) && (GetLayoutDirection() == wxLayout_RightToLeft)) - rect.x -= 1; -#endif - // Now draw the rectangle // use the cellHighlightColour if the cell is inside a selection, this // will ensure the cell is always visible. @@ -7758,7 +7756,12 @@ void wxGrid::DrawAllGridLines( wxDC& dc, const wxRegion & WXUNUSED(reg) ) { i = GetColAt( colPos ); - int colRight = GetColRight(i) - 1; + int colRight = GetColRight(i); +#ifdef __WXGTK__ + if (GetLayoutDirection() != wxLayout_RightToLeft) +#endif + colRight--; + if ( colRight > right ) { break; @@ -10385,12 +10388,12 @@ void wxGrid::AutoSizeColOrRow( int colOrRow, bool setAsMin, bool column ) if ( column ) { - dc.GetTextExtent( GetColLabelValue(col), &w, &h ); + dc.GetMultiLineTextExtent( GetColLabelValue(col), &w, &h ); if ( GetColLabelTextOrientation() == wxVERTICAL ) w = h; } else - dc.GetTextExtent( GetRowLabelValue(row), &w, &h ); + dc.GetMultiLineTextExtent( GetRowLabelValue(row), &w, &h ); extent = column ? w : h; if ( extent > extentMax )