add MwNactivateHandler

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@331 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
NishiOwO
2025-10-14 18:34:29 +00:00
parent 81b3edd023
commit 8bbfeb5959
3 changed files with 25 additions and 18 deletions

View File

@@ -29,7 +29,12 @@ static void frame_mouse_down(MwWidget handle, void* user, void* call) {
st = get_first_entry(lb);
for(i = 0; i < (h - MwDefaultBorderWidth * 2) / MwTextHeight(handle, "M"); i++) {
if(y <= m->point.y && m->point.y <= (y + MwTextHeight(handle, "M"))) {
lb->selected = st + i;
unsigned long t;
if(((t = MwLLGetTick()) - lb->click_time) < 250 && lb->selected == st + i) {
MwDispatchUserHandler(handle->parent, MwNactivateHandler, &lb->selected);
}
lb->selected = st + i;
lb->click_time = t;
}
y += MwTextHeight(handle, "M");
}
@@ -126,8 +131,9 @@ static int create(MwWidget handle) {
MwSetDefault(handle);
resize(handle);
lb->list = NULL;
lb->selected = -1;
lb->list = NULL;
lb->selected = -1;
lb->click_time = 0;
return 0;
}