Réponse acceptée !
voici le code associé :
class button
{
public:
int _pos_x,_pos_y,_size_x,_size_y;
char _couleur;
char *text;
virtual void ajout_evenement(void f(void));
void(*_surclik)();// On gere l'evenementiel
button(int,int,int,int,char);
void dessiner(unsigned char*);
void Even_Test();
int _handling;
souris s;
};
button::button(int pos_x,int pos_y,int size_x,int size_y,char couleur)
{
_pos_x=pos_x;
_pos_y=pos_y;
_size_x=size_x;
_size_y=size_y;
_couleur=couleur;
}
void button::dessiner(unsigned char *screen)
{
int j;
for(j=_pos_y;j<_pos_y+_size_y;j++)
ligne(_pos_x,j,_pos_x+_size_x,j,_couleur,screen);
}
void button::ajout_evenement(void f( void))
{
_surclik=f;
}
|