mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2026-01-09 10:53:27 +00:00
add color picker example
git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@381 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
@@ -132,7 +132,7 @@ static void draw(MwWidget handle) {
|
||||
}
|
||||
|
||||
static void mouse_move(MwWidget handle) {
|
||||
int or = MwGetInteger(handle, MwNorientation);
|
||||
int or = MwGetInteger(handle, MwNorientation);
|
||||
scrollbar_t* scr = handle->internal;
|
||||
|
||||
if(!handle->pressed) return;
|
||||
@@ -160,31 +160,35 @@ static void mouse_move(MwWidget handle) {
|
||||
}
|
||||
|
||||
static void mouse_down(MwWidget handle, void* ptr) {
|
||||
int ww = MwGetInteger(handle, MwNwidth);
|
||||
int wh = MwGetInteger(handle, MwNheight);
|
||||
int or = MwGetInteger(handle, MwNorientation);
|
||||
int ww = MwGetInteger(handle, MwNwidth);
|
||||
int wh = MwGetInteger(handle, MwNheight);
|
||||
int or = MwGetInteger(handle, MwNorientation);
|
||||
scrollbar_t* scr = handle->internal;
|
||||
MwLLMouse* m = ptr;
|
||||
|
||||
if(m->button == MwLLMouseWheelUp) {
|
||||
int min = MwGetInteger(handle, MwNminValue);
|
||||
int val = MwGetInteger(handle, MwNvalue);
|
||||
int min = MwGetInteger(handle, MwNminValue);
|
||||
int val = MwGetInteger(handle, MwNvalue);
|
||||
int diff = MwGetInteger(handle, MwNareaShown);
|
||||
|
||||
val -= MwGetInteger(handle, MwNareaShown);
|
||||
val -= diff;
|
||||
|
||||
if(val < min) val = min;
|
||||
|
||||
MwSetInteger(handle, MwNvalue, val);
|
||||
MwSetInteger(handle, MwNchangedBy, -diff);
|
||||
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
|
||||
} else if(m->button == MwLLMouseWheelDown) {
|
||||
int max = MwGetInteger(handle, MwNmaxValue);
|
||||
int val = MwGetInteger(handle, MwNvalue);
|
||||
int max = MwGetInteger(handle, MwNmaxValue);
|
||||
int val = MwGetInteger(handle, MwNvalue);
|
||||
int diff = MwGetInteger(handle, MwNareaShown);
|
||||
|
||||
val += MwGetInteger(handle, MwNareaShown);
|
||||
val += diff;
|
||||
|
||||
if(val > max) val = max;
|
||||
|
||||
MwSetInteger(handle, MwNvalue, val);
|
||||
MwSetInteger(handle, MwNchangedBy, diff);
|
||||
MwDispatchUserHandler(handle, MwNchangedHandler, NULL);
|
||||
}
|
||||
if(m->button != MwLLMouseLeft) return;
|
||||
|
||||
Reference in New Issue
Block a user