X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0ed460c2e7802793d591c84f3cfdbff159c5549..f861258fcace51a1aaba2f31c7498b3ba9e31371:/src/generic/gridg.cpp diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index 6184648dc6..bfd5c3928b 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -88,6 +88,8 @@ wxGenericGrid::wxGenericGrid(void) m_editable = TRUE; #if defined(__WIN95__) m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); +#elif defined(__WXGTK__) + m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); #else m_scrollWidth = 16; #endif @@ -144,6 +146,8 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, m_editable = TRUE; #if defined(__WIN95__) m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); +#elif defined(__WXGTK__) + m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); #else m_scrollWidth = 16; #endif @@ -218,6 +222,8 @@ bool wxGenericGrid::Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, m_hScrollBar = new wxScrollBar(this, wxGRID_HSCROLL, wxPoint(0, 0), wxSize(20, 100), wxHORIZONTAL); m_vScrollBar = new wxScrollBar(this, wxGRID_VSCROLL, wxPoint(0, 0), wxSize(100, 20), wxVERTICAL); +// SetSize(pos.x, pos.y, size.x, size.y); + return TRUE; } @@ -1020,16 +1026,21 @@ void wxGenericGrid::AdjustScrollbars(void) if (m_hScrollBar && !m_hScrollBar->IsShown()) horizScrollBarHeight = 0; - if (m_hScrollBar) + if (m_hScrollBar && m_hScrollBar->IsShown()) { int nCols = GetCols(); m_hScrollBar->SetScrollbar(m_hScrollBar->GetThumbPosition(), wxMax(noHorizSteps, 1), (noHorizSteps == 0) ? 1 : nCols, wxMax(noHorizSteps, 1)); - m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth -2, +/* + m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth -2, // why -2 ? Robert. + cw - vertScrollBarWidth - m_leftOfSheet, m_scrollWidth); +*/ + m_hScrollBar->SetSize(m_leftOfSheet, ch - m_scrollWidth, cw - vertScrollBarWidth - m_leftOfSheet, m_scrollWidth); + } - if (m_vScrollBar) + if (m_vScrollBar && m_vScrollBar->IsShown()) { int nRows = GetRows(); @@ -1053,7 +1064,7 @@ void wxGenericGrid::OnSize(wxSizeEvent& WXUNUSED(event) ) { m_editingPanel->SetSize(0, 0, cw, m_editControlPosition.height + m_editControlPosition.y + 2); GetTextItem()->SetSize(m_editControlPosition.x, m_editControlPosition.y, - cw - m_editControlPosition.x, m_editControlPosition.height); + cw - 2*m_editControlPosition.x, m_editControlPosition.height); } } @@ -1406,9 +1417,11 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) // Probably because of the SetValue?? JS. // 2) Arrrrrgh. This isn't needed anywhere, // of course. One hour of debugging... RR. -#ifndef __WXMSW__ -// HighlightCell(dc); + // Put back for Motif only on advice of Michael Bedward +#ifdef __WXMOTIF__ + HighlightCell(dc); #endif + dc->DestroyClippingRegion(); //OnSelectCell(row, col); @@ -1499,7 +1512,7 @@ void wxGenericGrid::DrawCellText(void) if (!cell) return; - static char szEdit[300]; + static wxChar szEdit[300]; wxClientDC dc(this); dc.BeginDrawing(); @@ -1509,7 +1522,7 @@ void wxGenericGrid::DrawCellText(void) dc.SetBackgroundMode(wxTRANSPARENT); dc.SetBrush(cell->GetBackgroundBrush()); - strcpy(szEdit, m_textItem->GetValue()); + wxStrcpy(szEdit, m_textItem->GetValue()); wxRect rect; rect = m_currentRect; @@ -1518,7 +1531,7 @@ void wxGenericGrid::DrawCellText(void) rect.width -= 5; rect.height -= 4; - DrawTextRect(& dc, " ", &rect, wxLEFT); + DrawTextRect(& dc, _T(" "), &rect, wxLEFT); DrawTextRect(& dc, szEdit, &rect, cell->GetAlignment()); dc.DestroyClippingRegion();