better api for mouse

git-svn-id: http://svn2.nishi.boats/svn/milsko/trunk@269 b9cfdab3-6d41-4d17-bbe4-086880011989
This commit is contained in:
Nishi 2025-10-11 13:01:41 +00:00
commit d03ccea517
12 changed files with 132 additions and 86 deletions

View file

@ -122,8 +122,11 @@ static void parent_resize(MwWidget handle) {
set_xywh(handle);
}
static void mouse_down(MwWidget handle) {
static void mouse_down(MwWidget handle, void* ptr) {
MENU_LOOP_DECL;
if(((MwLLMouse*)ptr)->button != MwLLMouseLeft) return;
BEGIN_MENU_LOOP;
if(in_area) {
if(m->sub[i]->wsub == NULL && arrlen(m->sub[i]->sub) > 0) {
@ -151,8 +154,11 @@ static void mouse_down(MwWidget handle) {
MwForceRender(handle);
}
static void mouse_up(MwWidget handle) {
static void mouse_up(MwWidget handle, void* ptr) {
MENU_LOOP_DECL;
if(((MwLLMouse*)ptr)->button != MwLLMouseLeft) return;
BEGIN_MENU_LOOP;
if(in_area && m->sub[i]->wsub != NULL) {
m->sub[i]->keep = 1;