home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
500-599
/
ff502.lzh
/
CELLS
/
CELLSSource.lzh
/
cReqNP.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-04-20
|
2KB
|
80 lines
/*
* CELLS An Implementation of the WireWorld cellular automata
* as described in Scientific American, Jan 1990.
*
* Copyright 1990 by Davide P. Cervone.
* You may use this code, provided this copyright notice is kept intact.
* See the CELLS.HELP file for complete information on distribution conditions.
*/
/*
* File: cReqNP.c Data structures for the New Part Requester.
*/
#include "Cells.h"
#include "cRequest.h"
#include "cReqNP.h"
#include "cBoxes.h"
static short PanelBox[] = FBOX(NP_PANELW,NP_PANELH);
static short FrameBox[] = FBOX(NP_FRAMEW,NP_FRAMEH);
static short NameBox[] = FBOX(NP_BOXW,NP_BOXH);
static short ButtonBox[] = HBOX(NP_BUTTONW,NP_BUTTONH);
static struct Border NPBorder[] =
{
#define NEXTBORDER(n) &NPBorder[n+2]
#define BORDERNAME NPBorder
OUTBRDR(NPB_PANEL, 0,0, PanelBox),
INBRDR (NPB_FRAME, NP_FRAMEX,NP_FRAMEY, FrameBox),
#undef NEXTBORDER
#define NEXTBORDER(n) NULL
INBRDR (NPB_BOX, NP_BOXX,NP_BOXY, NameBox),
OUTBRDR(NPB_BUTTON, 0,0, ButtonBox)
};
static struct Image NameImage =
IMAGE(-1,-1,NP_BOXW-2,NP_BOXH-2,BACKGROUND);
static struct IntuiText NPText[] =
{
ITEXT("Cancel", 5,3),
ITEXT("OK", 16,3),
ITEXT("Name for Part:", 9,2),
};
char NPNameBuf[MAXPNAME+1];
char UndoBuffer[MAXBUFFER];
static struct StringInfo NPNameInfo =
{&NPNameBuf[0], &UndoBuffer[0], 0,MAXPNAME+1, 0, 0,0,0, 0,0, NULL, 0, NULL};
#define BUTTON(n,t)\
{\
&NPGadget[n+1], NP_BUTTONX+NP_BUTTONW*n,NP_BUTTONY,\
NP_BUTTONW,NP_BUTTONH, GADGHCOMP, RELVERIFY, BOOLGADGET| REQGADGET,\
(APTR)&NPBorder[NPB_BUTTON],NULL, &NPText[t], 0, NULL, n, NULL\
}
#define NAME(n)\
{\
NULL, NP_BOXX+2,NP_BOXY+2,NP_BOXW-4,NP_BOXH-4, GADGHCOMP| GADGIMAGE,\
RELVERIFY, STRGADGET| REQGADGET, (APTR)&NameImage, NULL, NULL, 0,\
(APTR)&NPNameInfo, n, NULL\
}
static struct Gadget NPGadget[] =
{
BUTTON(NP_CANCEL,NPT_CANCEL),
BUTTON(NP_OK,NPT_OK),
NAME(NP_NAME),
};
struct ExtRequest NPRequest =
{
{NULL, 0,0, NP_PANELW,NP_PANELH, 0,0, &NPGadget[0], &NPBorder[NPB_PANEL],
&NPText[NPT_TITLE], 0, FOREGROUND, NULL, NULL, NULL},
NULL,NULL,NULL, &NPGadget[NP_NAME],
};