selecting map works..

master
steffen 13 years ago
parent 7ef7965350
commit 5bab311f8a

@ -5,7 +5,8 @@ DEPENDFILE = .depend
DEBUG = -ggdb DEBUG = -ggdb
AR = i586-mingw32msvc-ar AR = i586-mingw32msvc-ar
CC = i586-mingw32msvc-gcc CC = i586-mingw32msvc-gcc
CFLAGS = -Wall -I../main -I../ -I../mapsys -I../gui -I../wince -I../draw -I../base -DSPOSMROUTE -DHAVE_WINAPI -D_WIN32_IE=0x400 $(DEBUG) # CFLAGS = -Wall -I../main -I../ -I../mapsys -I../gui -I../wince -I../draw -I../base -DSPOSMROUTE -DHAVE_WINAPI -D_WIN32_IE=0x400 $(DEBUG)
CFLAGS = -Wall -I../main -I../ -I../mapsys -I../gui -I../wince -I../draw -I../base -DSPOSMROUTE -DHAVE_WINAPI $(DEBUG)
WINRES = i586-mingw32msvc-windres WINRES = i586-mingw32msvc-windres
LIBS = -lgdi32 -lcomdlg32 -lwsock32 LIBS = -lgdi32 -lcomdlg32 -lwsock32

@ -197,26 +197,29 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event)
struct engine* engine = (struct engine*)app->userData; struct engine* engine = (struct engine*)app->userData;
if (type == AINPUT_EVENT_TYPE_MOTION) { if (type == AINPUT_EVENT_TYPE_MOTION) {
int32_t subtype = AMotionEvent_getAction (event); int32_t subtype = AMotionEvent_getAction (event);
gevent.mousepos.x = AMotionEvent_getX(event, 0); gevent.scr_mpos.x = AMotionEvent_getX(event, 0);
gevent.mousepos.y = AMotionEvent_getY(event, 0); gevent.scr_mpos.y = AMotionEvent_getY(event, 0);
if (subtype == AMOTION_EVENT_ACTION_MOVE) { if (subtype == AMOTION_EVENT_ACTION_MOVE) {
gevent.event = EGUI_MOUSEMOVE; gevent.event = EGUI_MOUSEMOVE;
if (gui_event (gevent) == 0) draw_mousemove (gevent.mousepos.x, gevent.mousepos.y, 0); // if (gui_event (gevent) == 0) draw_mousemove (gevent.scr_mpos.x, gevent.scr_mpos.y, 0);
gui_event (gevent);
return 1; return 1;
} }
else if (subtype == AMOTION_EVENT_ACTION_UP) { else if (subtype == AMOTION_EVENT_ACTION_UP) {
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSERELEASED; gevent.event = EGUI_MOUSERELEASED;
if (gui_event (gevent) == 0) draw_mousebtnup (gevent.mousepos.x, gevent.mousepos.y, 1); // if (gui_event (gevent) == 0) draw_mousebtnup (gevent.scr_mpos.x, gevent.scr_mpos.y, 1);
gui_event (gevent);
return; return;
} }
else if (subtype == AMOTION_EVENT_ACTION_DOWN) { else if (subtype == AMOTION_EVENT_ACTION_DOWN) {
char *tmp; char *tmp;
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSEPRESSED; gevent.event = EGUI_MOUSEPRESSED;
if (gui_event (gevent) == 0) draw_mousebtndown (gevent.mousepos.x, gevent.mousepos.y, 1); // if (gui_event (gevent) == 0) draw_mousebtndown (gevent.scr_mpos.x, gevent.scr_mpos.y, 1);
gui_event (gevent);
return; return;
} }
} }
@ -295,45 +298,11 @@ static void engine_handle_cmd(struct android_app* app, int32_t cmd) {
} }
} }
/**
* This is the main entry point of a native application that is using
* android_native_app_glue. It runs in its own thread, with its own
* event loop for receiving input events and doing other things.
*/
void android_main(struct android_app* state) {
time_t t1 = time(NULL), t2 = time(NULL);
struct gps_data *gpspos;
// Make sure glue isn't stripped.
app_dummy();
d_printf ("Android Version");
memset(&engine, 0, sizeof(engine));
state->userData = &engine;
state->onAppCmd = engine_handle_cmd;
state->onInputEvent = engine_handle_input;
engine.app = state;
d_printf ("internal data path: %s", state->activity->internalDataPath);
d_printf ("external data path: %s", state->activity->externalDataPath);
// Prepare to monitor accelerometer
engine.sensorManager = ASensorManager_getInstance();
engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
ASENSOR_TYPE_ACCELEROMETER);
engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,
state->looper, LOOPER_ID_USER, NULL, NULL);
if (state->savedState != NULL) {
// We are starting with a previous saved state; restore from it.
engine.state = *(struct saved_state*)state->savedState;
}
app_init (0, NULL);
// loop waiting for stuff to do. void main_event () {
while (1) {
// Read all pending events. // Read all pending events.
time_t t1 = time(NULL), t2 = time(NULL);
struct gps_data *gpspos;
int ident; int ident;
int events; int events;
struct android_poll_source* source; struct android_poll_source* source;
@ -345,7 +314,7 @@ void android_main(struct android_app* state) {
// Process this event. // Process this event.
if (source != NULL) { if (source != NULL) {
source->process(state, source); source->process(engine.app, source);
} }
// If a sensor has data, process it now. // If a sensor has data, process it now.
@ -362,7 +331,7 @@ void android_main(struct android_app* state) {
} }
// Check if we are exiting. // Check if we are exiting.
if (state->destroyRequested != 0) { if (engine.app->destroyRequested != 0) {
engine_term_display(&engine); engine_term_display(&engine);
return; return;
} }
@ -376,18 +345,54 @@ void android_main(struct android_app* state) {
} }
} }
} }
}
/**
* This is the main entry point of a native application that is using
* android_native_app_glue. It runs in its own thread, with its own
* event loop for receiving input events and doing other things.
*/
void android_main(struct android_app* state) {
// Make sure glue isn't stripped.
app_dummy();
d_printf ("Android Version");
memset(&engine, 0, sizeof(engine));
state->userData = &engine;
state->onAppCmd = engine_handle_cmd;
state->onInputEvent = engine_handle_input;
engine.app = state;
d_printf ("internal data path: %s", state->activity->internalDataPath);
d_printf ("external data path: %s", state->activity->externalDataPath);
// Prepare to monitor accelerometer
engine.sensorManager = ASensorManager_getInstance();
engine.accelerometerSensor = ASensorManager_getDefaultSensor(engine.sensorManager,
ASENSOR_TYPE_ACCELEROMETER);
engine.sensorEventQueue = ASensorManager_createEventQueue(engine.sensorManager,
state->looper, LOOPER_ID_USER, NULL, NULL);
if (state->savedState != NULL) {
// We are starting with a previous saved state; restore from it.
engine.state = *(struct saved_state*)state->savedState;
}
app_init (0, NULL);
// loop waiting for stuff to do.
while (1) {
main_event ();
} }
} }
/************************************************************************* /*************************************************************************
* main functions for sposmroute... * main functions for sposmroute...
*/ */
void main_wnd_loop (long long int cur, long long int max) {
}
void main_wnd_update () { void main_wnd_update () {
main_event ();
} }

@ -54,11 +54,14 @@
#if defined(__MINGW32CE__) || defined(_WIN32_WCE) #if defined(__MINGW32CE__) || defined(_WIN32_WCE)
#define DIR_SEP '/' #define DIR_SEP '/'
#define ROOT_DIR "/"
#else #else
#if defined(__MINGW32__) #if defined(__MINGW32__)
#define DIR_SEP '\\' #define DIR_SEP '\\'
#define ROOT_DIR "C:\\"
#else #else
#define DIR_SEP '/' #define DIR_SEP '/'
#define ROOT_DIR "/"
#endif #endif
#endif #endif

@ -74,8 +74,6 @@ void gui_config_show () {
if (wcfg.screen == NULL) gui_window_new (&wcfg, 220, 280, _("Config")); if (wcfg.screen == NULL) gui_window_new (&wcfg, 220, 280, _("Config"));
wcfg.screen_changed = 1; wcfg.screen_changed = 1;
wcfg.style = WGUI_S_VCENTER | WGUI_S_HCENTER; wcfg.style = WGUI_S_VCENTER | WGUI_S_HCENTER;
gui_show (&wcfg);
if (label1 == NULL) label1 = gui_label_new (_("mapdata path:"), 5, 20); if (label1 == NULL) label1 = gui_label_new (_("mapdata path:"), 5, 20);
gui_window_item_add (&wcfg, label1); gui_window_item_add (&wcfg, label1);
@ -117,6 +115,8 @@ void gui_config_show () {
gui_button_new (_("Close"), 5, wcfg.h-25, wcfg.w-10, 20); gui_button_new (_("Close"), 5, wcfg.h-25, wcfg.w-10, 20);
GUI_BUTTON_T (wcfg_close)->callback_clicked = gui_config_close; GUI_BUTTON_T (wcfg_close)->callback_clicked = gui_config_close;
gui_window_item_add (&wcfg, wcfg_close); gui_window_item_add (&wcfg, wcfg_close);
gui_show (&wcfg);
}; };
@ -129,7 +129,7 @@ void gui_config_close () {
void gui_config_checkbox_changed () { void gui_config_checkbox_changed () {
if (cfg.debug = GUI_CHECKBOX_T(cb_debug)->checked) SETFLAG(view_flags, DRAW_DEBUG); if ((cfg.debug = GUI_CHECKBOX_T(cb_debug)->checked)) SETFLAG(view_flags, DRAW_DEBUG);
else DELFLAG(view_flags, DRAW_DEBUG); else DELFLAG(view_flags, DRAW_DEBUG);
cfg.softkeyboard = GUI_CHECKBOX_T(cb_softkeyb)->checked; cfg.softkeyboard = GUI_CHECKBOX_T(cb_softkeyb)->checked;
@ -148,7 +148,12 @@ void gui_config_gpslist (int nr) {
void gui_config_seldir () { void gui_config_seldir () {
d_printf ("select dir..."); char *new_dir = NULL;
new_dir = gui_sdir_show (GUI_ENTRY_T(map_path)->text);
d_printf ("new_dir:%s", new_dir);
gui_entry_settext (map_path, new_dir);
d_printf ("mapdir:%s", GUI_ENTRY_T(map_path)->text);
}; };

@ -26,16 +26,56 @@
#include "gui.h" #include "gui.h"
#include "system.h" #include "system.h"
#include <sys/types.h>
#include <dirent.h>
void gui_sdir_close (); void gui_sdir_close ();
void gui_sdir_update ();
void gui_sdir_clear ();
void gui_sdir_clicklist (int nr);
GUIWindow wsdir = {0}; GUIWindow wsdir = {0};
char select_dir[LEN_FILENAME]; GUIItem *wsd_close = NULL;
GUIItem *wsd_path = NULL;
GUIItem *wsd_dirlist = NULL;
char **wsd_list = NULL;
int wsd_listmax = 0;
char wsd_select_dir[LEN_FILENAME];
void gui_sdir_show () { char *gui_sdir_show (char *startpath) {
if (wsdir.screen == NULL) gui_window_new (&wsdir, 220, 240, _("Select Dir")); if (wsdir.screen == NULL) gui_window_new (&wsdir, 220, 250, _("Select Dir"));
wsdir.callback_close = (void*)gui_sdir_close;
wsdir.screen_changed = 1; wsdir.screen_changed = 1;
wsdir.style = WGUI_S_VCENTER | WGUI_S_HCENTER; wsdir.style = WGUI_S_VCENTER | WGUI_S_HCENTER;
/* close Button */
if (wsd_close == NULL) wsd_close = gui_button_new (_("Close"), 50, 220, 100, 20);
GUI_BUTTON_T (wsd_close)->callback_clicked = (void*) gui_sdir_close;
gui_window_item_add (&wsdir, wsd_close);
if (wsd_path == NULL) wsd_path = gui_entry_new (startpath, 10, 25, 200, 25);
gui_window_item_add (&wsdir, wsd_path);
if (wsd_dirlist == NULL) wsd_dirlist = gui_list_new (10, 55, 200, 140);
GUI_LIST_T (wsd_dirlist)->callback_selectitem = gui_sdir_clicklist;
GUI_LIST_T (wsd_dirlist)->data = wsd_list;
gui_window_item_add (&wsdir, wsd_dirlist);
gui_sdir_update ();
gui_show (&wsdir);
while (currentwin == &wsdir) {
main_wnd_update ();
}
strncpy (wsd_select_dir, GUI_ENTRY_T(wsd_path)->text, LEN_FILENAME-1);
if (wsd_select_dir[strlen(wsd_select_dir)-1] != DIR_SEP) {
int i = strlen(wsd_select_dir);
wsd_select_dir[i] = DIR_SEP;
wsd_select_dir[i+1] = '\0';
}
return wsd_select_dir;
}; };
@ -43,3 +83,117 @@ void gui_sdir_close () {
gui_close (); gui_close ();
}; };
void gui_sdir_clicklist (int nr) {
char fname[LEN_FILENAME];
char *seperate;
d_printf ("selected nr:%d '%s'", nr, nr < wsd_listmax ? wsd_list[nr] : "nr >= wsd_listmax");
if (nr >= wsd_listmax && wsd_list[nr] == NULL) return;
if (strcmp (wsd_list[nr], ".") == 0) return;
if (strcmp (wsd_list[nr], "..") == 0) {
strncpy (fname, GUI_ENTRY_T(wsd_path)->text, LEN_FILENAME);
while (strlen (fname)>1 && fname[strlen (fname) -1] == DIR_SEP)
fname[strlen (fname)-1] = '\0';
if (strlen (fname) > 1) {
seperate = strrchr(fname, DIR_SEP);
if (seperate != NULL) {
seperate[0] = '\0';
}
}
gui_entry_settext (wsd_path, fname);
}
else {
if (GUI_ENTRY_T(wsd_path)->text[strlen (GUI_ENTRY_T(wsd_path)->text)-1] == DIR_SEP)
snprintf (fname, LEN_FILENAME, "%s%s", GUI_ENTRY_T(wsd_path)->text, wsd_list[nr]);
else
snprintf (fname, LEN_FILENAME, "%s%c%s", GUI_ENTRY_T(wsd_path)->text, DIR_SEP, wsd_list[nr]);
gui_entry_settext (wsd_path, fname);
}
gui_sdir_update ();
// wsdir.screen_changed = 1;
// draw ();
};
void gui_sdir_update () {
int cnt;
DIR *dir = NULL;
struct dirent *direntry = NULL;
char fname[LEN_FILENAME];
struct stat stbuf;
/* clear list and reopen directory */
gui_sdir_clear ();
if ((dir = opendir (GUI_ENTRY_T(wsd_path)->text)) == NULL) {
/* if open fails, reopen with ROOT_DIR which is defined in system.h */
gui_entry_settext (wsd_path, ROOT_DIR);
if ((dir = opendir (GUI_ENTRY_T(wsd_path)->text)) == NULL) {
d_printf ("could not open dir for reading. errno:%d '%s'", errno, strerror(errno));
return;
}
}
/* go through the directory but only add directory entries */
cnt = wsd_listmax = 0;
/* need more memory? */
while ((direntry = readdir (dir))) {
if (GUI_ENTRY_T(wsd_path)->text[strlen (GUI_ENTRY_T(wsd_path)->text)-1] == DIR_SEP)
snprintf (fname, LEN_FILENAME, "%s%s", GUI_ENTRY_T(wsd_path)->text, direntry->d_name);
else
snprintf (fname, LEN_FILENAME, "%s%c%s", GUI_ENTRY_T(wsd_path)->text, DIR_SEP, direntry->d_name);
if (stat(fname, &stbuf) == -1) {
d_printf ("could not read stat of file: %s", fname);
continue;
}
if (S_ISDIR(stbuf.st_mode)) {
/* need more memory? */
if (cnt >= wsd_listmax) {
/* save old pointer and counter */
char **tmp = wsd_list;
int i = wsd_listmax-1;
/* allocate new list */
wsd_listmax += 512;
wsd_list = ml_malloc (wsd_listmax * sizeof(void*));
memset (wsd_list, 0x0, wsd_listmax * sizeof(void*));
/* copy list */
if (tmp) {
for (; i >= 0; i--) wsd_list[i] = tmp[i];
ml_free (tmp);
}
/* setup new list */
GUI_LIST_T (wsd_dirlist)->data = wsd_list;
}
wsd_list[cnt] = ml_malloc (LEN_FILENAME);
strncpy (wsd_list[cnt], direntry->d_name, LEN_FILENAME);
d_printf ("added entry:%-3d '%s'", cnt, direntry->d_name);
cnt++;
}
}
closedir (dir);
};
/*
* remove all listentrys and free list
*/
void gui_sdir_clear () {
int i;
if (wsd_list == NULL) return;
for (i = 0; wsd_list[i]; i++) {
if (wsd_list[i]) ml_free (wsd_list[i]);
wsd_list[i] = NULL;
}
};

@ -189,4 +189,6 @@ extern void main_wnd_enable (int enabled);
extern void main_wnd_loop (long long int cur, long long int max); extern void main_wnd_loop (long long int cur, long long int max);
extern void main_wnd_update (); extern void main_wnd_update ();
extern char *gui_sdir_show (char *startpath);
#endif #endif

@ -1114,7 +1114,7 @@ void map_save_all () {
if (map_save_hash (mhash[i]) == 0) DELFLAG(mhash[i]->status, MS_changed); if (map_save_hash (mhash[i]) == 0) DELFLAG(mhash[i]->status, MS_changed);
break; break;
} }
main_wnd_loop (i, mhash_max); main_wnd_update ();
} }
for (i = 0; i < MAP_LSSTAT_MAX; i++) { for (i = 0; i < MAP_LSSTAT_MAX; i++) {

@ -116,6 +116,7 @@ int msdl_eventloop () {
GUIEvent gevent; GUIEvent gevent;
static int oldkey = 0; static int oldkey = 0;
/* only the last MOUSEMOTION event will handled */
while (keeppoll && SDL_PollEvent (&lastevent)) { while (keeppoll && SDL_PollEvent (&lastevent)) {
event = lastevent; event = lastevent;
gotevent = 1; gotevent = 1;
@ -141,24 +142,24 @@ int msdl_eventloop () {
} }
break; break;
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
gevent.mousepos.x = event.motion.x; gevent.scr_mpos.x = event.motion.x;
gevent.mousepos.y = event.motion.y; gevent.scr_mpos.y = event.motion.y;
gevent.mousebtn = 0; gevent.mousebtn = 0;
gevent.event = EGUI_MOUSEMOVE; gevent.event = EGUI_MOUSEMOVE;
gui_event (gevent); gui_event (gevent);
break; break;
case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONDOWN:
gevent.mousepos.x = event.motion.x; gevent.scr_mpos.x = event.motion.x;
gevent.mousepos.y = event.motion.y; gevent.scr_mpos.y = event.motion.y;
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSEPRESSED; gevent.event = EGUI_MOUSEPRESSED;
gui_event (gevent); gui_event (gevent);
break; break;
case SDL_MOUSEBUTTONUP: case SDL_MOUSEBUTTONUP:
gevent.mousepos.x = event.motion.x; gevent.scr_mpos.x = event.motion.x;
gevent.mousepos.y = event.motion.y; gevent.scr_mpos.y = event.motion.y;
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSERELEASED; gevent.event = EGUI_MOUSERELEASED;
gui_event (gevent); gui_event (gevent);
@ -171,8 +172,8 @@ int msdl_eventloop () {
keyu = oldkey = event.key.keysym.unicode; keyu = oldkey = event.key.keysym.unicode;
gevent.keyval = keyu; gevent.keyval = keyu;
gevent.event = EGUI_KEYCHAR; gevent.event = EGUI_KEYCHAR;
gevent.mousepos.x = -1; gevent.scr_mpos.x = -1;
gevent.mousepos.y = -1; gevent.scr_mpos.y = -1;
if (gui_event (gevent) != 0) draw(); if (gui_event (gevent) != 0) draw();
} }
} break; } break;
@ -251,7 +252,6 @@ int msdl_eventloop () {
*/ */
int main (int argc, char **argv) { int main (int argc, char **argv) {
SDL_Surface *scr; SDL_Surface *scr;
@ -287,10 +287,8 @@ int main (int argc, char **argv) {
} }
void main_wnd_loop (long long int cur, long long int max) {
}
void main_wnd_update () { void main_wnd_update () {
// d_printf ("main_wnd_update");
while (msdl_eventloop ());
} }

@ -157,7 +157,7 @@ void gfx_draw_line (struct image *dimg, int x1, int y1, int x2, int y2, struct l
/* /*
* draw polygon * draw polygon
*/ */
void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_style style, struct color c) { void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_style style, struct color *c) {
static POINT *polygon = NULL; static POINT *polygon = NULL;
static int polygon_cnt = 0; static int polygon_cnt = 0;
int i; int i;
@ -179,8 +179,8 @@ void gfx_draw_polygon (struct image *dimg, iPoint *p, int pcnt, struct line_styl
polygon[i].y = p[i].y; polygon[i].y = p[i].y;
} }
tmp_brush = SelectObject (dimg->hdc, c.brush); tmp_brush = SelectObject (dimg->hdc, c->brush);
tmp_pen = SelectObject (dimg->hdc, c.pen); tmp_pen = SelectObject (dimg->hdc, c->pen);
Polygon (dimg->hdc, polygon, pcnt); Polygon (dimg->hdc, polygon, pcnt);
SelectObject (dimg->hdc, tmp_brush); SelectObject (dimg->hdc, tmp_brush);
SelectObject (dimg->hdc, tmp_pen); SelectObject (dimg->hdc, tmp_pen);

@ -389,8 +389,8 @@ LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONUP: case WM_LBUTTONUP:
x = (lParam & 0xFFFF); x = (lParam & 0xFFFF);
y = (lParam >> 16); y = (lParam >> 16);
gevent.mousepos.x = x; gevent.scr_mpos.x = x;
gevent.mousepos.y = y; gevent.scr_mpos.y = y;
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSERELEASED; gevent.event = EGUI_MOUSERELEASED;
if (gui_event (gevent) == 0) draw_mousebtnup (x, y, 1); if (gui_event (gevent) == 0) draw_mousebtnup (x, y, 1);
@ -398,8 +398,8 @@ LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
x = (lParam & 0xFFFF); x = (lParam & 0xFFFF);
y = (lParam >> 16); y = (lParam >> 16);
gevent.mousepos.x = x; gevent.scr_mpos.x = x;
gevent.mousepos.y = y; gevent.scr_mpos.y = y;
gevent.mousebtn = 1; gevent.mousebtn = 1;
gevent.event = EGUI_MOUSEPRESSED; gevent.event = EGUI_MOUSEPRESSED;
if (gui_event (gevent) == 0) draw_mousebtndown (x, y, 1); if (gui_event (gevent) == 0) draw_mousebtndown (x, y, 1);
@ -407,8 +407,8 @@ LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_MOUSEMOVE: case WM_MOUSEMOVE:
x = (lParam & 0xFFFF); x = (lParam & 0xFFFF);
y = (lParam >> 16); y = (lParam >> 16);
gevent.mousepos.x = x; gevent.scr_mpos.x = x;
gevent.mousepos.y = y; gevent.scr_mpos.y = y;
gevent.mousebtn = 0; gevent.mousebtn = 0;
gevent.event = EGUI_MOUSEMOVE; gevent.event = EGUI_MOUSEMOVE;
gui_event (gevent); gui_event (gevent);
@ -417,7 +417,7 @@ LRESULT CALLBACK WndProcedure(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
case WM_CHAR: case WM_CHAR:
if (wParam < ' ') gevent.keyval = 0xff00 | wParam; if (wParam < ' ') gevent.keyval = 0xff00 | wParam;
else gevent.keyval = wParam; else gevent.keyval = wParam;
gevent.event = EGUI_KEYRELEASED; gevent.event = EGUI_KEYCHAR;
d_printf ("char wParam:%x keyval:%x", wParam, gevent.keyval); d_printf ("char wParam:%x keyval:%x", wParam, gevent.keyval);
if (gui_event (gevent) != 0) draw(); if (gui_event (gevent) != 0) draw();
break; break;
@ -455,12 +455,12 @@ void DoMenuActions(HWND hWnd, INT id) {
{ {
char *fn; char *fn;
// wince_taskbar (hWnd, TRUE); // wince_taskbar (hWnd, TRUE);
fn = select_dir_dialog ("MapData", cfg.datapath); fn = select_dir_dialog ("MapData", cfg.mappath);
// wince_taskbar (hWnd, FALSE); // wince_taskbar (hWnd, FALSE);
if (fn) { if (fn) {
d_printf ("config: changed data path from '%s' to '%s'.", cfg.datapath, fn); d_printf ("config: changed data path from '%s' to '%s'.", cfg.mappath, fn);
map_clear(); map_clear();
strncpy (cfg.datapath, fn, LEN_FILENAME); strncpy (cfg.mappath, fn, LEN_FILENAME);
map_clear(); map_clear();
draw_redrawmap (); draw_redrawmap ();
} }

Loading…
Cancel
Save