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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user