/* gads.c
 *
 * Gadget definitions for PIV
 *
 * (c) Copyright 1991 J.E.Hanway
 *
 * $Id: gads.c,v 1.1 91/03/13 22:33:05 jeh Exp $
 *
 * $Log:	gads.c,v $
 * Revision 1.1  91/03/13  22:33:05  jeh
 * Initial revision
 * 
 */

#include <exec/types.h>
#include <intuition/intuition.h>

#include "PIV.h"

/* shorthand */

#define ITEXT(label,x,y,string,next) \
static struct IntuiText label = { 0,1,JAM2,x,y,&TOPAZ80,string,next }
   
#define EXPLAIN(label,string) ITEXT(label,60,3,string,NULL)

#define BUTTEXT(label,string,next) ITEXT(label,2,2,string,next)

#define BUTGAD(label,y,text,id) \
static struct Gadget label = {\
NULL,10,y,51,12,\
NULL,RELVERIFY,BOOLGADGET,(APTR)&but_bor,NULL,text,NULL,NULL,id,NULL }

#define BUTTON(label,name,explanation) \
EXPLAIN(label##_t2, explanation);\
BUTTEXT(label##_t1, #name, &label##_t2);\
BUTGAD(label,name*20+24,&label##_t1,name)

static struct TextAttr TOPAZ80 = { "topaz.font",TOPAZ_EIGHTY,0,0 };

ITEXT(t10, 10, 28, "is not mounted.  You may:", NULL);
ITEXT(t9, 10, 16, NULL, &t10);

static struct Image white_image = {
   4,11,302,111,0,
   NULL,
   0x0, 0x1,
   NULL
};

static SHORT outer_lines[] = {
    0,0,
    56,0,
    56,17,
    0,17,
    0,0
};
static struct Border outer_but_bor = {
    -3,-3,
    3,0,JAM1,
    5,
    outer_lines,
    NULL
};
static SHORT inner_lines[] = {
    0,0,
    52,0,
    52,13,
    0,13,
    0,0
};
static struct Border but_bor = {
    -1,-1,
    0,0,JAM1,
    5,
    inner_lines,
    &outer_but_bor
};

BUTTON(g1, RETRY, "after inserting the volume.");

BUTTON(g2, ASSIGN, "the volume to");

BUTTON(g3, MOUNT, "the device.");

BUTTON(g4, CANCEL, "the operation.");

/* string gadget for assign */
static struct Gadget g5 = {
    NULL,
    180,67,
    120,10,
    NULL,
    RELVERIFY,
    STRGADGET,
    NULL,NULL,NULL,NULL,NULL,
    ASSIGN,
    NULL
};

/* dummy gadget for white background and text */
static struct Gadget g6 = {
   NULL,0,0,0,0,GADGIMAGE,NULL,BOOLGADGET,
   (APTR) &white_image,
   NULL,NULL,NULL,NULL,
   NULL,
   NULL
};

struct Gadget *gproto[6] = { &g1, &g2, &g3, &g4, &g5, &g6 };
   
struct NewWindow nw_proto = {
    0, 0, 310, 124,
    0,1,
    GADGETUP,
    WINDOWDRAG | WINDOWDEPTH | ACTIVATE | RMBTRAP | NOCAREREFRESH,
    NULL,
    NULL,
    "System Request",
    NULL,
    NULL,
    0,0,0,0,
    0
};

struct IntuiText *vol_text = &t9;
