diff --git a/draw/draw_gui.c b/draw/draw_gui.c index 745c87d..993ed97 100644 --- a/draw/draw_gui.c +++ b/draw/draw_gui.c @@ -96,14 +96,12 @@ void draw_mousebtnup (int x, int y, int btn) mousebtn = 0; /* check for debugging routeing problems */ - if (route && y > gfx_screensize.y-32 && y < gfx_screensize.y && x > 0 && x < 100 ) - { + if (route && y > gfx_screensize.y-32 && y < gfx_screensize.y && x > 0 && x < 100 ) { view_lon = route->closest_lon; view_lat = route->closest_lat; draw_del_flag (DRAW_GPSFOLLOW); } - else - { + else { lat = -map_km2lat(((float)(y-gfx_screensize.y/2)) * view_scale); lon = map_km2lon(((float)(x-gfx_screensize.x/2)) * view_scale, view_lat + lat); @@ -111,24 +109,20 @@ void draw_mousebtnup (int x, int y, int btn) dy = abs (mousebtnpresspos.y-y)*100/gfx_screensize.y; /* short time button pressing */ - if (t - mousebtnpresstime <= 1) - { - if (dx < 10 && dy < 10) - { - if (select_enabled) - { + d_printf ("released mouse button.."); + if (t - mousebtnpresstime <= 1) { + if (dx < 10 && dy < 10) { + if (select_enabled) { select_enabled = 0; } - else - { + else { select_enabled = 1; select_pos.lat = view_lat + lat; select_pos.lon = view_lon + lon; } } } - else if (mousebtnpresslongtime && dx < 10 && dy < 10) - { + else if (mousebtnpresslongtime && dx < 10 && dy < 10) { /* long time button pressed */ wnd_mapcontext_show (); } @@ -138,12 +132,10 @@ void draw_mousebtnup (int x, int y, int btn) }; -void draw_mouseloop () -{ +void draw_mouseloop () { time_t t = time(NULL); - if (mousebtn && t - mousebtnpresstime > 1) - { + if (mousebtn && t - mousebtnpresstime > 1) { mousebtnpresslongtime = 1; d_printf ("draw_mouseloop: long press.."); draw (); diff --git a/gui/gui.c b/gui/gui.c index cdfe064..1faa441 100644 --- a/gui/gui.c +++ b/gui/gui.c @@ -1,4 +1,4 @@ -/* $Id: gui.c,v 1.26 2014/02/04 20:33:01 steffen Exp $ */ +/* $Id: gui.c,v 1.28 2014/03/06 22:21:46 steffen Exp $ */ /*************************************************************************** * gui.c * @@ -164,6 +164,7 @@ void gui_draw () { * return 0 for nothing done.. or 1 for eventhandling done */ int gui_event (GUIEvent event) { + d_printf ("gui_event..."); if (currentwin) { event.guiwin_mpos.x = event.scr_mpos.x - currentwin->x; event.guiwin_mpos.y = event.scr_mpos.y - currentwin->y; @@ -175,7 +176,7 @@ int gui_event (GUIEvent event) { } /* no gui active nor any window is responsible.. */ - // d_printf ("no event.."); + //d_printf ("no event.."); switch (event.event) { case (EGUI_MOUSERELEASED): draw_mousebtnup (event.scr_mpos.x, event.scr_mpos.y, event.mousebtn); diff --git a/main/gui_mainmenu.c b/main/gui_mainmenu.c index 63320e3..87d5967 100644 --- a/main/gui_mainmenu.c +++ b/main/gui_mainmenu.c @@ -1,4 +1,4 @@ -/* $Id: gui_mainmenu.c,v 1.14 2013/08/28 09:42:46 steffen Exp $ */ +/* $Id: gui_mainmenu.c,v 1.15 2014/03/06 22:21:46 steffen Exp $ */ /*************************************************************************** * gui_mainmenu.c * @@ -199,6 +199,11 @@ void gui_mainmenu_refresh () { void gui_mainmenu_refreshidx () { + static int _working = 0; + + if (_working) return; + _working = 1; + #ifndef _WINDOWSCE_ char lfn[LEN_FILENAME]; char rfn[LEN_FILENAME] = "search.mapidx"; diff --git a/main/wnd_mapcontext.c b/main/wnd_mapcontext.c index e14bd00..8e70728 100644 --- a/main/wnd_mapcontext.c +++ b/main/wnd_mapcontext.c @@ -1,4 +1,4 @@ -/* $Id: wnd_mapcontext.c,v 1.1 2014/02/12 21:21:08 steffen Exp $ */ +/* $Id: wnd_mapcontext.c,v 1.2 2014/03/06 22:21:46 steffen Exp $ */ /*************************************************************************** * wnd_mapcontext.c * @@ -81,6 +81,9 @@ void wnd_mapcontext_close () { void wnd_mapcontext_setdest () { static int _setdest = 0; + wmmapc.event_called = 0; // make events possible, because route_start will + // not come back until routing is finished or aborted. + d_printf ("gui_mapcontext_setdest"); d_printf ("set destination routing start"); diff --git a/sdlgl/sdl_main.c b/sdlgl/sdl_main.c index 6ba8bfd..515a360 100644 --- a/sdlgl/sdl_main.c +++ b/sdlgl/sdl_main.c @@ -1,4 +1,4 @@ - +/* $Id: sdl_main.c,v 1.16 2014/03/06 22:21:46 steffen Exp $ */ #include #include "osmroute.h" #include "system.h" @@ -295,7 +295,8 @@ int main (int argc, char **argv) { void main_wnd_update () { - d_printf ("main_wnd_update : %d", app.status); + // d_printf ("main_wnd_update : %d", app.status); + app_loop(); while (msdl_eventloop ()); }