Home » Archimedes archive » Acorn User » AU 1998-12.adf » Regulars » StarInfo/Granger/!Chemistry/PROCS/IconPROCs

StarInfo/Granger/!Chemistry/PROCS/IconPROCs

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1998-12.adf » Regulars
Filename: StarInfo/Granger/!Chemistry/PROCS/IconPROCs
Read OK:
File size: 043F bytes
Load address: 0000
Exec address: 0000
File contents
   10REM  ### ICON PROCS ###
   20
   30DEF FNreadicon(win%,icon%)
   40!b%=win%:b%!4=icon%
   50SYS "Wimp_GetIconState",,b%
   60IF b%!32<>0 THEN T$=$b%!28 ELSE T$=$(b%+24)
   70=T$
   80
   90DEF PROCicontext(win%,icon%,text$)
  100!b%=win%:b%!4=icon%
  110SYS "Wimp_GetIconState",,b%
  120$(b%!28)=text$
  130b%!8=0:b%!12=0
  140SYS "Wimp_SetIconState",,b%
  150ENDPROC
  160
  170DEF FNcreate_icon(whan%,ix%,iy%,iw%,ih%,flag%,text$,ptr1%,ptr2%,ptr3%)
  180!b%=whan%
  190b%!4=ix%
  200b%!8=iy%
  210b%!12=ix%+iw%
  220b%!16=iy%+ih%
  230b%!20=flag%
  240IF ptr1%=0 THEN
  250$(b%+24)=text$
  260ELSE
  270b%!24=ptr1%:REM text%
  280b%!28=ptr2%:REM -1
  290b%!32=ptr3%:REM limit
  300ENDIF
  310SYS "Wimp_CreateIcon",,b% TO ihandle%
  320=ihandle%
  330
  340DEF FNicon_flags(text%,sp%,bor%,chor%,cver%,fill%,anti%,redraw%,ind%,rjust%,adj%,half%,button%,esg%,invert%,shade%,del%,fcol%,bcol%,font%)
  350LOCAL flag%
  360flag%=text%+(sp%<<1)+(bor%<<2)+(chor%<<3)+(cver%<<4)+(fill%<<5)+(anti%<<6)+(redraw%<<7)+(ind%<<8)+(rjust%<<9)+(adj%<<10)+(half%<<11)+(button%<<12)+(esg%<<16)+(invert%<<21)+(shade%<<22)+(del%<<23)
  370IF anti%=0 THEN
  380 flag%+=(fcol%<<24)+(bcol%<<28)
  390ELSE
  400 flag%+=(font%<<24)
  410ENDIF
  420=flag%

�  ### ICON PROCS ###

� �readicon(win%,icon%)
(!b%=win%:b%!4=icon%
2ș "Wimp_GetIconState",,b%
<(� b%!32<>0 � T$=$b%!28 � T$=$(b%+24)
F=T$
P
Z!� �icontext(win%,icon%,text$)
d!b%=win%:b%!4=icon%
nș "Wimp_GetIconState",,b%
x$(b%!28)=text$
�b%!8=0:b%!12=0
�ș "Wimp_SetIconState",,b%
��
�
�G� �create_icon(whan%,ix%,iy%,iw%,ih%,flag%,text$,ptr1%,ptr2%,ptr3%)
�
!b%=whan%
�b%!4=ix%
�b%!8=iy%
�b%!12=ix%+iw%
�b%!16=iy%+ih%
�b%!20=flag%
�� ptr1%=0 �
�$(b%+24)=text$
�
b%!24=ptr1%:� text%
b%!28=ptr2%:� -1
"b%!32=ptr3%:� limit
,�
6'ș "Wimp_CreateIcon",,b% � ihandle%
@
=ihandle%
J
T�� �icon_flags(text%,sp%,bor%,chor%,cver%,fill%,anti%,redraw%,ind%,rjust%,adj%,half%,button%,esg%,invert%,shade%,del%,fcol%,bcol%,font%)
^� flag%
h�flag%=text%+(sp%<<1)+(bor%<<2)+(chor%<<3)+(cver%<<4)+(fill%<<5)+(anti%<<6)+(redraw%<<7)+(ind%<<8)+(rjust%<<9)+(adj%<<10)+(half%<<11)+(button%<<12)+(esg%<<16)+(invert%<<21)+(shade%<<22)+(del%<<23)
r� anti%=0 �
|# flag%+=(fcol%<<24)+(bcol%<<28)
��
� flag%+=(font%<<24)
��
�
=flag%
�
00000000  0d 00 0a 19 f4 20 20 23  23 23 20 49 43 4f 4e 20  |.....  ### ICON |
00000010  50 52 4f 43 53 20 23 23  23 0d 00 14 04 0d 00 1e  |PROCS ###.......|
00000020  1b dd 20 a4 72 65 61 64  69 63 6f 6e 28 77 69 6e  |.. .readicon(win|
00000030  25 2c 69 63 6f 6e 25 29  0d 00 28 17 21 62 25 3d  |%,icon%)..(.!b%=|
00000040  77 69 6e 25 3a 62 25 21  34 3d 69 63 6f 6e 25 0d  |win%:b%!4=icon%.|
00000050  00 32 1e c8 99 20 22 57  69 6d 70 5f 47 65 74 49  |.2... "Wimp_GetI|
00000060  63 6f 6e 53 74 61 74 65  22 2c 2c 62 25 0d 00 3c  |conState",,b%..<|
00000070  28 e7 20 62 25 21 33 32  3c 3e 30 20 8c 20 54 24  |(. b%!32<>0 . T$|
00000080  3d 24 62 25 21 32 38 20  8b 20 54 24 3d 24 28 62  |=$b%!28 . T$=$(b|
00000090  25 2b 32 34 29 0d 00 46  07 3d 54 24 0d 00 50 04  |%+24)..F.=T$..P.|
000000a0  0d 00 5a 21 dd 20 f2 69  63 6f 6e 74 65 78 74 28  |..Z!. .icontext(|
000000b0  77 69 6e 25 2c 69 63 6f  6e 25 2c 74 65 78 74 24  |win%,icon%,text$|
000000c0  29 0d 00 64 17 21 62 25  3d 77 69 6e 25 3a 62 25  |)..d.!b%=win%:b%|
000000d0  21 34 3d 69 63 6f 6e 25  0d 00 6e 1e c8 99 20 22  |!4=icon%..n... "|
000000e0  57 69 6d 70 5f 47 65 74  49 63 6f 6e 53 74 61 74  |Wimp_GetIconStat|
000000f0  65 22 2c 2c 62 25 0d 00  78 12 24 28 62 25 21 32  |e",,b%..x.$(b%!2|
00000100  38 29 3d 74 65 78 74 24  0d 00 82 12 62 25 21 38  |8)=text$....b%!8|
00000110  3d 30 3a 62 25 21 31 32  3d 30 0d 00 8c 1e c8 99  |=0:b%!12=0......|
00000120  20 22 57 69 6d 70 5f 53  65 74 49 63 6f 6e 53 74  | "Wimp_SetIconSt|
00000130  61 74 65 22 2c 2c 62 25  0d 00 96 05 e1 0d 00 a0  |ate",,b%........|
00000140  04 0d 00 aa 47 dd 20 a4  63 72 65 61 74 65 5f 69  |....G. .create_i|
00000150  63 6f 6e 28 77 68 61 6e  25 2c 69 78 25 2c 69 79  |con(whan%,ix%,iy|
00000160  25 2c 69 77 25 2c 69 68  25 2c 66 6c 61 67 25 2c  |%,iw%,ih%,flag%,|
00000170  74 65 78 74 24 2c 70 74  72 31 25 2c 70 74 72 32  |text$,ptr1%,ptr2|
00000180  25 2c 70 74 72 33 25 29  0d 00 b4 0d 21 62 25 3d  |%,ptr3%)....!b%=|
00000190  77 68 61 6e 25 0d 00 be  0c 62 25 21 34 3d 69 78  |whan%....b%!4=ix|
000001a0  25 0d 00 c8 0c 62 25 21  38 3d 69 79 25 0d 00 d2  |%....b%!8=iy%...|
000001b0  11 62 25 21 31 32 3d 69  78 25 2b 69 77 25 0d 00  |.b%!12=ix%+iw%..|
000001c0  dc 11 62 25 21 31 36 3d  69 79 25 2b 69 68 25 0d  |..b%!16=iy%+ih%.|
000001d0  00 e6 0f 62 25 21 32 30  3d 66 6c 61 67 25 0d 00  |...b%!20=flag%..|
000001e0  f0 0f e7 20 70 74 72 31  25 3d 30 20 8c 0d 00 fa  |... ptr1%=0 ....|
000001f0  12 24 28 62 25 2b 32 34  29 3d 74 65 78 74 24 0d  |.$(b%+24)=text$.|
00000200  01 04 05 cc 0d 01 0e 17  62 25 21 32 34 3d 70 74  |........b%!24=pt|
00000210  72 31 25 3a f4 20 74 65  78 74 25 0d 01 18 14 62  |r1%:. text%....b|
00000220  25 21 32 38 3d 70 74 72  32 25 3a f4 20 2d 31 0d  |%!28=ptr2%:. -1.|
00000230  01 22 17 62 25 21 33 32  3d 70 74 72 33 25 3a f4  |.".b%!32=ptr3%:.|
00000240  20 6c 69 6d 69 74 0d 01  2c 05 cd 0d 01 36 27 c8  | limit..,....6'.|
00000250  99 20 22 57 69 6d 70 5f  43 72 65 61 74 65 49 63  |. "Wimp_CreateIc|
00000260  6f 6e 22 2c 2c 62 25 20  b8 20 69 68 61 6e 64 6c  |on",,b% . ihandl|
00000270  65 25 0d 01 40 0d 3d 69  68 61 6e 64 6c 65 25 0d  |e%..@.=ihandle%.|
00000280  01 4a 04 0d 01 54 8b dd  20 a4 69 63 6f 6e 5f 66  |.J...T.. .icon_f|
00000290  6c 61 67 73 28 74 65 78  74 25 2c 73 70 25 2c 62  |lags(text%,sp%,b|
000002a0  6f 72 25 2c 63 68 6f 72  25 2c 63 76 65 72 25 2c  |or%,chor%,cver%,|
000002b0  66 69 6c 6c 25 2c 61 6e  74 69 25 2c 72 65 64 72  |fill%,anti%,redr|
000002c0  61 77 25 2c 69 6e 64 25  2c 72 6a 75 73 74 25 2c  |aw%,ind%,rjust%,|
000002d0  61 64 6a 25 2c 68 61 6c  66 25 2c 62 75 74 74 6f  |adj%,half%,butto|
000002e0  6e 25 2c 65 73 67 25 2c  69 6e 76 65 72 74 25 2c  |n%,esg%,invert%,|
000002f0  73 68 61 64 65 25 2c 64  65 6c 25 2c 66 63 6f 6c  |shade%,del%,fcol|
00000300  25 2c 62 63 6f 6c 25 2c  66 6f 6e 74 25 29 0d 01  |%,bcol%,font%)..|
00000310  5e 0b ea 20 66 6c 61 67  25 0d 01 68 c7 66 6c 61  |^.. flag%..h.fla|
00000320  67 25 3d 74 65 78 74 25  2b 28 73 70 25 3c 3c 31  |g%=text%+(sp%<<1|
00000330  29 2b 28 62 6f 72 25 3c  3c 32 29 2b 28 63 68 6f  |)+(bor%<<2)+(cho|
00000340  72 25 3c 3c 33 29 2b 28  63 76 65 72 25 3c 3c 34  |r%<<3)+(cver%<<4|
00000350  29 2b 28 66 69 6c 6c 25  3c 3c 35 29 2b 28 61 6e  |)+(fill%<<5)+(an|
00000360  74 69 25 3c 3c 36 29 2b  28 72 65 64 72 61 77 25  |ti%<<6)+(redraw%|
00000370  3c 3c 37 29 2b 28 69 6e  64 25 3c 3c 38 29 2b 28  |<<7)+(ind%<<8)+(|
00000380  72 6a 75 73 74 25 3c 3c  39 29 2b 28 61 64 6a 25  |rjust%<<9)+(adj%|
00000390  3c 3c 31 30 29 2b 28 68  61 6c 66 25 3c 3c 31 31  |<<10)+(half%<<11|
000003a0  29 2b 28 62 75 74 74 6f  6e 25 3c 3c 31 32 29 2b  |)+(button%<<12)+|
000003b0  28 65 73 67 25 3c 3c 31  36 29 2b 28 69 6e 76 65  |(esg%<<16)+(inve|
000003c0  72 74 25 3c 3c 32 31 29  2b 28 73 68 61 64 65 25  |rt%<<21)+(shade%|
000003d0  3c 3c 32 32 29 2b 28 64  65 6c 25 3c 3c 32 33 29  |<<22)+(del%<<23)|
000003e0  0d 01 72 0f e7 20 61 6e  74 69 25 3d 30 20 8c 0d  |..r.. anti%=0 ..|
000003f0  01 7c 23 20 66 6c 61 67  25 2b 3d 28 66 63 6f 6c  |.|# flag%+=(fcol|
00000400  25 3c 3c 32 34 29 2b 28  62 63 6f 6c 25 3c 3c 32  |%<<24)+(bcol%<<2|
00000410  38 29 0d 01 86 05 cc 0d  01 90 17 20 66 6c 61 67  |8)......... flag|
00000420  25 2b 3d 28 66 6f 6e 74  25 3c 3c 32 34 29 0d 01  |%+=(font%<<24)..|
00000430  9a 05 cd 0d 01 a4 0a 3d  66 6c 61 67 25 0d ff     |.......=flag%..|
0000043f