#gGadgets
4 messages in this thread
Could someone give me a simple example of how to use DrawBevelBox() please.
Thanks.
Steven,
Here is a small function I have that uses the function DrawBevelBox(),
Hope this will be enough of a example.
void RenderFilledBox(struct Window *w, UBYTE apen, WORD left, WORD top
,WORD width, WORD height, UBYTE look, ULONG type)
{
SetAPen(w->RPort, apen );
if (raised == look )
{
DrawBevelBox(w->RPort, left, top, width, height, GTBB_FrameType,
type, GT_VisualInfo, VisualInfo, TAG_DONE );
}
else if ( lowered == look )
{
DrawBevelBox(w->RPort, left, top, width, height, GTBB_Recessed,TRUE,
GTBB_FrameType,type,GT_VisualInfo,VisualInfo,TAG_DONE );
}
SetAfPt(w->RPort, NULL, 0 );
SetAPen(w->RPort, apen );
RectFill(w->RPort, left + 2, top + 1, left + width – 3,top + height – 2
);
}
P.S.
I use a enum for the lowered or raised and declare it in my globals.h
file.
enum look { raised, lowered };
MikeM:) "Amiga means never having to say you're sorry!"
Thanks a lot for your response, will let you know how it works out (I'll read
it off line as this is long distance. Thanks again./exit
Steven,
typedef struct box {
int x;
int y;
int w;
int h;
} BOX, *BOX_PTR;
BOX ebox = { 4, 0, 615, 348 };
DrawBevelBox(editor_window->RPort, ebox.x, ebox.y, ebox.w, ebox.h,
GT_VisualInfo, vi, TAG_DONE);
-sja