master
steffen 13 years ago
parent 87e6a631eb
commit 0da7441a73

@ -1,4 +1,4 @@
/* $Id: gui.c,v 1.9 2013/02/24 12:42:14 steffen Exp $ */
/* $Id: gui.c,v 1.10 2013/02/24 20:33:42 steffen Exp $ */
/***************************************************************************
* gui.c
*
@ -156,9 +156,9 @@ int gui_event (GUIEvent event) {
case (GUI_BUTTON): {
GUIButton *button = (GUIButton *) currentwin->items[i].item;
if (GUI_ITEM_IS_INSIDE (button, winpos)) {
// d_printf ("button: %d,%d,%d,%d pos:%d,%d event:%d,%d ",
// button->x, button->y, button->w, button->h, winpos.x, winpos.y, event.mousepos.x, event.mousepos.y);
gui_button_event (button, event);
d_printf ("button: %d,%d,%d,%d pos:%d,%d event:%d,%d ",
button->x, button->y, button->w, button->h, winpos.x, winpos.y, event.mousepos.x, event.mousepos.y);
gui_button_event (button, &event);
event_called = 0;
return 1;
}
@ -171,7 +171,7 @@ int gui_event (GUIEvent event) {
case (GUI_ENTRY): {
GUIEntry *entry = (GUIEntry*) currentwin->items[i].item;
if (GUI_ITEM_IS_INSIDE (entry, winpos)) {
// d_printf ("entry..");
d_printf ("entry event type: %d", event.event);
gui_entry_event (entry, &event);
event_called = 0;
return 1;
@ -182,7 +182,7 @@ int gui_event (GUIEvent event) {
case (GUI_LIST): {
GUIList *list = (GUIList *) currentwin->items[i].item;
if (GUI_ITEM_IS_INSIDE (list, winpos)) {
// d_printf ("list..");
d_printf ("list..");
gui_list_event (list, &event);
event_called = 0;
return 1;
@ -192,7 +192,7 @@ int gui_event (GUIEvent event) {
}
if (currentwin->focus) {
// d_printf ("focus..");
d_printf ("focus..");
switch (currentwin->focus->type) {
case (GUI_ENTRY):
gui_entry_event ((GUIEntry*)currentwin->focus->item, &event);

@ -149,6 +149,7 @@ extern void gui_window_item_add (GUIWindow *win, int type, void *item);
/* button functions */
extern void gui_button_draw (GUIButton *button);
extern void gui_button_event (GUIButton *entry, GUIEvent *event);
extern GUIButton *gui_button_new (char *name, int x, int y, int w, int h);
/* label functions */

@ -1,4 +1,4 @@
/* $Id: gui_button.c,v 1.3 2013/02/24 00:39:59 steffen Exp $ */
/* $Id: gui_button.c,v 1.4 2013/02/24 20:33:42 steffen Exp $ */
/***************************************************************************
* gui_button.c
*
@ -66,9 +66,9 @@ GUIButton *gui_button_new (char *caption, int x, int y, int w, int h) {
};
void gui_button_event (GUIButton *button, GUIEvent event) {
if (button->callback_clicked != NULL && event.event == EGUI_MOUSEPRESSED) {
button->callback_clicked (event.mousepos.x-button->x, event.mousepos.y-button->y);
void gui_button_event (GUIButton *button, GUIEvent *event) {
if (button->callback_clicked != NULL && event->event == EGUI_MOUSEPRESSED) {
button->callback_clicked (event->mousepos.x-button->x, event->mousepos.y-button->y);
}
};

@ -1,4 +1,4 @@
/* $Id: gui_entry.c,v 1.2 2013/02/21 23:07:19 steffen Exp $ */
/* $Id: gui_entry.c,v 1.3 2013/02/24 20:33:42 steffen Exp $ */
/***************************************************************************
* gui_entry.c
*
@ -37,7 +37,7 @@ void gui_entry_draw (GUIEntry *entry) {
struct line_style ls;
ls.width = 1.0;
if (currentwin->focus == entry)
if (currentwin->focus == (void*) entry)
ls.c = ls.borderc = color[COLOR_white][3];
else
ls.c = ls.borderc = color[COLOR_white][2];

@ -30,11 +30,23 @@ void gui_config_close ();
GUIWindow wcfg = {0};
GUIEntry *map_path = NULL;
GUIButton *map_seldir = NULL;
GUIEntry *gps_device = NULL;
GUIList *gps_list = NULL;
GUIButton *gps_file = NULL;
GUIButton *wcfg_close = NULL;
void gui_config_show () {
if (wcfg.screen == NULL) gui_window_new (&wcfg, 220, 240, _("Config"));
wcfg.callback_close = (void*)gui_config_close;
wcfg.screen_changed = 1;
wcfg.style = WGUI_S_VCENTER | WGUI_S_HCENTER;
gui_show (&wcfg);
if (map_path == NULL) map_path = gui_entry_new (NULL, 5, 30, 155, 20);
gui_window_item_add (&wcfg, GUI_ENTRY, map_path);
};

@ -1,4 +1,4 @@
/* $Id: gui_mainmenu.c,v 1.7 2013/02/24 15:25:57 steffen Exp $ */
/* $Id: gui_mainmenu.c,v 1.8 2013/02/24 20:33:42 steffen Exp $ */
/***************************************************************************
* gui_mainmenu.c
*
@ -109,6 +109,8 @@ void gui_mainmenu_routing () {
void gui_mainmenu_config () {
gui_close ();
gui_config_show ();
};

Loading…
Cancel
Save