Moved the check for page scrolling with the wheel into wxMouseEvent so
it wouldn't have to be duplicated everywhere. Also fixed wxSTC so it can handle wheel page scrolling too. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -467,8 +467,9 @@ void ScintillaWX::DoVScroll(int type, int pos) {
|
||||
ScrollTo(topLineNew);
|
||||
}
|
||||
|
||||
|
||||
void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown) {
|
||||
void ScintillaWX::DoMouseWheel(int rotation, int delta,
|
||||
int linesPerAction, int ctrlDown,
|
||||
bool isPageScroll ) {
|
||||
int topLineNew = topLine;
|
||||
int lines;
|
||||
|
||||
@@ -485,7 +486,10 @@ void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction, int
|
||||
lines = wheelRotation / delta;
|
||||
wheelRotation -= lines * delta;
|
||||
if (lines != 0) {
|
||||
lines *= linesPerAction;
|
||||
if (isPageScroll)
|
||||
lines = lines * LinesOnScreen(); // lines is either +1 or -1
|
||||
else
|
||||
lines *= linesPerAction;
|
||||
topLineNew -= lines;
|
||||
ScrollTo(topLineNew);
|
||||
}
|
||||
|
@@ -125,7 +125,7 @@ public:
|
||||
void DoButtonDown(Point pt, unsigned int curTime, bool shift, bool ctrl, bool alt);
|
||||
void DoButtonUp(Point pt, unsigned int curTime, bool ctrl);
|
||||
void DoButtonMove(Point pt);
|
||||
void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown);
|
||||
void DoMouseWheel(int rotation, int delta, int linesPerAction, int ctrlDown, bool isPageScroll);
|
||||
void DoAddChar(int key);
|
||||
int DoKeyDown(int key, bool shift, bool ctrl, bool alt, bool* consumed);
|
||||
void DoTick() { Tick(); }
|
||||
|
@@ -1912,7 +1912,8 @@ void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
|
||||
m_swx->DoMouseWheel(evt.GetWheelRotation(),
|
||||
evt.GetWheelDelta(),
|
||||
evt.GetLinesPerAction(),
|
||||
evt.ControlDown());
|
||||
evt.ControlDown(),
|
||||
evt.IsPageScroll());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -365,7 +365,8 @@ void wxStyledTextCtrl::OnMouseWheel(wxMouseEvent& evt) {
|
||||
m_swx->DoMouseWheel(evt.GetWheelRotation(),
|
||||
evt.GetWheelDelta(),
|
||||
evt.GetLinesPerAction(),
|
||||
evt.ControlDown());
|
||||
evt.ControlDown(),
|
||||
evt.IsPageScroll());
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user