From fecfe775c2874891f72869bd16a61136110e032c Mon Sep 17 00:00:00 2001 From: steffen Date: Sat, 16 Feb 2013 20:28:54 +0000 Subject: [PATCH] update.. --- gui/gui.c | 37 ++++++------------------------------- 1 file changed, 6 insertions(+), 31 deletions(-) diff --git a/gui/gui.c b/gui/gui.c index 56de30b..83dd9e1 100644 --- a/gui/gui.c +++ b/gui/gui.c @@ -1,3 +1,4 @@ +/* $id: Exp $ */ /*************************************************************************** * gui.c * @@ -201,41 +202,15 @@ int gui_event (GUIEvent event) { /*************************************************************************** * basic windows functions ***************************************************************************/ -void guiwindow_new (GUIWindow *win, int w, int h) { +void guiwindow_new (GUIWindow *win, int w, int h, char *title) { int i; - for (i = 0; i < GUI_WIN_BUTTONS; i++) { - win->buttons[i].caption[0] = '\0'; - win->buttons[i].id = 0; - win->buttons[i].col = &color[COLOR_white][2]; - win->buttons[i].textcol = &color[COLOR_white][3]; - win->buttons[i].callback_clicked = NULL; - win->buttons[i].callback_draw = NULL; - } - for (i = 0; i < GUI_WIN_LABELS; i++) { - win->labels[i].text[0] = '\0'; - win->labels[i].textcol = &color[COLOR_white][2]; - win->labels[i].id = 0; - } - for (i = 0; i < GUI_WIN_LISTS; i++) { - win->lists[i].id = 0; - win->lists[i].selected = -1; - win->lists[i].callback_selectitem = NULL; - } - for (i = 0; i < GUI_WIN_ENTRYS; i++) { - win->entrys[i].text[0] = '\0'; - win->entrys[i].callback_enter = NULL; - win->entrys[i].callback_changed = NULL; - win->entrys[i].id = 0; - } - for (i = 0; i < GUI_WIN_CHECKBOXES; i++) { - win->checkboxes[i].text[0] = '\0'; - win->checkboxes[i].callback_changed = NULL; - win->checkboxes[i].id = 0; - win->labels[i].text[0] = '\0'; + for (i = 0; i < GUI_MAX_ITEM; i++) { + win->items[i]->item = NULL; + win->items[i]->type = GUI_NONE; } - win->title[0] = 0; + strncpy (win->title, title, GUI_TEXTLEN); win->screen = NULL; win->screen_changed = 1;