Mail Archives: djgpp/1996/10/29/09:22:52
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 <allegro.h>
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;
}
- Raw text -