You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
spOSMroute/main/gui_config.c

92 lines
2.8 KiB

/* %Id: Exp $ */
/***************************************************************************
* gui_config.c
*
* Copyright (C) 2013 Steffen Pohle
* steffen@gulpe.de
****************************************************************************/
/*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* main.c is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "osmroute.h"
#include "draw.h"
#include "gui.h"
#include "system.h"
void gui_config_close ();
void gui_config_seldir ();
void gui_config_gpsfile ();
GUIWindow wcfg = {0};
GUIItem *map_path = NULL;
GUIItem *map_seldir = NULL;
GUIItem *gps_device = NULL;
GUIItem *gps_list = NULL;
GUIItem *gps_file = NULL;
GUIItem *wcfg_close = NULL;
GUIItem *label1 = NULL;
GUIItem *label2 = NULL;
void gui_config_show () {
if (wcfg.screen == NULL) gui_window_new (&wcfg, 220, 240, _("Config"));
wcfg.screen_changed = 1;
wcfg.style = WGUI_S_VCENTER | WGUI_S_HCENTER;
gui_show (&wcfg);
if (label1 == NULL) label1 = gui_label_new (_("mapdata path:"), 5, 20);
gui_window_item_add (&wcfg, label1);
if (map_path == NULL) map_path = gui_entry_new (cfg.mappath, 10, 36, 150, 20);
gui_window_item_add (&wcfg, map_path);
if (map_seldir == NULL) map_seldir = gui_button_new (_("Browse"), 170, 36, 40, 20);
GUI_BUTTON_T (map_seldir)->callback_clicked = gui_config_seldir;
gui_window_item_add (&wcfg, map_seldir);
if (label2 == NULL) label2 = gui_label_new (_("gps device:"), 5, 66);
gui_window_item_add (&wcfg, label2);
if (gps_device == NULL) gps_device = gui_entry_new (cfg.gps_device, 10, 82, 150, 20);
gui_window_item_add (&wcfg, gps_device);
if (gps_list == NULL) gps_list = gui_list_new (10, 112, 150, 60);
gui_window_item_add (&wcfg, gps_list);
if (gps_file == NULL) gps_file = gui_button_new (_("File"), 170, 112, 40, 20);
GUI_BUTTON_T (gps_file)->callback_clicked = gui_config_gpsfile;
gui_window_item_add (&wcfg, gps_file);
if (wcfg_close == NULL) wcfg_close = gui_button_new (_("Close"), 5, wcfg.h-25, wcfg.w-10, 20);
GUI_BUTTON_T (wcfg_close)->callback_clicked = gui_config_close;
gui_window_item_add (&wcfg, wcfg_close);
};
void gui_config_close () {
gui_close ();
};
void gui_config_seldir () {
d_printf ("select dir...");
};
void gui_config_gpsfile () {
d_printf ("select gps file...");
};