home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
toolalias
/
source
/
toolalias_gfx.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-29
|
5KB
|
172 lines
/*
* Source generated with GadToolsBox V1.4
* which is (c) Copyright 1991,92 Jaba Development
*/
#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 <string.h>
#include <pragmas/exec_pragmas.h>
#include <pragmas/intuition_pragmas.h>
#include <pragmas/gadtools_pragmas.h>
#include <pragmas/graphics_pragmas.h>
#include <pragmas/utility_pragmas.h>
#include "toolalias_gfx.h"
struct Screen *Scr = NULL;
APTR VisualInfo = NULL;
struct Window *ToolAliasWnd = NULL;
struct Gadget *ToolAliasGList = NULL;
struct Gadget *ToolAliasGadgets[12];
UWORD ToolAliasLeft = 46;
UWORD ToolAliasTop = 27;
UWORD ToolAliasWidth = 254;
UWORD ToolAliasHeight = 65;
UBYTE *ToolAliasWdt = NULL;
struct TextAttr topaz8 = {
( STRPTR )"topaz.font", 8, 0x00, 0x00 };
UWORD ToolAliasGTypes[] = {
STRING_KIND,
STRING_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND
};
struct NewGadget ToolAliasNGad[] = {
54, 4, 183, 12, (UBYTE *)"Old", NULL, GD_OldStr, PLACETEXT_LEFT ,NULL, NULL,
54, 17, 183, 12, (UBYTE *)"New", NULL, GD_NewStr, PLACETEXT_LEFT ,NULL, NULL,
54, 30, 29, 13, (UBYTE *)"<<", NULL, GD_StartBut, PLACETEXT_IN ,NULL, NULL,
83, 30, 29, 13, (UBYTE *)"<", NULL, GD_PrevBut, PLACETEXT_IN ,NULL, NULL,
112, 30, 33, 13, (UBYTE *)"Add", NULL, GD_AddBut, PLACETEXT_IN ,NULL, NULL,
178, 30, 29, 13, (UBYTE *)">", NULL, GD_NextBut, PLACETEXT_IN ,NULL, NULL,
208, 30, 29, 13, (UBYTE *)">>", NULL, GD_EndBut, PLACETEXT_IN ,NULL, NULL,
145, 30, 33, 13, (UBYTE *)"Del", NULL, GD_DelBut, PLACETEXT_IN ,NULL, NULL,
9, 46, 51, 13, (UBYTE *)"Save", NULL, GD_SaveBut, PLACETEXT_IN ,NULL, NULL,
127, 46, 51, 13, (UBYTE *)"Use", NULL, GD_UseBut, PLACETEXT_IN ,NULL, NULL,
186, 46, 51, 13, (UBYTE *)"Quit", NULL, GD_QuitBut, PLACETEXT_IN ,NULL, NULL,
68, 46, 51, 13, (UBYTE *)"Load", NULL, GD_LoadBut, PLACETEXT_IN ,NULL, NULL
};
ULONG ToolAliasGTags[] = {
(GTST_MaxChars), 256, (TAG_DONE),
(GTST_MaxChars), 256, (TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE),
(TAG_DONE)
};
int SetupScreen( void )
{
if ( ! ( Scr = LockPubScreen((UBYTE * )"Workbench" )))
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 OpenToolAliasWindow( void )
{
struct NewGadget ng;
struct Gadget *g;
UWORD lc, tc;
UWORD offx = Scr->WBorLeft,offy = Scr->WBorTop + Scr->RastPort.TxHeight + 1;
if ( ! ( g = CreateContext( &ToolAliasGList )))
return( 1L );
for( lc = 0, tc = 0; lc < ToolAlias_CNT; lc++ ) {
CopyMem((char * )&ToolAliasNGad[ lc ], (char * )&ng, (long)sizeof( struct NewGadget ));
ng.ng_VisualInfo = VisualInfo;
ng.ng_TextAttr = &topaz8;
ng.ng_LeftEdge += offx;
ng.ng_TopEdge += offy;
ToolAliasGadgets[ lc ] = g = CreateGadgetA((ULONG)ToolAliasGTypes[ lc ], g, &ng, ( struct TagItem * )&ToolAliasGTags[ tc ] );
while( ToolAliasGTags[ tc ] ) tc += 2;
tc++;
if ( NOT g )
return( 2L );
}
if ( ! ( ToolAliasWnd = OpenWindowTags( NULL,
WA_Left, ToolAliasLeft,
WA_Top, ToolAliasTop,
WA_Width, ToolAliasWidth,
WA_Height, ToolAliasHeight + offy,
WA_IDCMP, STRINGIDCMP|BUTTONIDCMP|IDCMP_CLOSEWINDOW|IDCMP_REFRESHWINDOW,
WA_Flags, WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_CLOSEGADGET|WFLG_SMART_REFRESH,
WA_Gadgets, ToolAliasGList,
WA_Title, ToolAliasWdt,
WA_ScreenTitle, "ToolAlias v1.0 by mws in Feb '93",
TAG_DONE )))
return( 4L );
GT_RefreshWindow( ToolAliasWnd, NULL );
return( 0L );
}
void CloseToolAliasWindow( void )
{
if ( ToolAliasWnd ) {
CloseWindow( ToolAliasWnd );
ToolAliasWnd = NULL;
}
if ( ToolAliasGList ) {
FreeGadgets( ToolAliasGList );
ToolAliasGList = NULL;
}
}