home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
568b.lha
/
PowerSource_v3.0
/
source.lzh
/
source
/
slab.c
< prev
next >
Wrap
Text File
|
1991-09-15
|
13KB
|
498 lines
/*----------------------------------------------------------------------*
slab.c Version 3.0 - © Copyright 1991 Jaba Development
Author : Jan van den Baard
Purpose: Setting the source labels.
*----------------------------------------------------------------------*/
/*---------------------------------------------------*
Gadgets created with PowerSource V3.0
which is (c) Copyright 1990-91 by Jaba Development
written by Jan van den Baard
*---------------------------------------------------*/
static SHORT RenderBordersPairs0[] = {
-1,-1,315,-1,315,168,-1,168,-1,-1 };
static SHORT RenderBordersPairs1[] = {
-1,-1,314,-1,314,10,-1,10,-1,-1 };
static struct Border RenderBorders[] = {
3,2,0,0,JAM1,5,(SHORT *)&RenderBordersPairs0[0],&RenderBorders[1],
3,2,0,0,JAM1,5,(SHORT *)&RenderBordersPairs1[0],NULL };
static struct IntuiText RenderTexts = {
0,1,JAM1,60,3,NULL,(UBYTE *)"PowerSource Source Labels",NULL };
static UBYTE SBL_buf[32];
static UBYTE SBL_ubuf[32];
static struct StringInfo SBL_info = {
(UBYTE *)&SBL_buf,(UBYTE *)&SBL_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT SBL_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border SBL_bord = {
0,0,2,0,JAM1,5,(SHORT *)&SBL_pairs0[0],NULL };
static struct IntuiText SBL_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Sh. Border :",NULL };
#define SBL_ID 12
static struct Gadget SBL = {
NULL,105,136,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&SBL_bord,NULL,
&SBL_text,NULL,(APTR)&SBL_info,SBL_ID,NULL };
static UBYTE IMG_buf[32];
static UBYTE IMG_ubuf[32];
static struct StringInfo IMG_info = {
(UBYTE *)&IMG_buf,(UBYTE *)&IMG_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT IMG_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border IMG_bord = {
0,0,2,0,JAM1,5,(SHORT *)&IMG_pairs0[0],NULL };
static struct IntuiText IMG_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Images :",NULL };
#define IMG_ID 11
static struct Gadget IMG = {
&SBL,105,124,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&IMG_bord,NULL,
&IMG_text,NULL,(APTR)&IMG_info,IMG_ID,NULL };
static UBYTE CLR_buf[32];
static UBYTE CLR_ubuf[32];
static struct StringInfo CLR_info = {
(UBYTE *)&CLR_buf,(UBYTE *)&CLR_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT CLR_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border CLR_bord = {
0,0,2,0,JAM1,5,(SHORT *)&CLR_pairs0[0],NULL };
static struct IntuiText CLR_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Colors :",NULL };
#define CLR_ID 10
static struct Gadget CLR = {
&IMG,105,112,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&CLR_bord,NULL,
&CLR_text,NULL,(APTR)&CLR_info,CLR_ID,NULL };
static UBYTE RQS_buf[32];
static UBYTE RQS_ubuf[32];
static struct StringInfo RQS_info = {
(UBYTE *)&RQS_buf,(UBYTE *)&RQS_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT RQS_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border RQS_bord = {
0,0,2,0,JAM1,5,(SHORT *)&RQS_pairs0[0],NULL };
static struct IntuiText RQS_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Requester :",NULL };
#define RQS_ID 9
static struct Gadget RQS = {
&CLR,105,100,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&RQS_bord,NULL,
&RQS_text,NULL,(APTR)&RQS_info,RQS_ID,NULL };
static UBYTE NWS_buf[32];
static UBYTE NWS_ubuf[32];
static struct StringInfo NWS_info = {
(UBYTE *)&NWS_buf,(UBYTE *)&NWS_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT NWS_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border NWS_bord = {
0,0,2,0,JAM1,5,(SHORT *)&NWS_pairs0[0],NULL };
static struct IntuiText NWS_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"NewScreen :",NULL };
#define NWS_ID 8
static struct Gadget NWS = {
&RQS,105,88,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&NWS_bord,NULL,
&NWS_text,NULL,(APTR)&NWS_info,NWS_ID,NULL };
static UBYTE SPG_buf[32];
static UBYTE SPG_ubuf[32];
static struct StringInfo SPG_info = {
(UBYTE *)&SPG_buf,(UBYTE *)&SPG_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT SPG_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border SPG_bord = {
0,0,2,0,JAM1,5,(SHORT *)&SPG_pairs0[0],NULL };
static struct IntuiText SPG_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Sp. Gadget :",NULL };
#define SPG_ID 7
static struct Gadget SPG = {
&NWS,105,76,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&SPG_bord,NULL,
&SPG_text,NULL,(APTR)&SPG_info,SPG_ID,NULL };
static SHORT CNC_pairs0[] = {
-1,-1,147,-1,147,19,-1,19,-1,-1 };
static struct Border CNC_bord = {
0,0,0,0,JAM1,5,(SHORT *)&CNC_pairs0[0],NULL };
static struct IntuiText CNC_text = {
0,1,JAM1,49,6,NULL,(UBYTE *)"CANCEL",NULL };
#define CNC_ID 6
static struct Gadget CNC = {
&SPG,163,148,147,19,
GADGHCOMP,
RELVERIFY,
BOOLGADGET,
(APTR)&CNC_bord,NULL,
&CNC_text,NULL,NULL,CNC_ID,NULL };
static SHORT OKIDOKI_pairs0[] = {
-1,-1,147,-1,147,19,-1,19,-1,-1 };
static struct Border OKIDOKI_bord = {
0,0,0,0,JAM1,5,(SHORT *)&OKIDOKI_pairs0[0],NULL };
static struct IntuiText OKIDOKI_text = {
0,1,JAM1,65,6,NULL,(UBYTE *)"OK",NULL };
#define OKIDOKI_ID 5
static struct Gadget OKIDOKI = {
&CNC,8,148,147,19,
GADGHCOMP,
RELVERIFY,
BOOLGADGET,
(APTR)&OKIDOKI_bord,NULL,
&OKIDOKI_text,NULL,NULL,OKIDOKI_ID,NULL };
static UBYTE ITE_buf[32];
static UBYTE ITE_ubuf[32];
static struct StringInfo ITE_info = {
(UBYTE *)&ITE_buf,(UBYTE *)&ITE_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT ITE_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border ITE_bord = {
0,0,2,0,JAM1,5,(SHORT *)&ITE_pairs0[0],NULL };
static struct IntuiText ITE_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Items :",NULL };
#define ITE_ID 4
static struct Gadget ITE = {
&OKIDOKI,105,52,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&ITE_bord,NULL,
&ITE_text,NULL,(APTR)&ITE_info,ITE_ID,NULL };
static UBYTE SBI_buf[32];
static UBYTE SBI_ubuf[32];
static struct StringInfo SBI_info = {
(UBYTE *)&SBI_buf,(UBYTE *)&SBI_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT SBI_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border SBI_bord = {
0,0,2,0,JAM1,5,(SHORT *)&SBI_pairs0[0],NULL };
static struct IntuiText SBI_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"SubItems :",NULL };
#define SBI_ID 3
static struct Gadget SBI = {
&ITE,105,64,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&SBI_bord,NULL,
&SBI_text,NULL,(APTR)&SBI_info,SBI_ID,NULL };
static UBYTE MNU_buf[32];
static UBYTE MNU_ubuf[32];
static struct StringInfo MNU_info = {
(UBYTE *)&MNU_buf,(UBYTE *)&MNU_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT MNU_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border MNU_bord = {
0,0,2,0,JAM1,5,(SHORT *)&MNU_pairs0[0],NULL };
static struct IntuiText MNU_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Menus :",NULL };
#define MNU_ID 2
static struct Gadget MNU = {
&SBI,105,40,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&MNU_bord,NULL,
&MNU_text,NULL,(APTR)&MNU_info,MNU_ID,NULL };
static UBYTE BRD_buf[32];
static UBYTE BRD_ubuf[32];
static struct StringInfo BRD_info = {
(UBYTE *)&BRD_buf,(UBYTE *)&BRD_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT BRD_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border BRD_bord = {
0,0,2,0,JAM1,5,(SHORT *)&BRD_pairs0[0],NULL };
static struct IntuiText BRD_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Borders :",NULL };
#define BRD_ID 1
static struct Gadget BRD = {
&MNU,105,28,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&BRD_bord,NULL,
&BRD_text,NULL,(APTR)&BRD_info,BRD_ID,NULL };
static UBYTE TXT_buf[32];
static UBYTE TXT_ubuf[32];
static struct StringInfo TXT_info = {
(UBYTE *)&TXT_buf,(UBYTE *)&TXT_ubuf,0,32,0,0,0,0,0,0,NULL,NULL,NULL };
static SHORT TXT_pairs0[] = {
-1,-1,208,-1,208,8,-1,8,-1,-1 };
static struct Border TXT_bord = {
0,0,2,0,JAM1,5,(SHORT *)&TXT_pairs0[0],NULL };
static struct IntuiText TXT_text = {
0,1,JAM1,-98,0,NULL,(UBYTE *)"Texts :",NULL };
#define TXT_ID 0
static struct Gadget TXT = {
&BRD,105,16,208,8,
GADGHCOMP,
RELVERIFY+STRINGCENTER,
STRGADGET,
(APTR)&TXT_bord,NULL,
&TXT_text,NULL,(APTR)&TXT_info,TXT_ID,NULL };
static struct NewWindow nw_label = {
0,15,320,172,0,1,GADGETUP,NOCAREREFRESH+SMART_REFRESH+BORDERLESS+ACTIVATE+RMBTRAP,
NULL,NULL,NULL,NULL,NULL,150,50,320,256,CUSTOMSCREEN };
extern struct Screen *MainScreen;
extern struct Gadget *Gadget;
extern ULONG Class;
extern BOOL Saved;
static struct Window *wds;
UBYTE TextLabel[32] = "RenderTexts";
UBYTE BorderLabel[32] = "RenderBorders";
UBYTE MenuLabel[32] = "MenuStrip";
UBYTE ItemLabel[32] = "Items";
UBYTE SubLabel[32] = "SubItems";
UBYTE SpecialLabel[32] = "SpecialGadget";
UBYTE ScreenLabel[32] = "NewScreen";
UBYTE ReqLabel[32] = "Requester";
UBYTE ColorLabel[32] = "ColorMap";
UBYTE ImageLabel[32] = "Images";
UBYTE SharedLabel[32] = "SharedBorders";
void CheckLabel( UBYTE *buffer , UBYTE *old)
{
UWORD i;
if(strlen(buffer)) {
for( i = 0; i < strlen(buffer); i++ ) {
if(buffer[i] == ' ')
buffer[i] = '_';
}
} else
strcpy(buffer,old);
RefreshGList(Gadget,wds,NULL,1L);
}
void SetLabels( void )
{
BOOL running = TRUE;
UWORD i;
strcpy(&TXT_buf[0],&TextLabel[0]);
strcpy(&BRD_buf[0],&BorderLabel[0]);
strcpy(&MNU_buf[0],&MenuLabel[0]);
strcpy(&SBI_buf[0],&SubLabel[0]);
strcpy(&ITE_buf[0],&ItemLabel[0]);
strcpy(&SPG_buf[0],&SpecialLabel[0]);
strcpy(&NWS_buf[0],&ScreenLabel[0]);
strcpy(&RQS_buf[0],&ReqLabel[0]);
strcpy(&CLR_buf[0],&ColorLabel[0]);
strcpy(&IMG_buf[0],&ImageLabel[0]);
strcpy(&SBL_buf[0],&SharedLabel[0]);
redisplay(&SBL);
redisplay(&IMG);
redisplay(&CLR);
redisplay(&RQS);
redisplay(&NWS);
redisplay(&SPG);
redisplay(&ITE);
redisplay(&SBI);
redisplay(&MNU);
redisplay(&BRD);
redisplay(&TXT);
nw_label.Screen = MainScreen;
if(NOT(wds = (struct Window *)OpenWindow(&nw_label)))
return;
draw(wds,&TXT,&RenderBorders[0],&RenderTexts);
ActivateGadget(&TXT,wds,NULL);
do {
WaitPort(wds->UserPort);
while(read_msg(wds)) {
switch(Gadget->GadgetID) {
case TXT_ID:
CheckLabel(&TXT_buf[0],&TextLabel[0]);
ActivateGadget(&BRD,wds,NULL);
break;
case BRD_ID:
CheckLabel(&BRD_buf[0],&BorderLabel[0]);
ActivateGadget(&MNU,wds,NULL);
break;
case MNU_ID:
CheckLabel(&MNU_buf[0],&MenuLabel[0]);
ActivateGadget(&ITE,wds,NULL);
break;
case ITE_ID:
CheckLabel(&ITE_buf[0],&ItemLabel[0]);
ActivateGadget(&SBI,wds,NULL);
break;
case SBI_ID:
CheckLabel(&SBI_buf[0],&SubLabel[0]);
ActivateGadget(&SPG,wds,NULL);
break;
case SPG_ID:
CheckLabel(&SPG_buf[0],&SpecialLabel[0]);
ActivateGadget(&NWS,wds,NULL);
break;
case NWS_ID:
CheckLabel(&NWS_buf[0],&ScreenLabel[0]);
ActivateGadget(&RQS,wds,NULL);
break;
case RQS_ID:
CheckLabel(&RQS_buf[0],&ReqLabel[0]);
ActivateGadget(&CLR,wds,NULL);
break;
case CLR_ID:
CheckLabel(&CLR_buf[0],&ColorLabel[0]);
ActivateGadget(&IMG,wds,NULL);
break;
case IMG_ID:
CheckLabel(&IMG_buf[0],&ImageLabel[0]);
ActivateGadget(&SBL,wds,NULL);
break;
case SBL_ID:
CheckLabel(&SBL_buf[0],&SharedLabel[0]);
ActivateGadget(&TXT,wds,NULL);
break;
case OKIDOKI_ID:
case CNC_ID:
running = FALSE;
break;
}
}
} while(running == TRUE);
CloseWindow(wds);
if(Gadget->GadgetID == OKIDOKI_ID) {
strcpy(&TextLabel[0],&TXT_buf[0]);
strcpy(&BorderLabel[0],&BRD_buf[0]);
strcpy(&MenuLabel[0],&MNU_buf[0]);
strcpy(&SubLabel[0],&SBI_buf[0]);
strcpy(&ItemLabel[0],&ITE_buf[0]);
strcpy(&SpecialLabel[0],&SPG_buf[0]);
strcpy(&ScreenLabel[0],&NWS_buf[0]);
strcpy(&ReqLabel[0],&RQS_buf[0]);
strcpy(&ColorLabel[0],&CLR_buf[0]);
strcpy(&ImageLabel[0],&IMG_buf[0]);
strcpy(&SharedLabel[0],&SBL_buf[0]);
Saved = FALSE;
}
}