home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
new
/
util
/
cdity
/
runlist2
/
source
/
rlistn.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-01-18
|
19KB
|
640 lines
/*
* Source machine generated by GadToolsBox V2.0b
* which is (c) Copyright 1991-1993 Jaba Development
*
* GUI Designed by : -- Heinz Reinert --
*/
#include <exec/types.h>
#include <intuition/intuition.h>
#include <intuition/classes.h>
#include <intuition/classusr.h>
#include <intuition/imageclass.h>
#include <intuition/gadgetclass.h>
#include <libraries/gadtools.h>
#include <graphics/displayinfo.h>
#include <graphics/GfxBase.h>
#include <clib/exec_protos.h>
#include <clib/intuition_protos.h>
#include <clib/gadtools_protos.h>
#include <clib/graphics_protos.h>
#include <clib/utility_protos.h>
#include <proto/intuition.h>
#include <proto/graphics.h>
#include <proto/exec.h>
#include <proto/dos.h>
#include <proto/gadtools.h>
#include <exec/memory.h>
#include <string.h>
/*********************************************/
#define GetString( g ) ((( struct StringInfo * )g->SpecialInfo )->Buffer )
#define GetNumber( g ) ((( struct StringInfo * )g->SpecialInfo )->LongInt )
#define GD_list 0
#define GD_gadtxt 1
#define GD_command 2
#define GD_command2 3
#define GD_new 4
#define GD_del 5
#define GD_start 6
#define GD_save 7
#define GD_Gadget80 8
#define GD_Gadget90 9
#define GDX_list 0
#define GDX_gadtxt 1
#define GDX_command 2
#define GDX_command2 3
#define GDX_new 4
#define GDX_del 5
#define GDX_start 6
#define GDX_save 7
#define GDX_Gadget80 8
#define GDX_Gadget90 9
#define Project0_CNT 10
UBYTE *vers = "\0$VER: RunList 2";
extern struct IntuitionBase *IntuitionBase;
extern struct Library *GadToolsBase;
extern struct Screen *Scr;
extern UBYTE *PubScreenName;
extern APTR VisualInfo;
extern struct Window *Project0Wnd;
extern struct Gadget *Project0GList;
extern struct Gadget *Project0Gadgets[10];
extern UWORD Project0Left;
extern UWORD Project0Top;
extern UWORD Project0Width;
extern UWORD Project0Height;
extern UBYTE *Project0Wdt;
extern struct TextAttr topaz8;
extern UWORD Project0GTypes[];
extern struct NewGadget Project0NGad[];
extern ULONG Project0GTags[];
extern int SetupScreen( void );
extern void CloseDownScreen( void );
extern int OpenProject0Window( void );
extern void CloseProject0Window( void );
LONG TimeDelay( long unit, unsigned long secs, unsigned long microsecs );
/*********************************************/
struct Screen *Scr = NULL;
UBYTE *PubScreenName = NULL;
APTR VisualInfo = NULL;
struct Window *Project0Wnd = NULL;
struct Gadget *Project0GList = NULL;
struct Gadget *Project0Gadgets[10];
UWORD Project0Left = 353;
UWORD Project0Top = 10;
UWORD Project0Width = 283;
UWORD Project0Height = 0;
UBYTE *Project0Wdt = (UBYTE *)"RunList N2";
struct TextAttr topaz8 = {
( STRPTR )"topaz.font", 8, 0x00, 0x01 };
UWORD Project0GTypes[] = {
LISTVIEW_KIND,
STRING_KIND,
STRING_KIND,
STRING_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
TEXT_KIND,
TEXT_KIND
};
struct NewGadget Project0NGad[] = {
20, 10, 159, 88, NULL, NULL, GD_list, 0, NULL, NULL,
20, 96, 158, 12, NULL, NULL, GD_gadtxt, 0, NULL, NULL,
6, 118, 250, 12, NULL, NULL, GD_command, 0, NULL, NULL,
6, 130, 250, 12, NULL, NULL, GD_command2, 0, NULL, NULL,
184, 10, 57, 11, (UBYTE *)"NEW", NULL, GD_new, PLACETEXT_IN, NULL, NULL,
184, 22, 57, 11, (UBYTE *)"DELETE", NULL, GD_del, PLACETEXT_IN, NULL, NULL,
184, 46, 57, 62, (UBYTE *)"RUN", NULL, GD_start, PLACETEXT_IN, NULL, NULL,
184, 34, 57, 11, (UBYTE *)"SAVE", NULL, GD_save, PLACETEXT_IN, NULL, NULL,
13, 6, 236, 106, NULL, NULL, GD_Gadget80, 0, NULL, NULL,
6, 3, 249, 112, NULL, NULL, GD_Gadget90, 0, NULL, NULL
};
ULONG Project0GTags[] = {
(TAG_DONE),
(GTST_MaxChars), 20, (TAG_DONE),
(GTST_MaxChars), 50, (TAG_DONE),
(GTST_MaxChars), 50, (TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(GTTX_Border), TRUE, (TAG_DONE),
(GTTX_Border), TRUE, (TAG_DONE)
};
int SetupScreen( void )
{
if ( ! ( Scr = LockPubScreen( PubScreenName )))
return( 1L );
if ( ! ( VisualInfo = GetVisualInfo( Scr, TAG_DONE )))
return( 2L );
return( 0L );
}
void CloseDownScreen( void )
{
if ( VisualInfo ) {
FreeVisualInfo( VisualInfo );
VisualInfo = NULL;
}
if ( Scr ) {
UnlockPubScreen( NULL, Scr );
Scr = NULL;
}
}
int OpenProject0Window( void )
{
struct NewGadget ng;
struct Gadget *g;
UWORD lc, tc;
UWORD offx = Scr->WBorLeft, offy = Scr->WBorTop + Scr->RastPort.TxHeight + 1;
if ( ! ( g = CreateContext( &Project0GList )))
return( 1L );
for( lc = 0, tc = 0; lc < Project0_CNT; lc++ ) {
CopyMem((char * )&Project0NGad[ lc ], (char * )&ng, (long)sizeof( struct NewGadget ));
ng.ng_VisualInfo = VisualInfo;
ng.ng_TextAttr = &topaz8;
ng.ng_LeftEdge += offx;
ng.ng_TopEdge += offy;
Project0Gadgets[ lc ] = g = CreateGadgetA((ULONG)Project0GTypes[ lc ], g, &ng, ( struct TagItem * )&Project0GTags[ tc ] );
while( Project0GTags[ tc ] ) tc += 2;
tc++;
if ( NOT g )
return( 2L );
}
if ( ! ( Project0Wnd = OpenWindowTags( NULL,
WA_Left, Project0Left,
WA_Top, Project0Top,
WA_Width, Project0Width,
WA_Height, Project0Height + offy,
WA_IDCMP, LISTVIEWIDCMP|
BUTTONIDCMP|
STRINGIDCMP|
IDCMP_NEWSIZE|
IDCMP_MENUPICK|
IDCMP_CLOSEWINDOW|
IDCMP_CHANGEWINDOW|
IDCMP_INTUITICKS |
IDCMP_MOUSEBUTTONS|
IDCMP_REFRESHWINDOW,
WA_Flags, WFLG_SIZEGADGET|
WFLG_DRAGBAR|
WFLG_DEPTHGADGET|
WFLG_CLOSEGADGET|
WFLG_SMART_REFRESH,
WA_Gadgets, Project0GList,
WA_Title, Project0Wdt,
WA_ScreenTitle, "RunList N2 Heinz Reinert 1994-95",
WA_PubScreen, Scr,
WA_MinWidth, 283,
WA_MinHeight, 157,
WA_MaxWidth, 283,
WA_MaxHeight, 157,
TAG_DONE )))