view examples/dynamic/mbbutton.h @ 841:ce6cd06adccf

Fix error on area of cached coords and draw on right canvas. When zerioing, zeroing_coord() does not compute area of a cached coord and its descendant coords. It is fixed by eliminate empty areas of descendants and with special case of first non-empty area. In previous version, it always draw on canvas of root coord. It is fixed. Known issues: - It can not translate position of a pointer to a cached coord and descendants correctly.
author Thinker K.F. Li <thinker@codemud.net>
date Fri, 17 Sep 2010 16:26:14 +0800
parents ab8284c8dcee
children
line wrap: on
line source

#ifndef __MBBUTTON_H
#define __MBBUTTON_H
typedef struct _mb_button {
    mb_obj_t obj;
    redraw_man_t *rdman;
    int state;
    coord_t *root;
    coord_t *active;
    coord_t *normal;
    coord_t *click;
    void (*press)();
    void *arg;
    observer_t *obs_move,*obs_out,*obs_press;
    mb_progm_t *progm;
} mb_button_t;
mb_button_t *mb_button_new(redraw_man_t *rdman,mb_sprite_t *sp, char *name);
void mb_button_add_onClick(mb_button_t *b, void (*h)(void *arg), void *arg);
#endif