}
// 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
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();
Create();
SetInitialSize(size);
- SetScrollRate(m_scrollLineX, m_scrollLineY);
CalcDimensions();
return true;
m_extraWidth =
m_extraHeight = 0;
- m_scrollLineX = GRID_SCROLL_LINE_X;
- m_scrollLineY = GRID_SCROLL_LINE_Y;
+ // we can't call SetScrollRate() as the window isn't created yet but OTOH
+ // we don't need to call it neither as the scroll position is (0, 0) right
+ // now anyhow, so just set the parameters directly
+ m_xScrollPixelsPerLine = GRID_SCROLL_LINE_X;
+ m_yScrollPixelsPerLine = GRID_SCROLL_LINE_Y;
}
// ----------------------------------------------------------------------------
//
// Sometimes GRID_SCROLL_LINE / 2 is not enough,
// so just add a full scroll unit...
- ypos += m_scrollLineY;
+ ypos += m_yScrollPixelsPerLine;
}
// special handling for wide cells - show always left part of the cell!
xpos = x0 + (right - cw);
// see comment for ypos above
- xpos += m_scrollLineX;
+ xpos += m_xScrollPixelsPerLine;
}
if ( xpos != -1 || ypos != -1 )
{
if ( xpos != -1 )
- xpos /= m_scrollLineX;
+ xpos /= m_xScrollPixelsPerLine;
if ( ypos != -1 )
- ypos /= m_scrollLineY;
+ ypos /= m_yScrollPixelsPerLine;
Scroll( xpos, ypos );
AdjustScrollbars();
}
// we know that we're not going to have scrollbars so disable them now to
// avoid trouble in SetClientSize() which can otherwise set the correct
// client size but also leave space for (not needed any more) scrollbars
- SetScrollbars(0, 0, 0, 0, 0, 0, true);
-
- // restore the scroll rate parameters overwritten by SetScrollbars()
- SetScrollRate(m_scrollLineX, m_scrollLineY);
+ SetScrollbars(m_xScrollPixelsPerLine, m_yScrollPixelsPerLine,
+ 0, 0, 0, 0, true);
SetClientSize(size.x + m_rowLabelWidth, size.y + m_colLabelHeight);
}