From: "Chris A. Triebel" Newsgroups: comp.os.msdos.djgpp Subject: button/bitmap for allegro Date: Tue, 29 Oct 1996 06:30:04 -0500 Organization: University of New Hampshire - Durham, NH Lines: 69 Message-ID: References: NNTP-Posting-Host: sun4.iol.unh.edu Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII In-Reply-To: To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Stupid me. Just realized that I sent out the wrong function. Sorry. Anyway here is both of them. This way you can get a look at two different systems easily. You may ask why I wrote d_bitmap_proc over. It is because the image that bitmap produced was being blown away inside the dialog by one that was behind/surrounding it. cat ----------------------------------------------------------------------- #include int A_bitmap_proc(int msg,DIALOG *d, int c) { BITMAP *b=(BITMAP*)d->dp; switch(msg) { case MSG_WANTFOCUS: { return D_WANTFOCUS; } case MSG_GOTFOCUS: { return D_REDRAW; } case MSG_DRAW: { show_mouse(0); blit(b,screen,0,0, d->x, d->y, d->w, d->h); show_mouse(screen); break; } } return D_O_K; } int A_tile_proc(int msg,DIALOG *d, int c) { int err; BITMAP *b=(BITMAP*)d->dp; switch(msg) { case MSG_DRAW: { show_mouse(0); // blit the bitmap stored in dp to screen blit(b,screen,0,0,d->x,d->y,d->w,d->h); if (d->flags&D_SELECTED) rect(screen,d->x,d->y,(d->x)+(d->w)-1,(d->y)+(d->h)-1,SELECT_COLOR); show_mouse(screen); return D_O_K; } case MSG_CLICK: { if(d->flags&D_SELECTED) d->flags-=D_SELECTED; else d->flags|=D_SELECTED; select(d); A_tile_proc(MSG_DRAW,d,c); return D_O_K; } case MSG_WANTFOCUS: return D_WANTFOCUS; } return D_O_K; }