Remove scroll units duplication in wxGrid to fix setting them.

For some unknown reason wxGrid decided to store its scroll units in its own
m_scrollLine[XY] variables instead of just using the base wxScrollWindow class
m_[xy]ScrollPixelsPerLine ones. And, of course, the two could get out of sync
because wxGrid didn't update the base class version correctly.

Just don't duplicate these values at all and use the base class fields. This
makes the code simpler and also fixes changing the size of the scroll units.

Closes #12221.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64918 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-07-12 22:50:23 +00:00
parent ad178a657e
commit fd76c6a77d
2 changed files with 15 additions and 18 deletions

View File

@@ -1595,10 +1595,10 @@ public:
}
// Allow adjustment of scroll increment. The default is (15, 15).
void SetScrollLineX(int x) { m_scrollLineX = x; }
void SetScrollLineY(int y) { m_scrollLineY = y; }
int GetScrollLineX() const { return m_scrollLineX; }
int GetScrollLineY() const { return m_scrollLineY; }
void SetScrollLineX(int x) { m_xScrollPixelsPerLine = x; }
void SetScrollLineY(int y) { m_yScrollPixelsPerLine = y; }
int GetScrollLineX() const { return m_xScrollPixelsPerLine; }
int GetScrollLineY() const { return m_yScrollPixelsPerLine; }
// ------- drag and drop
#if wxUSE_DRAG_AND_DROP
@@ -2046,9 +2046,6 @@ protected:
bool m_editable; // applies to whole grid
bool m_cellEditCtrlEnabled; // is in-place edit currently shown?
int m_scrollLineX; // X scroll increment
int m_scrollLineY; // Y scroll increment
void Init(); // common part of all ctors
void Create();
void CreateColumnWindow();