gui events and items changed..

master
steffen 13 years ago
parent 1f2310937e
commit 68803c1921

@ -1,4 +1,4 @@
/* $Id: gui.c,v 1.12 2013/02/27 22:21:35 steffen Exp $ */ /* $Id: gui.c,v 1.13 2013/02/27 23:50:17 steffen Exp $ */
/*************************************************************************** /***************************************************************************
* gui.c * gui.c
* *
@ -157,7 +157,7 @@ int gui_event (GUIEvent event) {
if (GUI_ITEM_IS_INSIDE (currentwin->items[i], winpos)) if (GUI_ITEM_IS_INSIDE (currentwin->items[i], winpos))
item = currentwin->items[i]; item = currentwin->items[i];
d_printf ("item:%p , type:%d , focus:%p", item, item ? item->type : -1, currentwin->focus); // d_printf ("item:%p , type:%d , focus:%p", item, item ? item->type : -1, currentwin->focus);
if (item) switch (item->type) { if (item) switch (item->type) {
case (GUI_BUTTON): case (GUI_BUTTON):
@ -183,7 +183,7 @@ int gui_event (GUIEvent event) {
} }
/* no gui active nor any window is responsible.. */ /* no gui active nor any window is responsible.. */
d_printf ("no event.."); // d_printf ("no event..");
switch (event.event) { switch (event.event) {
case (EGUI_MOUSERELEASED): case (EGUI_MOUSERELEASED):
draw_mousebtnup (event.mousepos.x, event.mousepos.y, event.mousebtn); draw_mousebtnup (event.mousepos.x, event.mousepos.y, event.mousebtn);

@ -1,4 +1,4 @@
/* $Id: gui_entry.c,v 1.6 2013/02/27 22:21:35 steffen Exp $ */ /* $Id: gui_entry.c,v 1.7 2013/02/27 23:50:17 steffen Exp $ */
/*************************************************************************** /***************************************************************************
* gui_entry.c * gui_entry.c
* *
@ -73,11 +73,9 @@ void gui_entry_event (GUIItem *item, GUIEvent *event) {
if (item) entry = (GUIEntry *) item->data; if (item) entry = (GUIEntry *) item->data;
d_printf ("event: %d pos: %d,%d", event->event, event->mousepos.x, event->mousepos.y); d_printf ("gui_entry_event: %d pos: %d,%d", event->event, event->mousepos.x, event->mousepos.y);
if (event->event == EGUI_MOUSERELEASED if (event->event == EGUI_MOUSERELEASED) {
&& event->mousepos.x < item->x && item->x+item->w >= event->mousepos.x
&& event->mousepos.y < item->y && item->y+item->h >= event->mousepos.y) {
d_printf ("gui_entry_event set focus"); d_printf ("gui_entry_event set focus");
currentwin->focus = item; currentwin->focus = item;
} }

Loading…
Cancel
Save