X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2049ba38adafa0ec146880de29f26e32dd69a125..314055fa8d202ca0628a197877bfa299d3e7540d:/src/generic/gridg.cpp diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index 9c3ff80d3a..9081e3b5ba 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -62,7 +62,8 @@ wxGenericGrid::wxGenericGrid(void) m_cellTextColour = *wxBLACK; m_cellBackgroundColour = *wxWHITE; m_labelTextColour = *wxBLACK; - m_labelBackgroundColour = *wxLIGHT_GREY; +// m_labelBackgroundColour = *wxLIGHT_GREY; + m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); m_labelBackgroundBrush = NULL; m_labelTextFont = NULL; m_cellTextFont = NULL; @@ -121,7 +122,8 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, m_cellTextColour = *wxBLACK; m_cellBackgroundColour = *wxWHITE; m_labelTextColour = *wxBLACK; - m_labelBackgroundColour = *wxLIGHT_GREY; +// m_labelBackgroundColour = *wxLIGHT_GREY; + m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); m_labelBackgroundBrush = NULL; m_labelTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD); m_cellTextFont = wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL); @@ -304,17 +306,25 @@ bool wxGenericGrid::CreateGrid(int nRows, int nCols, wxString **cellValues, shor int objectSizeX = m_totalCols; int pageSizeX = 1; int viewLengthX = m_totalCols; + +/* m_hScrollBar->SetViewLength(viewLengthX); m_hScrollBar->SetObjectLength(objectSizeX); m_hScrollBar->SetPageSize(pageSizeX); +*/ + m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), pageSizeX, objectSizeX, viewLengthX); int objectSizeY = m_totalRows; int pageSizeY = 1; int viewLengthY = m_totalRows; +/* m_vScrollBar->SetViewLength(viewLengthY); m_vScrollBar->SetObjectLength(objectSizeY); m_vScrollBar->SetPageSize(pageSizeY); +*/ + + m_vScrollBar->SetScrollbar(m_vScrollBar->GetPosition(), pageSizeY, objectSizeY, viewLengthY); AdjustScrollbars(); @@ -405,7 +415,6 @@ void wxGenericGrid::SetGridClippingRegion(wxDC *dc) void wxGenericGrid::OnPaint(wxPaintEvent& WXUNUSED(event)) { - wxRectangle rect; int w, h; GetClientSize(&w, &h); @@ -486,7 +495,7 @@ void wxGenericGrid::PaintGrid(wxDC& dc) // Erase (some of) the background. // Currently, a Windows-only optimisation. -void wxGenericGrid::OnEraseBackground(wxEraseEvent& event) +void wxGenericGrid::OnEraseBackground(wxEraseEvent& WXUNUSED(event) ) { wxClientDC dc(this); dc.BeginDrawing(); @@ -840,11 +849,17 @@ void wxGenericGrid::DrawCellBackground(wxDC *dc, wxRectangle *rect, int row, int { dc->SetBrush(*cell->GetBackgroundBrush()); dc->SetPen(*wxTRANSPARENT_PEN); + +#if 0 // In wxWin 2.0 the dc code is exact. RR. #ifdef __WXMOTIF__ dc->DrawRectangle(rect->x+1, rect->y+1, rect->width-1, rect->height-1); #else dc->DrawRectangle(rect->x+1, rect->y+1, rect->width, rect->height); #endif +#endif + + dc->DrawRectangle(rect->x+1, rect->y+1, rect->width-1, rect->height-1); + dc->SetPen(*wxBLACK_PEN); } } @@ -1009,7 +1024,7 @@ void wxGenericGrid::AdjustScrollbars(void) */ m_hScrollBar->SetScrollbar(m_hScrollBar->GetPosition(), wxMax(noHorizSteps, 1), nCols, wxMax(noHorizSteps, 1)); - m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth, + m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth -2, cw - vertScrollBarWidth - m_leftOfSheet, m_scrollWidth); } @@ -1371,8 +1386,9 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) // Why isn't this needed for Windows?? // Probably because of the SetValue?? + // Arrrrrgh. This isn't needed anywhere, of course. RR. #ifndef __WXMSW__ - HighlightCell(dc); +// HighlightCell(dc); #endif dc->DestroyClippingRegion(); @@ -1428,16 +1444,27 @@ void wxGenericGrid::OnChangeSelectionLabel(void) void wxGenericGrid::HighlightCell(wxDC *dc) { dc->SetLogicalFunction(wxINVERT); + // Top - dc->DrawLine(m_currentRect.x + 1, m_currentRect.y + 1, m_currentRect.x + m_currentRect.width - 1, m_currentRect.y + 1); + dc->DrawLine( m_currentRect.x + 1, + m_currentRect.y + 1, + m_currentRect.x + m_currentRect.width - 1, + m_currentRect.y + 1); // Right - dc->DrawLine(m_currentRect.x + m_currentRect.width - 1, m_currentRect.y + 1, - m_currentRect.x + m_currentRect.width - 1, m_currentRect.y +m_currentRect.height - 1); + dc->DrawLine( m_currentRect.x + m_currentRect.width - 1, + m_currentRect.y + 1, + m_currentRect.x + m_currentRect.width - 1, + m_currentRect.y +m_currentRect.height - 1 ); // Bottom - dc->DrawLine(m_currentRect.x + m_currentRect.width - 1, m_currentRect.y + m_currentRect.height - 1, - m_currentRect.x + 1, m_currentRect.y + m_currentRect.height - 1); + dc->DrawLine( m_currentRect.x + m_currentRect.width - 1, + m_currentRect.y + m_currentRect.height - 1, + m_currentRect.x + 1, + m_currentRect.y + m_currentRect.height - 1); // Left - dc->DrawLine(m_currentRect.x + 1, m_currentRect.y + m_currentRect.height - 1, m_currentRect.x + 1, m_currentRect.y + 1); + dc->DrawLine( m_currentRect.x + 1, + m_currentRect.y + m_currentRect.height - 1, + m_currentRect.x + 1, + m_currentRect.y + 1); dc->SetLogicalFunction(wxCOPY); }