X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/48c12cb1290224f44161d9af774170d5f0fae440..61ecf6d34ffb087e4a02d1c4e29e1f155875eba0:/src/generic/gridg.cpp diff --git a/src/generic/gridg.cpp b/src/generic/gridg.cpp index cb590108cb..a4d53fc435 100644 --- a/src/generic/gridg.cpp +++ b/src/generic/gridg.cpp @@ -25,6 +25,8 @@ #pragma hdrstop #endif +#if wxUSE_GRID && !(wxUSE_NEW_GRID) + #ifndef WX_PRECOMP #include "wx/utils.h" #include "wx/dcclient.h" @@ -123,7 +125,7 @@ wxGenericGrid::wxGenericGrid() m_cellBackgroundColour = *wxWHITE; m_labelTextColour = *wxBLACK; // m_labelBackgroundColour = *wxLIGHT_GREY; - m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); + m_labelBackgroundColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); m_labelBackgroundBrush = wxNullBrush; m_labelTextFont = wxNullFont; m_cellTextFont = wxNullFont; @@ -136,9 +138,9 @@ wxGenericGrid::wxGenericGrid() m_inScroll = FALSE; #if defined(__WIN95__) - m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); + m_scrollWidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); #elif defined(__WXGTK__) - m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); + m_scrollWidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); #else m_scrollWidth = 16; #endif @@ -193,7 +195,7 @@ bool wxGenericGrid::Create(wxWindow *parent, m_cellBackgroundColour = *wxWHITE; m_labelTextColour = *wxBLACK; // m_labelBackgroundColour = *wxLIGHT_GREY; - m_labelBackgroundColour = wxSystemSettings::GetSystemColour( wxSYS_COLOUR_BTNFACE ); + m_labelBackgroundColour = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); m_labelBackgroundBrush = wxNullBrush; m_labelTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxBOLD); m_cellTextFont = * wxTheFontList->FindOrCreateFont(10, wxSWISS, wxNORMAL, wxNORMAL); @@ -204,9 +206,9 @@ bool wxGenericGrid::Create(wxWindow *parent, m_inOnTextInPlace = FALSE; m_inScroll = FALSE; #if defined(__WIN95__) - m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); + m_scrollWidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); #elif defined(__WXGTK__) - m_scrollWidth = wxSystemSettings::GetSystemMetric(wxSYS_VSCROLL_X); + m_scrollWidth = wxSystemSettings::GetMetric(wxSYS_VSCROLL_X); #else m_scrollWidth = 16; #endif @@ -214,7 +216,7 @@ bool wxGenericGrid::Create(wxWindow *parent, m_dragRowOrCol = 0; m_dragStartPosition = 0; m_dragLastPosition = 0; - m_divisionPen = * wxThePenList->FindOrCreatePen("LIGHT GREY", 1, wxSOLID); + m_divisionPen = * wxThePenList->FindOrCreatePen(wxT("LIGHT GREY"), 1, wxSOLID); m_highlightPen = * wxBLACK_PEN; m_doubleBufferingBitmap = (wxBitmap *) NULL; @@ -265,7 +267,7 @@ bool wxGenericGrid::Create(wxWindow *parent, m_editingPanel = new wxPanel(this); - m_textItem = new wxTextCtrl(m_editingPanel, wxGRID_TEXT_CTRL, "", + m_textItem = new wxTextCtrl(m_editingPanel, wxGRID_TEXT_CTRL, wxT(""), wxPoint(m_editControlPosition.x, m_editControlPosition.y), wxSize(m_editControlPosition.width, -1), wxTE_PROCESS_ENTER); @@ -285,7 +287,7 @@ bool wxGenericGrid::Create(wxWindow *parent, // SetSize(pos.x, pos.y, size.x, size.y); - m_inPlaceTextItem = new wxTextCtrl( (wxPanel*)this, wxGRID_EDIT_IN_PLACE_TEXT_CTRL, "", + m_inPlaceTextItem = new wxTextCtrl( (wxPanel*)this, wxGRID_EDIT_IN_PLACE_TEXT_CTRL, wxT(""), wxPoint( m_currentRect.x-wxIPE_ADJUST, m_currentRect.y-wxIPE_ADJUST ), wxSize( m_currentRect.width+wxIPE_ADJUST*2, m_currentRect.height+wxIPE_ADJUST*2 ), wxNO_BORDER | wxTE_PROCESS_ENTER ); @@ -1475,7 +1477,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) if (cell) { if ( cell->GetTextValue().IsNull() ) - m_textItem->SetValue(""); + m_textItem->SetValue(wxT("")); else m_textItem->SetValue(cell->GetTextValue()); } @@ -1516,7 +1518,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour()); if ( cell->GetTextValue().IsNull() ) { - m_inPlaceTextItem->SetValue( "" ); + m_inPlaceTextItem->SetValue( wxT("") ); } else { m_inPlaceTextItem->SetValue( cell->GetTextValue() ); @@ -1536,7 +1538,7 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) HighlightCell(dc, TRUE); #endif } - else + else if (!wxIPE_HIGHLIGHT) { // 1) Why isn't this needed for Windows?? // Probably because of the SetValue?? JS. @@ -1545,10 +1547,11 @@ void wxGenericGrid::OnSelectCellImplementation(wxDC *dc, int row, int col) // // 3) It *is* needed for Motif - michael // -#if defined(__WXMOTIF__) - if ((wxIPE_HIGHLIGHT || !(m_editable && m_editInPlace))) + // 4) It *seems* to be needed whenever + // wxIPE_HIGHLIGHT is not set (i.e. + // for both wxGTK and wxMOTIF)... SN. + if (!(m_editable && m_editInPlace))) HighlightCell(dc, TRUE); -#endif } dc->DestroyClippingRegion(); @@ -1569,7 +1572,7 @@ void wxGenericGrid::OnChangeLabels() int i; for (i = 0; i < m_totalRows; i++) { - sprintf(buf, "%d", i+1); + sprintf(buf, wxT("%d"), i+1); SetLabelValue(wxVERTICAL, buf, i); } // A...Z,AA...ZZ,AAA...ZZZ, etc. @@ -1582,7 +1585,7 @@ void wxGenericGrid::OnChangeLabels() for (j = 0; j < noTimes; j++) { char buf2[20]; - sprintf(buf2, "%c", (char)ch); + sprintf(buf2, wxT("%c"), (char)ch); strcat(buf, buf2); } SetLabelValue(wxHORIZONTAL, buf, i); @@ -1663,7 +1666,7 @@ void wxGenericGrid::DrawCellText() rect.height -= 4; // FIXME: what's this string of spaces supposed to represent? - DrawTextRect(& dc, " ", &rect, wxLEFT); + DrawTextRect(& dc, wxT(" "), &rect, wxLEFT); DrawTextRect(& dc, editValue, &rect, cell->GetAlignment()); dc.DestroyClippingRegion(); @@ -1959,7 +1962,7 @@ void wxGenericGrid::RefreshCell(int row, int col, bool setText) wxString& wxGenericGrid::GetCellValue(int row, int col) const { - static wxString emptyString(""); + static wxString emptyString(wxT("")); wxGridCell *cell = GetCell(row, col); if (cell) @@ -2041,7 +2044,7 @@ void wxGenericGrid::SetLabelValue(int orientation, const wxString& val, int pos) wxString& wxGenericGrid::GetLabelValue(int orientation, int pos) const { - static wxString emptyString = ""; + static wxString emptyString = wxT(""); wxGridCell *cell = GetLabelCell(orientation, pos); if (cell) return cell->GetTextValue(); @@ -2158,7 +2161,7 @@ void wxGenericGrid::SetEditInPlace(bool edit) m_inPlaceTextItem->SetForegroundColour(cell->GetTextColour()); if ( cell->GetTextValue().IsNull() ) { - m_inPlaceTextItem->SetValue( "" ); + m_inPlaceTextItem->SetValue( wxT("") ); } else { m_inPlaceTextItem->SetValue( cell->GetTextValue() ); @@ -2852,3 +2855,4 @@ void *wxGenericGrid::GetCellData(int row, int col) return rc; } +#endif // wxUSE_GRID && !(wxUSE_NEW_GRID)