home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Frozen Fish 2: PC
/
frozenfish_august_1995.bin
/
bbs
/
d01xx
/
d0165.lha
/
PlotView
/
plotview.h
< prev
next >
Wrap
C/C++ Source or Header
|
1988-11-22
|
14KB
|
737 lines
/*
* screen definitions for my custom screen
*
*/
#define XSIZE 690
#define YSIZE 423
static struct TextAttr TOPAZ80 = {
(STRPTR)"topaz.font",
TOPAZ_EIGHTY,0,0
};
static struct NewScreen NewScreenStructure = {
0,0, /* screen XY origin relative to View */
XSIZE,YSIZE+2, /* screen width and height */
2, /* screen depth (number of bitplanes) */
0,1, /* detail and block pens */
LACE+HIRES, /* display modes for this screen */
CUSTOMSCREEN, /* screen type */
&TOPAZ80, /* pointer to default screen font */
(UBYTE *)"Plot To Amiga", /* screen title */
NULL, /* first in list of custom screen gadgets */
NULL /* pointer to custom BitMap structure */
};
#define NEWSCREENSTRUCTURE NewScreenStructure
static USHORT Palette[] = {
0x003F, /* color #0 */
0x0DEF, /* color #1 */
0x0F00, /* color #2 */
0x0CF2 /* color #3 */
#define PaletteColorCount 4
};
#define PALETTE Palette
/*
* definition of the main window
*/
static struct NewWindow New_Window = {
0, 2, /* Take all except the */
XSIZE, YSIZE, /* top two lines */
-1, -1, /* Default pens */
CLOSEWINDOW+MENUPICK, /* Inputs acceppeted */
WINDOWCLOSE /* Fairly standard window */
| WINDOWDEPTH | SMART_REFRESH | BORDERLESS ,
NULL, /* no gadgets */
(struct Image *) NULL,
(UBYTE *)"PlotView", /* title */
(struct Screen *) NULL, /* filled at startup */
(struct BitMap *) NULL,
0, 0, 0, 0, /* no change sizes, doesn't matter */
CUSTOMSCREEN
} ;
/*
* definitions for the menus
*/
#define MENUWIDTH 126
#define MENUHEIGHT 8
struct IntuiText IText0 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"QUIT",
NULL
};
struct MenuItem MenuItem7 = {
NULL,
0,54,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText0,
NULL,
'Q',
NULL,
MENUNULL
};
struct IntuiText IText1 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"ColorWindow",
NULL
};
struct MenuItem MenuItem6 = {
&MenuItem7,
0,45,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText1,
NULL,
'W',
NULL,
MENUNULL
};
struct IntuiText IText2 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"Help",
NULL
};
struct MenuItem MenuItem5 = {
&MenuItem6,
0,36,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText2,
NULL,
'H',
NULL,
MENUNULL
};
struct IntuiText IText3 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"Print",
NULL
};
struct MenuItem MenuItem4 = {
&MenuItem5,
0,27,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText3,
NULL,
'P',
NULL,
MENUNULL
};
struct IntuiText IText4 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"Set Scale",
NULL
};
struct MenuItem MenuItem3 = {
&MenuItem4,
0,18,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText4,
NULL,
'S',
NULL,
MENUNULL
};
struct IntuiText IText5 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"Clear",
NULL
};
struct MenuItem MenuItem2 = {
&MenuItem3,
0,9,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText5,
NULL,
'C',
NULL,
MENUNULL
};
struct IntuiText IText6 = {
3,1,COMPLEMENT,
0,0,
NULL,
(UBYTE *)"Draw File",
NULL
};
struct MenuItem MenuItem1 = {
&MenuItem2,
0,0,
MENUWIDTH,MENUHEIGHT,
ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,
0,
(APTR)&IText6,
NULL,
'D',
NULL,
MENUNULL
};
struct Menu Menu1 = {
NULL,
0,0,
75,0,
MENUENABLED,
"Project",
&MenuItem1
};
#define MenuList1 Menu1
/*
* definition for the Fileio Window
*/
struct NewWindow NewFileioWindow = {
61,26,
310,150,
-1,-1,
DISKINSERTED+MOUSEBUTTONS+VANILLAKEY,
SMART_REFRESH+ACTIVATE+NOCAREREFRESH,
NULL,
NULL,
NULL,
NULL,
NULL,
5,5,
640,200,
CUSTOMSCREEN
};
/*
* definitions for the Scale Select Window and gadgets
*/
UBYTE UNDOBUFFER[10];
SHORT BorderVectors1[] = {
0,0,
107,0,
107,11,
0,11,
0,0
};
struct Border Border1 = {
-2,-1,
3,0,JAM1,
5,
BorderVectors1,
NULL
};
struct IntuiText IWinText1 = {
3,0,JAM2,
0,1,
NULL,
(UBYTE *)"OVERRIDE FILE",
NULL
};
struct Gadget OverrideGad = {
NULL,
144,77,
104,10,
NULL,
TOGGLESELECT,
BOOLGADGET,
(APTR)&Border1,
NULL,
&IWinText1,
NULL,
NULL,
NULL,
NULL
};
UBYTE YoffGadSIBuff[10];
struct StringInfo YoffGadSInfo = {
YoffGadSIBuff,
UNDOBUFFER,
0,
10,
0,
0,0,0,0,0,
0,
0,
NULL
};
SHORT BorderVectors2[] = {
0,0,
106,0,
106,12,
0,12,
0,0
};
struct Border Border2 = {
-2,-3,
3,0,JAM1,
5,
BorderVectors2,
NULL
};
struct Gadget YoffGad = {
&OverrideGad,
143,55,
103,11,
NULL,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&Border2,
NULL,
NULL,
NULL,
(APTR)&YoffGadSInfo,
NULL,
NULL
};
UBYTE XoffGadSIBuff[10];
struct StringInfo XoffGadSInfo = {
XoffGadSIBuff,
UNDOBUFFER,
0,
10,
0,
0,0,0,0,0,
0,
0,
NULL
};
SHORT BorderVectors3[] = {
0,0,
106,0,
106,12,
0,12,
0,0
};
struct Border Border3 = {
-2,-3,
3,0,JAM1,
5,
BorderVectors3,
NULL
};
struct Gadget XoffGad = {
&YoffGad,
143,29,
103,11,
NULL,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&Border3,
NULL,
NULL,
NULL,
(APTR)&XoffGadSInfo,
NULL,
NULL
};
SHORT BorderVectors4[] = {
0,0,
45,0,
45,12,
0,12,
0,0
};
struct Border Border4 = {
-2,-1,
3,0,JAM1,
5,
BorderVectors4,
NULL
};
struct TextAttr TOPAZ60 = {
(STRPTR)"topaz.font",
TOPAZ_SIXTY,0,0
};
struct IntuiText IWinText2 = {
3,0,JAM2,
12,2,
&TOPAZ60,
(UBYTE *)"OK",
NULL
};
struct Gadget OKGad = {
&XoffGad,
50,77,
42,11,
NULL,
RELVERIFY,
BOOLGADGET,
(APTR)&Border4,
NULL,
&IWinText2,
NULL,
NULL,
NULL,
NULL
};
UBYTE YscaleGadSIBuff[10];
struct StringInfo YscaleGadSInfo = {
YscaleGadSIBuff,
UNDOBUFFER,
0,
10,
0,
0,0,0,0,0,
0,
0,
NULL
};
SHORT BorderVectors5[] = {
0,0,
106,0,
106,12,
0,12,
0,0
};
struct Border Border5 = {
-2,-3,
3,0,JAM1,
5,
BorderVectors5,
NULL
};
struct Gadget YscaleGad = {
&OKGad,
26,55,
103,11,
NULL,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&Border5,
NULL,
NULL,
NULL,
(APTR)&YscaleGadSInfo,
NULL,
NULL
};
UBYTE XscaleGadSIBuff[10];
struct StringInfo XscaleGadSInfo = {
XscaleGadSIBuff,
UNDOBUFFER,
0,
10,
0,
0,0,0,0,0,
0,
0,
NULL
};
SHORT BorderVectors6[] = {
0,0,
106,0,
106,12,
0,12,
0,0
};
struct Border Border6 = {
-2,-3,
3,0,JAM1,
5,
BorderVectors6,
NULL
};
struct Gadget XscaleGad = {
&YscaleGad,
26,29,
103,11,
NULL,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&Border6,
NULL,
NULL,
NULL,
(APTR)&XscaleGadSInfo,
NULL,
NULL
};
#define GadgetList1 XscaleGad
struct IntuiText IWinText8 = {
3,0,JAM2,
257,57,
NULL,
(UBYTE *)"Y",
NULL
};
struct IntuiText IWinText7 = {
3,0,JAM2,
256,31,
NULL,
(UBYTE *)"X",
&IWinText8
};
struct IntuiText IWinText6 = {
3,0,JAM2,
142,11,
NULL,
(UBYTE *)"Select Offset",
&IWinText7
};
struct IntuiText IWinText5 = {
3,0,JAM2,
10,56,
NULL,
(UBYTE *)"Y",
&IWinText6
};
struct IntuiText IWinText4 = {
3,0,JAM2,
9,31,
NULL,
(UBYTE *)"X",
&IWinText5
};
struct IntuiText IWinText3 = {
3,0,JAM2,
29,11,
NULL,
(UBYTE *)"Select Scale",
&IWinText4
};
#define IWinText IWinText3
struct NewWindow NewScaleWindow = {
61,26,
280,120,
0,1,
GADGETUP,
NULL,
&XscaleGad,
NULL,
NULL,
NULL,
NULL,
5,5,
640,200,
CUSTOMSCREEN
};
/*
* Text for requesters
*/
char filename[80];
struct IntuiText ffmtmsg2 = {
0,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,20, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *) filename, /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText ffmtmsg = {
0,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,10, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"File has format error", /* pointer to text */
&ffmtmsg2 /* next IntuiText structure */
};
struct IntuiText openfimsg2 = {
0,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,26, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *) filename,
NULL /* next IntuiText structure */
};
struct IntuiText openfimsg = {
0,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,16, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Can't open file:", /* pointer to text */
&openfimsg2 /* next IntuiText structure */
};
struct IntuiText cantxt = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
5,3, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"CANCEL", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText retrytxt = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
5,3, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"RETRY", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText oktxt = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
5,3, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"OK", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText nodatamsg = {
0,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,16, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"No data selected - check options", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText prfailtxt = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
14,16, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Printer failed to open", /* pointer to text */
NULL /* next IntuiText structure */
};
#define XOPT 60
#define YOPT 100
/*
* Text for error messages in scale window
*/
struct IntuiText ErrText1 = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
XOPT+10,YOPT+5, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Invalid X scale", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText ErrText2 = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
XOPT+10,YOPT+5, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Invalid Y scale", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText ErrText3 = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
XOPT+10,YOPT+5, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Invalid X offset", /* pointer to text */
NULL /* next IntuiText structure */
};
struct IntuiText ErrText4 = {
2,1,JAM2, /* front and back text pens, drawmode and fill byte */
XOPT+10,YOPT+5, /* XY origin relative to container TopLeft */
NULL, /* font pointer or NULL for default */
(UBYTE *)"Invalid Y offset", /* pointer to text */
NULL /* next IntuiText structure */
};
char *HelpText[40] = {
" PlotView - UNIX Plot file viewer for the Amiga.",
" by Joel Swank - 9-30-88",
"",
" PlotView draws UNIX plot format files on an Amiga Hi-Res screen. It has",
"Menu options to Draw a file, Clear the screen, set Scaling, Print, set the",
"Colors, and Quit. It can be started from the CLI or Workbench.",
"",
"From CLI:",
"",
">plotview file . . .",
"",
" Files will be read and drawn in order. Files can also be read by selecting",
"the 'Draw File' Menu item. The FileIO requester by RJ Mical will be used",
"to select a file name.",
"",
" The scaling of the drawing can be modified by selecting the 'Set Scale'",
"Menu item. This brings up the scale selection window. Enter Scale factors",
"in the left two string gadgets. Default is 3120. Valid entrys are from 100",
"to 10000. A smaller number means a larger drawing. Enter the offset in the",
"right two string gadgets to shift the picture in the window. A positive or",
"negative number may be entered. Toggle on the 'OVERRIDE FILE' gadget if you",
"want the entered values to override any 'space' commands in the file.",
"Otherwise these numbers will olny be used for files with no space command.",
"",
"The screen can be printed using the 'Print' Menu item. You may have to",
"adjust preferences to get a good printout on a one-color printer. Try",
"Black & White, Negative, and threshold = 5.",
"",
"If you prefer other colors, you can set them with the ColorWindow menu",
"item. It allows you to set the colors using the ColorWindow by RJ Mical.",
"",
"After viewing plot files click the (invisable) close gadget in the",
"upper left corner of the PlotView window, or select the 'Close' Menu item.",
NULL
};