From 86ef5ffb33987a056474a126f45f9b3a61400abb Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 16 Feb 2013 20:28:54 +0000 Subject: [PATCH] update.. --- gui/gui.c | 2 +- gui/gui.h | 41 ++++++++++++++++------------------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/gui/gui.c b/gui/gui.c index 83dd9e1..de6782d 100644 --- a/gui/gui.c +++ b/gui/gui.c @@ -1,4 +1,4 @@ -/* $id: Exp $ */ +/* $Id: gui.c,v 1.3 2013/02/16 20:29:16 steffen Exp $ */ /*************************************************************************** * gui.c * diff --git a/gui/gui.h b/gui/gui.h index 882519c..5bc8402 100644 --- a/gui/gui.h +++ b/gui/gui.h @@ -28,6 +28,7 @@ #include "osmroute.h" #define GUI_TEXTLEN 256 +#define GUI_MAX_ITEM 256 enum { EGUI_NONE, @@ -38,6 +39,14 @@ enum { EGUI_MOUSERELEASED }; +enum { + GUI_NONE, + GUI_BUTTON, + GUI_LIST, + GUI_ENTRY, + GUI_CHECKBOX, + GUI_LABEL +}; /* * styles for the windows.. @@ -109,22 +118,10 @@ struct { } typedef GUICheckbox; -#define GUI_WIN_BUTTONS 16 -#define GUI_WIN_ENTRYS 8 -#define GUI_WIN_LABELS 16 -#define GUI_WIN_CHECKBOXES 16 -#define GUI_WIN_LISTS 4 -#define GUI_WIN_ELEMENTS 32 - -enum { - GUINONE, - GUIBUTTON, - GUILIST, - GUIENTRY, - GUICHECKBOX, - GUILABEL -}; - +struct _GUIItem_ { + int type; + void *item; +} typedef GUIItem; struct _GUIWindow_ { void (*callback_close) (); @@ -140,14 +137,8 @@ struct _GUIWindow_ { int h; int style; - GUIButton buttons[GUI_WIN_BUTTONS]; - GUIEntry entrys[GUI_WIN_ENTRYS]; - GUICheckbox checkboxes[GUI_WIN_CHECKBOXES]; - GUILabel labels[GUI_WIN_LABELS]; - GUIList lists[GUI_WIN_LISTS]; - - void *focus; // element which holds the focus - + GUIItem items[GUI_MAX_ITEM]; + void *focus; } typedef GUIWindow; extern GUIWindow *currentwin; @@ -157,7 +148,7 @@ extern void gui_draw (); extern void gui_close (); extern int gui_event (GUIEvent event); -extern void guiwindow_new (GUIWindow *win, int w, int h); +extern void guiwindow_new (GUIWindow *win, int w, int h, char *title); extern void guiwindow_close (GUIWindow *win); /* button functions */