|
|
|
@ -1,4 +1,4 @@
|
|
|
|
/* $Id: gui.c,v 1.17 2013/03/06 23:27:25 steffen Exp $ */
|
|
|
|
/* $Id: gui.c,v 1.18 2013/03/07 23:09:33 steffen Exp $ */
|
|
|
|
/***************************************************************************
|
|
|
|
/***************************************************************************
|
|
|
|
* gui.c
|
|
|
|
* gui.c
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@ -112,8 +112,8 @@ void gui_draw () {
|
|
|
|
case (GUI_LIST):
|
|
|
|
case (GUI_LIST):
|
|
|
|
gui_list_draw (currentwin->items[i]);
|
|
|
|
gui_list_draw (currentwin->items[i]);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
// case (GUI_ENTRY):
|
|
|
|
// case (GUI_UNKNOWN):
|
|
|
|
// gui_entry_draw ((GUIEntry*)currentwin->items[i].item);
|
|
|
|
// gui_UNKNOWN_draw ((GUIEntry*)currentwin->items[i].item);
|
|
|
|
// break;
|
|
|
|
// break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
@ -122,15 +122,40 @@ void gui_draw () {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (currentwin) {
|
|
|
|
if (currentwin) {
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VCENTER) currentwin->x = gfx_screensize.x/2 - currentwin->w/2;
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VCENTER)
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VLEFT) currentwin->x = 0;
|
|
|
|
currentwin->x = gfx_screensize.x/2 - currentwin->w/2;
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VRIGHT) currentwin->x = gfx_screensize.x - currentwin->w;
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VLEFT)
|
|
|
|
|
|
|
|
currentwin->x = 0;
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HCENTER) currentwin->y = gfx_screensize.y/2 - currentwin->h/2;
|
|
|
|
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VRIGHT)
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HTOP) currentwin->y = 0;
|
|
|
|
currentwin->x = gfx_screensize.x - currentwin->w;
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HBOTTOM) currentwin->y = gfx_screensize.y - currentwin->h;
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HCENTER)
|
|
|
|
|
|
|
|
currentwin->y = gfx_screensize.y/2 - currentwin->h/2;
|
|
|
|
gfx_draw_img (NULL, currentwin->x, currentwin->y, currentwin->w, currentwin->h, currentwin->screen, 0, 0);
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HTOP)
|
|
|
|
|
|
|
|
currentwin->y = 0;
|
|
|
|
|
|
|
|
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HBOTTOM)
|
|
|
|
|
|
|
|
currentwin->y = gfx_screensize.y - currentwin->h;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* draw the windows or just the part of the entry which is focused
|
|
|
|
|
|
|
|
* and draw the softkeyb
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
if (currentwin->focus && softkeyb && softkeyb->enabled) {
|
|
|
|
|
|
|
|
int ys, yh;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* drawing and display softkeyb */
|
|
|
|
|
|
|
|
gui_softkeyb_draw ();
|
|
|
|
|
|
|
|
gfx_draw_img (NULL,
|
|
|
|
|
|
|
|
(gfx_screensize.x-softkeyb->screen->width)/2,
|
|
|
|
|
|
|
|
gfx_screensize.y-softkeyb->screen->height,
|
|
|
|
|
|
|
|
softkeyb->screen->width, softkeyb->screen->height, softkeyb->screen, 0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* drawing part of the screen where the entry element is set up.. */
|
|
|
|
|
|
|
|
ys = currentwin->focus->y;
|
|
|
|
|
|
|
|
yh = gfx_screensize.y-softkeyb->screen->height;
|
|
|
|
|
|
|
|
currentwin->y = -ys;
|
|
|
|
|
|
|
|
if ((currentwin->h - currentwin->focus->y) < yh) yh = currentwin->h - currentwin->focus->y;
|
|
|
|
|
|
|
|
gfx_draw_img (NULL, currentwin->x, 0, currentwin->w, yh, currentwin->screen, 0, ys);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else gfx_draw_img (NULL, currentwin->x, currentwin->y, currentwin->w, currentwin->h, currentwin->screen, 0, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@ -215,4 +240,4 @@ void gui_set_focus (GUIItem *item) {
|
|
|
|
if (item == NULL || item->type != GUI_ENTRY) gui_softkeyb_show (FALSE);
|
|
|
|
if (item == NULL || item->type != GUI_ENTRY) gui_softkeyb_show (FALSE);
|
|
|
|
currentwin->focus = item;
|
|
|
|
currentwin->focus = item;
|
|
|
|
currentwin->screen_changed = 1;
|
|
|
|
currentwin->screen_changed = 1;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|