X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b73da1a41bc27c68133f54debbbfe7597c869637..f2012fa63905c4b1e2a144a56e48097a46e3f3e1:/tests/controls/gridtest.cpp diff --git a/tests/controls/gridtest.cpp b/tests/controls/gridtest.cpp index 0bb469ab37..34da0de16f 100644 --- a/tests/controls/gridtest.cpp +++ b/tests/controls/gridtest.cpp @@ -587,16 +587,9 @@ void GridTestCase::SelectionMode() m_grid->SetSelectionMode(wxGrid::wxGridSelectRows); m_grid->SelectBlock(3, 1, 3, 1); - wxGridCellCoordsArray topleft = m_grid->GetSelectionBlockTopLeft(); - wxGridCellCoordsArray bottomright = m_grid->GetSelectionBlockBottomRight(); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Count()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Count()); - - CPPUNIT_ASSERT_EQUAL(0, topleft.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(3, topleft.Item(0).GetRow()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(3, bottomright.Item(0).GetRow()); + wxArrayInt selectedRows = m_grid->GetSelectedRows(); + CPPUNIT_ASSERT_EQUAL(1, selectedRows.Count()); + CPPUNIT_ASSERT_EQUAL(3, selectedRows[0]); CPPUNIT_ASSERT_EQUAL(wxGrid::wxGridSelectRows, m_grid->GetSelectionMode()); @@ -607,16 +600,9 @@ void GridTestCase::SelectionMode() m_grid->SetSelectionMode(wxGrid::wxGridSelectColumns); m_grid->SelectBlock(3, 1, 3, 1); - topleft = m_grid->GetSelectionBlockTopLeft(); - bottomright = m_grid->GetSelectionBlockBottomRight(); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Count()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Count()); - - CPPUNIT_ASSERT_EQUAL(1, topleft.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(0, topleft.Item(0).GetRow()); - CPPUNIT_ASSERT_EQUAL(1, bottomright.Item(0).GetCol()); - CPPUNIT_ASSERT_EQUAL(9, bottomright.Item(0).GetRow()); + wxArrayInt selectedCols = m_grid->GetSelectedCols(); + CPPUNIT_ASSERT_EQUAL(1, selectedCols.Count()); + CPPUNIT_ASSERT_EQUAL(1, selectedCols[0]); CPPUNIT_ASSERT_EQUAL(wxGrid::wxGridSelectColumns, m_grid->GetSelectionMode()); @@ -644,11 +630,13 @@ void GridTestCase::CellFormatting() CPPUNIT_ASSERT_EQUAL(back, m_grid->GetCellTextColour(0, 0)); - m_grid->SetCellAlignment(0, 0, wxALIGN_CENTRE); +#if WXWIN_COMPATIBILITY_2_8 + m_grid->SetCellAlignment(wxALIGN_CENTRE, 0, 0); m_grid->GetCellAlignment(0, 0, &cellhoriz, &cellvert); CPPUNIT_ASSERT_EQUAL(static_cast(wxALIGN_CENTRE), cellhoriz); CPPUNIT_ASSERT_EQUAL(static_cast(wxALIGN_CENTRE), cellvert); +#endif // WXWIN_COMPATIBILITY_2_8 m_grid->SetCellAlignment(0, 0, wxALIGN_LEFT, wxALIGN_BOTTOM); m_grid->GetCellAlignment(0, 0, &cellhoriz, &cellvert); @@ -656,12 +644,12 @@ void GridTestCase::CellFormatting() CPPUNIT_ASSERT_EQUAL(static_cast(wxALIGN_LEFT), cellhoriz); CPPUNIT_ASSERT_EQUAL(static_cast(wxALIGN_BOTTOM), cellvert); - m_grid->SetCellTextColour(0, 0, *wxRED); - +#if WXWIN_COMPATIBILITY_2_8 + m_grid->SetCellTextColour(*wxRED, 0, 0); CPPUNIT_ASSERT_EQUAL(*wxRED, m_grid->GetCellTextColour(0, 0)); +#endif // WXWIN_COMPATIBILITY_2_8 m_grid->SetCellTextColour(0, 0, *wxGREEN); - CPPUNIT_ASSERT_EQUAL(*wxGREEN, m_grid->GetCellTextColour(0, 0)); }