works on gdi too

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@279 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-11 16:22:20 +00:00
parent 9d3dcf1e1a
commit 3f97e021b2
4 changed files with 50 additions and 4 deletions

View File

@@ -164,8 +164,30 @@ static void mouse_down(MwWidget handle, void* ptr) {
int wh = MwGetInteger(handle, MwNheight);
int or = MwGetInteger(handle, MwNorientation);
scrollbar_t* scr = handle->internal;
MwLLMouse* m = ptr;
if(((MwLLMouse*)ptr)->button != MwLLMouseLeft) return;
if(m->button == MwLLMouseWheelUp) {
int min = MwGetInteger(handle, MwNminValue);
int val = MwGetInteger(handle, MwNvalue);
val -= MwGetInteger(handle, MwNareaShown);
if(val < min) val = min;
MwSetInteger(handle, MwNvalue, val);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
} else if(m->button == MwLLMouseWheelDown) {
int max = MwGetInteger(handle, MwNmaxValue);
int val = MwGetInteger(handle, MwNvalue);
val += MwGetInteger(handle, MwNareaShown);
if(val > max) val = max;
MwSetInteger(handle, MwNvalue, val);
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
}
if(m->button != MwLLMouseLeft) return;
scr->point = handle->mouse_point;
scr->drag = 0;