|
|
|
@ -26,14 +26,13 @@
|
|
|
|
#include "gui.h"
|
|
|
|
#include "gui.h"
|
|
|
|
#include "system.h"
|
|
|
|
#include "system.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define SEARCH_MAXRESULT 32
|
|
|
|
#define SEARCH_MAXRESULT 32
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_close ();
|
|
|
|
void gui_search_close ();
|
|
|
|
void gui_search_refresh ();
|
|
|
|
void gui_search_refresh ();
|
|
|
|
void gui_search_next ();
|
|
|
|
void gui_search_next ();
|
|
|
|
void gui_search_prev ();
|
|
|
|
void gui_search_prev ();
|
|
|
|
void gui_search_search ();
|
|
|
|
void gui_search_city ();
|
|
|
|
void gui_search_switch (int pos);
|
|
|
|
void gui_search_switch (int pos);
|
|
|
|
|
|
|
|
|
|
|
|
struct map_search_data search_data[SEARCH_MAXRESULT];
|
|
|
|
struct map_search_data search_data[SEARCH_MAXRESULT];
|
|
|
|
@ -41,50 +40,64 @@ int search_data_cnt = 0;
|
|
|
|
int search_data_cur = -1;
|
|
|
|
int search_data_cur = -1;
|
|
|
|
static GUIWindow wsearch = {0};
|
|
|
|
static GUIWindow wsearch = {0};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GUIItem *ws_entryname = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_labelname = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_entrystreet = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_labelstreet = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_btnok = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_btncancel = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_list = NULL;
|
|
|
|
|
|
|
|
GUIItem *ws_map = NULL; /* need to finish working on: gui_images and map_view */
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_show () {
|
|
|
|
void gui_search_show () {
|
|
|
|
if (wsearch.screen == NULL) gui_window_new (&wsearch, 220, 60, _("Search.."));
|
|
|
|
if (wsearch.screen == NULL) gui_window_new (&wsearch, 220, 260, _("Search.."));
|
|
|
|
wsearch.screen_changed = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// wmmenu.callback_close = (void*)gui_mainmenu_closecallback;
|
|
|
|
|
|
|
|
wsearch.screen_changed = 1;
|
|
|
|
wsearch.screen_changed = 1;
|
|
|
|
wsearch.style = WGUI_S_VCENTER | WGUI_S_HTOP;
|
|
|
|
wsearch.style = WGUI_S_VCENTER | WGUI_S_HCENTER;
|
|
|
|
wsearch.title[0] = 0;
|
|
|
|
wsearch.title[0] = 0;
|
|
|
|
|
|
|
|
|
|
|
|
gui_show (&wsearch);
|
|
|
|
/* Name Ok Button */
|
|
|
|
};
|
|
|
|
if (ws_labelname == NULL) ws_labelname = gui_label_new (_("City:"), 5, 10);
|
|
|
|
|
|
|
|
gui_window_item_add (&wsearch, ws_labelname);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ws_entryname == NULL) ws_entryname = gui_entry_new (_(""), 50, 10, 100, 20);
|
|
|
|
|
|
|
|
gui_window_item_add (&wsearch, ws_entryname);
|
|
|
|
|
|
|
|
GUI_ENTRY_T (ws_entryname)->callback_enter = gui_search_city;
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_close () {
|
|
|
|
if (ws_btnok == NULL) ws_btnok = gui_button_new (_("Ok"), 165, 5, 50, 20);
|
|
|
|
gui_close ();
|
|
|
|
GUI_BUTTON_T (ws_btnok)->callback_clicked = (void*) gui_search_close;
|
|
|
|
};
|
|
|
|
gui_window_item_add (&wsearch, ws_btnok);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* street Cancel Button */
|
|
|
|
|
|
|
|
if (ws_labelstreet == NULL) ws_labelstreet = gui_label_new (_("Street:"), 5, 35);
|
|
|
|
|
|
|
|
gui_window_item_add (&wsearch, ws_labelstreet);
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_refresh () {
|
|
|
|
if (ws_entrystreet == NULL) ws_entrystreet = gui_entry_new (_(""), 50, 30, 100, 20);
|
|
|
|
map_refresh (view_lon, view_lat);
|
|
|
|
gui_window_item_add (&wsearch, ws_entrystreet);
|
|
|
|
draw_redrawmap ();
|
|
|
|
|
|
|
|
draw ();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (ws_btncancel == NULL) ws_btncancel = gui_button_new (_("Cancel"), 165, 30, 50, 20);
|
|
|
|
|
|
|
|
GUI_BUTTON_T (ws_btncancel)->callback_clicked = (void*) gui_search_close;
|
|
|
|
|
|
|
|
gui_window_item_add (&wsearch, ws_btncancel);
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_prev () {
|
|
|
|
/* result list */
|
|
|
|
d_printf ("search_data_cur:%d", search_data_cur);
|
|
|
|
if (ws_list == NULL) ws_list = gui_list_new (5, 55, 210, 100);
|
|
|
|
gui_search_switch (search_data_cur-1);
|
|
|
|
gui_window_item_add (&wsearch, ws_list);
|
|
|
|
d_printf ("search_data_cur:%d", search_data_cur);
|
|
|
|
|
|
|
|
|
|
|
|
gui_show (&wsearch);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_next () {
|
|
|
|
void gui_search_close () {
|
|
|
|
d_printf ("search_data_cur:%d", search_data_cur);
|
|
|
|
gui_close ();
|
|
|
|
gui_search_switch (search_data_cur+1);
|
|
|
|
|
|
|
|
d_printf ("search_data_cur:%d", search_data_cur);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void gui_search_search () {
|
|
|
|
void gui_search_city () {
|
|
|
|
char text[] = "ttttt...";
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char text[] = "gui_search_city";
|
|
|
|
search_data_cnt = map_search (text, search_data, SEARCH_MAXRESULT);
|
|
|
|
search_data_cnt = map_search (text, search_data, SEARCH_MAXRESULT);
|
|
|
|
gui_search_switch (0);
|
|
|
|
for (i = 0; i < search_data_cnt; i++)
|
|
|
|
|
|
|
|
d_printf (" %-3d:%s",i , search_data->name[i]);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|