softkeyboard events..

master
steffen 13 years ago
parent 1529314588
commit a28bbd52a1

@ -170,12 +170,13 @@ extern void gui_window_item_add (GUIWindow *win, GUIItem *item);
/* softkeyboard functions. */
extern void gui_softkeyb_show (int enable);
extern int gui_softkeyb_event (GUIEvent event);
extern void gui_softkeyb_draw ();
/* button functions */
#define GUI_BUTTON_T(_item_) ((GUIButton*)(_item_)->data)
extern void gui_button_draw (GUIItem *item);
extern void gui_button_event (GUIItem *item, GUIEvent *event);
extern int gui_button_event (GUIItem *item, GUIEvent *event);
extern GUIItem *gui_button_new (char *name, int x, int y, int w, int h);
/* label functions */
@ -186,13 +187,13 @@ extern GUIItem *gui_label_new (char *text, int x, int y);
/* entry functions */
#define GUI_ENTRY_T(_item_) ((GUIEntry*)(_item_)->data)
extern void gui_entry_draw (GUIItem *item);
extern void gui_entry_event (GUIItem *item, GUIEvent *event);
extern int gui_entry_event (GUIItem *item, GUIEvent *event);
extern GUIItem *gui_entry_new (char *text, int x, int y, int w, int h);
/* list functions */
#define GUI_LIST_T(_item_) ((GUIList*)(_item_)->data)
extern void gui_list_draw (GUIItem *item);
extern void gui_list_event (GUIItem *item, GUIEvent *event);
extern int gui_list_event (GUIItem *item, GUIEvent *event);
extern void gui_list_setselect (GUIItem *item);
extern GUIItem *gui_list_new (int x, int y, int w, int h);

@ -1,4 +1,4 @@
/* $Id: gui_button.c,v 1.7 2013/03/06 23:27:25 steffen Exp $ */
/* $Id: gui_button.c,v 1.8 2013/03/10 00:09:40 steffen Exp $ */
/***************************************************************************
* gui_button.c
*
@ -78,7 +78,7 @@ GUIItem *gui_button_new (char *caption, int x, int y, int w, int h) {
};
void gui_button_event (GUIItem *item, GUIEvent *event) {
int gui_button_event (GUIItem *item, GUIEvent *event) {
GUIButton *button = NULL;
if (item == NULL || item->type != GUI_BUTTON) {
@ -91,5 +91,7 @@ void gui_button_event (GUIItem *item, GUIEvent *event) {
gui_set_focus (item);
button->callback_clicked (event->mousepos.x-item->x, event->mousepos.y-item->y);
}
return 1;
};

@ -1,4 +1,4 @@
/* $Id: gui_entry.c,v 1.10 2013/03/06 23:27:25 steffen Exp $ */
/* $Id: gui_entry.c,v 1.11 2013/03/10 00:09:40 steffen Exp $ */
/***************************************************************************
* gui_entry.c
*
@ -70,7 +70,7 @@ void gui_entry_draw (GUIItem *item) {
/*
* event handling
*/
void gui_entry_event (GUIItem *item, GUIEvent *event) {
int gui_entry_event (GUIItem *item, GUIEvent *event) {
char text1[GUI_TEXTLEN];
char text2[GUI_TEXTLEN];
GUIEntry *entry = NULL;
@ -123,7 +123,7 @@ void gui_entry_event (GUIItem *item, GUIEvent *event) {
}
}
currentwin->screen_changed = 1;
return;
return 1;
};

@ -1,4 +1,4 @@
/* $Id: gui_list.c,v 1.6 2013/03/06 23:27:25 steffen Exp $ */
/* $Id: gui_list.c,v 1.7 2013/03/10 00:09:40 steffen Exp $ */
/***************************************************************************
* gui_list.c
*
@ -80,13 +80,13 @@ void gui_list_draw (GUIItem *item) {
/*
* event handling
*/
void gui_list_event (GUIItem *item, GUIEvent *event) {
int gui_list_event (GUIItem *item, GUIEvent *event) {
int x = event->mousepos.x - item->x;
int y = event->mousepos.y - item->y;
int i;
GUIList *list = NULL;
if (item == NULL) return;
if (item == NULL) return 0;
else list = (GUIList *) item->data;
/* set focus */
@ -104,6 +104,8 @@ void gui_list_event (GUIItem *item, GUIEvent *event) {
}
currentwin->screen_changed = 1;
draw ();
return 1;
};

@ -1,4 +1,4 @@
/* $Id: gui_softkeyboard.c,v 1.2 2013/03/09 00:02:30 steffen Exp $ */
/* $Id: gui_softkeyboard.c,v 1.3 2013/03/10 00:09:40 steffen Exp $ */
/***************************************************************************
* gui_softkeyboard.c
*
@ -119,3 +119,8 @@ void gui_softkeyb_draw () {
/* draw the last keys */
};
int gui_softkeyb_event (GUIEvent event) {
return 0;
};

Loading…
Cancel
Save