home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 1: Collection A
/
17Bit_Collection_A.iso
/
files
/
1065.dms
/
1065.adf
/
TextPlus
/
SrcE.lzh
/
SrcE
/
gadgetsE.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-08-10
|
3KB
|
119 lines
/*
* gadgetsE.c © by Martin Steppler
*/
USHORT DArrowData[] = /* Down Arrow */
{
0xFFFF,0xF81F,0xF81F,0xF81F,0xF81F,0x8001,0xE007,0xF81F,0xFE7F
};
USHORT UArrowData[] = /* Up Arrow */
{
0xFE7F,0xF81F,0xE007,0x8001,0xF81F,0xF81F,0xF81F,0xF81F,0xFFFF
};
struct Image Arrows[] =
{
{0,0,16,9,2,UArrowData,0x0001,0x0000,NULL},
{0,0,16,9,2,DArrowData,0x0001,0x0000,NULL},
};
struct Gadget ArrowGads[] =
{
{
NULL, 624, ABSMAY*8-12, 16,9, GADGIMAGE, RELVERIFY|GADGIMMEDIATE,
BOOLGADGET|GZZGADGET,(APTR)&Arrows[0], NULL, NULL, EOS, NULL, 4, NULL
},
{
&ArrowGads[0],624, ABSMAY*8-3,16,9,GADGIMAGE, RELVERIFY|GADGIMMEDIATE,
BOOLGADGET|GZZGADGET,(APTR)&Arrows[1], NULL, NULL, EOS, NULL, 3, NULL
}
};
struct PropInfo VertSliderSInfo = {
AUTOKNOB|FREEVERT, /* PropInfo flags */
-1,-1, /* horizontal and vertical pot values */
-1,-1, /* horizontal and vertical body values */
};
struct Image Image3 =
{0,0,7,ABSMAY*8-41-12,0, NULL,0x0000,0x0000, NULL};
struct Gadget VertSlider =
{
&ArrowGads[1], 624,41, 16,ABSMAY*8-41-12, NULL,
GADGIMMEDIATE|RELVERIFY,
PROPGADGET|GZZGADGET, /* Proportional Gadget */
(APTR)&Image3, /* Slider Imagry */
NULL,NULL,EOS,
(APTR)&VertSliderSInfo, /* SpecialInfo structure */
2, NULL
};
#define LINE_HEIGHT 9
/* for showing the list information */
int TOT_DISPLAY=ABSMAY-MIY, numentries, topentry;
/* Initialize the proportional gadget
*/
InitSlider(g)
struct Gadget *g;
{
int oldnum=numentries;
numentries=se*(SEITE+1)+ze;
if(numentries>TOT_DISPLAY)
{
NewModifyProp(g,Fenster,NULL,AUTOKNOB|FREEVERT,
NULL,((MAXBODY*topentry)/(numentries)),
MAXBODY,((MAXBODY*TOT_DISPLAY)/numentries),1L);
}
else if(oldnum!=numentries)
{
NewModifyProp(g,Fenster,NULL,AUTOKNOB|FREEVERT,
NULL,NULL,MAXBODY,MAXBODY,1L);
}
}
/* Get the current entry, based on either the movement of the
* proportional gadget, or the pressing of the arrow keys.
*/
GetSlider(g, dir)
struct Gadget *g;
SHORT dir;
{
struct PropInfo *p;
int oldtop=topentry, len;
p=(struct PropInfo *)g->SpecialInfo;
if(dir!=0)
{
if(dir==1) {
if(y<MAY) CrsrBot();
for(len=1; len<=MAY-MIY; len++) YZPlus();
}
else {
if(y>MIY) CrsrTop();
for(len=1; len<=MAY-MIY; len++) YZMinus();
}
}
else
{
if(numentries>TOT_DISPLAY)
topentry=(p->VertPot*(numentries-TOT_DISPLAY))/MAXBODY;
else topentry=0L;
if(oldtop!=topentry) {
s=topentry/(SEITE+1); z=topentry%(SEITE+1); y=MIY;
if(blo==2) {
if(oldtop>topentry) blo=6; else blo=4;
}
SText(); ZSDisplay();
}
}
meld=FALSE;
}