some fixes..

master
steffen 12 years ago
parent 09b8c79772
commit 136a51f1f0

@ -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 ();

@ -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);

@ -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";

@ -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");

@ -1,4 +1,4 @@
/* $Id: sdl_main.c,v 1.16 2014/03/06 22:21:46 steffen Exp $ */
#include <SDL.h>
#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 ());
}

Loading…
Cancel
Save