From 152e88789d20940b7c017af9f2c1859f5962d661 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Thu, 18 May 2006 01:52:55 +0000 Subject: [PATCH] Reverted mistaken check-in git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39199 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/listctrl/listtest.cpp | 4 ++-- samples/toolbar/toolbar.cpp | 4 ---- src/generic/grid.cpp | 31 +++++++++++++++---------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp index f55f7440b0..116212c3bf 100644 --- a/samples/listctrl/listtest.cpp +++ b/samples/listctrl/listtest.cpp @@ -516,9 +516,9 @@ void MyFrame::InitWithIconItems(bool withText, bool sameIcon) m_listCtrl->SetImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL); m_listCtrl->SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); - for ( int i = 0; i < NUM_ICONS*20; i++ ) + for ( int i = 0; i < NUM_ICONS; i++ ) { - int image = i % (NUM_ICONS); + int image = sameIcon ? 0 : i; if ( withText ) { diff --git a/samples/toolbar/toolbar.cpp b/samples/toolbar/toolbar.cpp index a841af5173..e7a02de316 100644 --- a/samples/toolbar/toolbar.cpp +++ b/samples/toolbar/toolbar.cpp @@ -679,10 +679,6 @@ void MyFrame::OnToolLeftClick(wxCommandEvent& event) { DoDeletePrint(); } - if (event.GetId() == IDM_TOOLBAR_OTHER_1) - { - m_tbar->Realize(); - } } void MyFrame::OnToolRightClick(wxCommandEvent& event) diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp index 6293c3cd99..81140534de 100644 --- a/src/generic/grid.cpp +++ b/src/generic/grid.cpp @@ -7957,24 +7957,23 @@ void wxGrid::ShowCellEditControl() editor->SetCellAttr( attr ); editor->SetSize( rect ); - if (nXMove != 0) - editor->GetControl()->Move( - editor->GetControl()->GetPosition().x + nXMove, - editor->GetControl()->GetPosition().y ); + editor->GetControl()->Move( + editor->GetControl()->GetPosition().x + nXMove, + editor->GetControl()->GetPosition().y ); editor->Show( true, attr ); - int colXPos = GetColLeft(col); -// for (int i = 0; i < m_currentCellCoords.GetCol(); i++) -// { -// colXPos += GetColSize( i ); -// } - -// int xUnit = 1, yUnit = 1; -// GetScrollPixelsPerUnit( &xUnit, &yUnit ); -// if (col != 0) -// Scroll( colXPos / xUnit - 1, GetScrollPos( wxVERTICAL ) ); -// else -// Scroll( colXPos / xUnit, GetScrollPos( wxVERTICAL ) ); + int colXPos = 0; + for (int i = 0; i < m_currentCellCoords.GetCol(); i++) + { + colXPos += GetColSize( i ); + } + + int xUnit = 1, yUnit = 1; + GetScrollPixelsPerUnit( &xUnit, &yUnit ); + if (m_currentCellCoords.GetCol() != 0) + Scroll( colXPos / xUnit - 1, GetScrollPos( wxVERTICAL ) ); + else + Scroll( colXPos / xUnit, GetScrollPos( wxVERTICAL ) ); // recalc dimensions in case we need to // expand the scrolled window to account for editor -- 2.47.2