/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_text_button(fbtk_widget_t *parent, int x, int y, int width, int height, colour bg, colour fg, fbtk_callback click, void *pw) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_TEXT, x, y, width, height); neww->fg = fg; neww->bg = bg; neww->mapped = true; neww->u.text.outline = true; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_text_button, NULL); fbtk_set_handler(neww, FBTK_CBT_CLICK, click, pw); fbtk_set_handler(neww, FBTK_CBT_POINTERENTER, fbtk_set_ptr, &hand_image); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_button(fbtk_widget_t *parent, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image, fbtk_callback click, void *pw) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_BITMAP, x, y, width, height); neww->bg = c; neww->mapped = true; neww->u.bitmap.bitmap = image; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_bitmap, NULL); fbtk_set_handler(neww, FBTK_CBT_CLICK, click, pw); fbtk_set_handler(neww, FBTK_CBT_POINTERENTER, fbtk_set_ptr, &null_image); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_writable_text(fbtk_widget_t *parent, int x, int y, int width, int height, colour bg, colour fg, bool outline, fbtk_enter_t enter, void *pw) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_TEXT, x, y, width, height); neww->fg = fg; neww->bg = bg; neww->mapped = true; neww->u.text.outline = outline; neww->u.text.enter = enter; neww->u.text.pw = pw; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_text, NULL); fbtk_set_handler(neww, FBTK_CBT_INPUT, text_input, neww); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_vscroll(fbtk_widget_t *parent, int x, int y, int width, int height, colour fg, colour bg, fbtk_callback callback, void *context) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_VSCROLL, x, y + scrollu.height, width, height - scrollu.height - scrolld.height); neww->fg = fg; neww->bg = bg; neww->mapped = true; fbtk_set_handler(neww, FBTK_CBT_REDRAW, vscroll_redraw, NULL); fbtk_set_handler(neww, FBTK_CBT_CLICK, vscrollarea_click, neww); fbtk_set_handler(neww, FBTK_CBT_SCROLLY, callback, context); neww->u.scroll.btnul = fbtk_create_button(parent, x, y, width, scrollu.height, fg, load_bitmap("PROGDIR:Resources/Icons/scrollu.png"), vscrollu_click, neww); neww->u.scroll.btndr = fbtk_create_button(parent, x, y + height - scrolld.height, width, scrolld.height, fg, load_bitmap("PROGDIR:Resources/Icons/scrolld.png"), vscrolld_click, neww); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_user(fbtk_widget_t *parent, int x, int y, int width, int height, void *pw) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_USER, x, y, width, height); neww->u.user.pw = pw; neww->mapped = true; return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_fill(fbtk_widget_t *parent, int x, int y, int width, int height, colour c) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_FILL, x, y, width, height); neww->bg = c; neww->mapped = true; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_fill, NULL); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_bitmap(fbtk_widget_t *parent, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_BITMAP, x, y, width, height); neww->bg = c; neww->mapped = true; neww->u.bitmap.bitmap = image; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_bitmap, NULL); return neww; }
/* exported function documented in fbtk.h */ fbtk_widget_t * fbtk_create_text(fbtk_widget_t *parent, int x, int y, int width, int height, colour bg, colour fg, bool outline) { fbtk_widget_t *neww; neww = fbtk_widget_new(parent, FB_WIDGET_TYPE_TEXT, x, y, width, height); neww->fg = fg; neww->bg = bg; neww->mapped = true; neww->u.text.outline = outline; fbtk_set_handler(neww, FBTK_CBT_REDRAW, fb_redraw_text, NULL); return neww; }