softkey first steps..

master
steffen 13 years ago
parent e752a97d6d
commit b0143e2a8c

@ -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
*
@ -112,8 +112,8 @@ void gui_draw () {
case (GUI_LIST):
gui_list_draw (currentwin->items[i]);
break;
// case (GUI_ENTRY):
// gui_entry_draw ((GUIEntry*)currentwin->items[i].item);
// case (GUI_UNKNOWN):
// gui_UNKNOWN_draw ((GUIEntry*)currentwin->items[i].item);
// break;
default:
break;
@ -122,15 +122,40 @@ void gui_draw () {
}
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_VLEFT) currentwin->x = 0;
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VRIGHT) currentwin->x = gfx_screensize.x - currentwin->w;
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HCENTER) currentwin->y = gfx_screensize.y/2 - currentwin->h/2;
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;
gfx_draw_img (NULL, currentwin->x, currentwin->y, currentwin->w, currentwin->h, currentwin->screen, 0, 0);
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_VLEFT)
currentwin->x = 0;
if ((currentwin->style & WGUI_S_VCENTER) == WGUI_S_VRIGHT)
currentwin->x = gfx_screensize.x - currentwin->w;
if ((currentwin->style & WGUI_S_HCENTER) == WGUI_S_HCENTER)
currentwin->y = gfx_screensize.y/2 - currentwin->h/2;
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);
currentwin->focus = item;
currentwin->screen_changed = 1;
};
};

@ -167,8 +167,8 @@ extern void gui_window_close (GUIWindow *win);
extern void gui_window_item_add (GUIWindow *win, GUIItem *item);
/* softkeyboard functions. */
void gui_softkeyb_show (int enable);
extern void gui_softkeyb_show (int enable);
extern void gui_softkeyb_draw ();
/* button functions */
#define GUI_BUTTON_T(_item_) ((GUIButton*)(_item_)->data)

@ -42,16 +42,26 @@
#include <stdio.h>
#include <string.h>
#ifdef HAVE_SDL
#ifndef FALSE
#define FALSE 0
#endif
#ifndef TRUE
#define TRUE 1
#endif
/* #ifdef HAVE_SDL
#include <SDL.h>
#define FALSE 0
#define TRUE 1
#endif
#ifdef ANDROID
#define FALSE 0
#define TRUE 1
#endif
*/
/*
* Standard gettext macros.

Loading…
Cancel
Save