Added MouseWheel support to wxSTC

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10013 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2001-05-06 01:20:41 +00:00
parent d13d99aa85
commit 37d6243357
14 changed files with 84 additions and 6 deletions

View File

@@ -95,6 +95,7 @@ ScintillaWX::ScintillaWX(wxStyledTextCtrl* win) {
wMain = win;
wDraw = win;
stc = win;
wheelRotation = 0;
Initialise();
}
@@ -363,6 +364,22 @@ void ScintillaWX::DoVScroll(int type, int pos) {
ScrollTo(topLineNew);
}
void ScintillaWX::DoMouseWheel(int rotation, int delta, int linesPerAction) {
int topLineNew = topLine;
int lines;
wheelRotation += rotation;
lines = wheelRotation / delta;
wheelRotation -= lines * delta;
if (lines != 0) {
lines *= linesPerAction;
topLineNew -= lines;
ScrollTo(topLineNew);
}
}
void ScintillaWX::DoSize(int width, int height) {
PRectangle rcClient(0,0,width,height);
SetScrollBarsTo(rcClient);