home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Datafile PD-CD 4
/
DATAFILE_PDCD4.iso
/
utilities
/
utilsp
/
pca
/
!Spaint
/
!Runimage
(
.txt
)
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
RISC OS BBC BASIC V Source
|
1996-08-17
|
53.7 KB
|
1,993 lines
>!RunImage
SPaint 0.04
Rob Davison 1996
Updated sometime...
Code sections relating to the PCA are commented !!!PCA!!!
not particularly easy to follow still...Sorry!
Now use PCA 'tags' and the PCASupport Module
$+" "+
init_variables
initall:
assemble_blit:
init_Wimp
reperr(
$+"at code "+
poll:
terminate
called on desktop mode change and when new object linked in.
creates colour translation tables for display of sprites.
initsptrans
XCtGet%,sblock%,"grad",-1,-1,sgblkg%,0
!!!PCA!!!
update display
translation settings on mode changes/new objects
remotetag%>0
"XWimp_ReadPixTrans",&200,!remotetag%,!remotetag%+remotetag%!4,,,,stransW%,sgblk%
XCtGet%,!remotetag%,!remotetag%+remotetag%!4,-1,-1,sgblk%,1
AstransWx=stransW%!8/!stransW%:stransWy=stransW%!12/stransW%!4
Spop%,552,!remotetag%,!remotetag%+remotetag%!4
,,,xwhook%,ywhook%
spria%>0
reference via the tag is not strictly necessary here as it is a local
object - but just for forms sake...
"XWimp_ReadPixTrans",&200,!localtag%,!localtag%+localtag%!4,,,,stransW%,sgblkB%
XCtGet%,!localtag%,!localtag%+localtag%!4,-1,-1,sgblkB%,1
"OS_ReadModeVariable",-1,3
,,nocol%
&35,-1,11
,,sw%:
&35,-1,12
,,sh%
&35,-1,4
,,xpix%:
&35,-1,5
,,ypix%
xpixf=xpix%:ypixf=ypix%
,!xpix%=1<<xpix%:ypix%=1<<ypix%
-'sw%=xpix%*(sw%+1):sh%=ypix%*(sh%+1)
redraw the 'remote' (linked) sprites window.
rdremote(f%)
Wupdw%,,Wb%
more%
Wrdw%,,Wb%
more%
3&x0%=Wb%!4-Wb%!20:y0%=Wb%!16-Wb%!24
more%
53wx0%=Wb%!28:wy0%=Wb%!32:wx1%=Wb%!36:wy1%=Wb%!40
remotetag%>0
XSpop%,564,!remotetag%,!remotetag%+remotetag%!4,x0%,y0%,0,stransW%,sgblk%
sc(0,0,0):
x0%,y0%,xwhook%*2,ywhook%*2
Wgr%,0,Wb%
more%
redraw the 'local' sprites window.
rdlocal(f%)
Wupdw%,,Wb%
more%
Wrdw%,,Wb%
more%
B&x0%=Wb%!4-Wb%!20:y0%=Wb%!16-Wb%!24
more%
D3wx0%=Wb%!28:wy0%=Wb%!32:wx1%=Wb%!36:wy1%=Wb%!40
localtag%>0
XSpop%,564,!localtag%,!localtag%+localtag%!4,x0%,y0%,0,stransW%,sgblkB%
sc(0,0,0):
x0%,y0%,xwL%*2,ywL%*2
Wgr%,0,Wb%
more%
find the width of a text string in the current desktop font.
twid(s$)
"XOS_SWINumberFromString",,"Wimp_TextOp"
1)=0
"XWimp_TextOp",1,s$,0
(s$)*16
print some text in the current desktop font.
pp(x%,y%,tt$,bg%)
"XWimp_TextOp",0,0,bg%
"XWimp_TextOp",2+(1<<30),tt$,-1,-1,x%,y%
work out the width of a PCA dialogue item.
uses fixed values for all but the width of the item name which can vary.
uwid(s$,xx%)
twid(s$)
xx%<>0
=v%+32+40+64+84
!!!PCA!!!
redraw pca dialogue box window.
chosen%,down% are for when an item is chosen
in order to simulate the button 'clicking'
rdpca(f%,chosen%,down%)
Wupdw%,,Wb%
more%
Wrdw%,,Wb%
more%
l]xscrol%=Wb%!20:yscrol%=Wb%!24:x0%=Wb%!4-xscrol%+4:y1%=Wb%!8:x1%=Wb%!12:y0%=Wb%!16-yscrol%
"Wimp_BaseOfSprites"
,spa%
more%
o&menu$=
util$,
(util$)-
util$,"\"))
p%=0:yy%=y0%+4
pca%=0
utile%-1
par("\",p%)
chosen%=pca%
down%
sc(&99,&99,&BB)
sc(&AA,&AA,&CC)
x0%,yy%+pca%*(uboxh%+8),uboxw%,uboxh%
uAA%=x0%:B%=yy%+pca%*(uboxh%+8):C%=A%+uboxw%:D%=B%+uboxh%:
chosen%=pca%
down% A%+=4:B%-=4
display the sprite for this item.
utils$(pca%)<>""
XCtGet%,spa%,utils$(pca%),-1,-1,savea%,0
XSpop%,308,spa%,utils$(pca%),A%+12,B%+(uboxh%-68)/2,8,stransW%,savea%
display 'sm!info' if info available flag for this item is set.
"XWimp_ReadPixTrans",&100,sblock%,"sm!info",,,,stransW%,savea%
(uf%(pca%)
%10)<>0
XSpop%,308,sblock%,"sm!info",A%+uboxw%-48,B%+(uboxh%-40)/2,8,stransW%,savea%
display the items name.
chosen%=pca%
down%
pp(A%+((uboxw%-
twid(s$))/2),B%+uboxh%/2-12,s$,&BB999900)
pp(A%+((uboxw%-
twid(s$))/2),B%+uboxh%/2-12,s$,&CCAAAA00)
Wgr%,0,Wb%
more%
main redraw request proc.
redraw(f%)
w%=!Wb%
m_remote%:
rdremote(f%)
m_local%:
rdlocal(f%)
pca_w%:
rdpca(f%,-1,0)
Wimp Message receipt.
recieve_msg:
!Wb%
4:Wbtsk%!l%=Wb%!l%:
:le%=!Wb%:tsk%=Wb%!4
msg$=
s(Wb%+44):mess%=Wb%!16
mess%
terminate
2:EX%=
Wb%!4<>Task_h%
savingfile%
mox%=Wb%!28:moy%=Wb%!32:
savefile(
s(Wb%+44),Wb%!36=-1):savingfile%=
EX%=
Wbtsk%!12=Wbtsk%!8:Wbtsk%!16=3:
"Wimp_SendMessage",17,Wbtsk%,tsk%
EX%=
EX%=0
Wb%!40<&1000
read_andload(
s(Wb%+44),Wb%!40,Wb%!20,Wb%!24)
EX%=
Wb%!12=scrapref%
*REMOVE <Wimp$Scrap>
EX%=
Wbtsk%!12=Wbtsk%!8:Wbtsk%!16=4:
"Wimp_SendMessage",17,Wbtsk%,tsk%
!!!PCA!!! Incoming message handling
Receipt of Msg_ImHere - record details
Msg_Im%
utile%<24
Gutil$=util$+"\"+
s(Wb%+28):utiltsk%(utile%)=tsk%:uf%(utile%)=Wb%!20
IFuf%(utile%) AND %10000<>0 THEN uf%(utile%)=uf%(utile%) AND &FFFFFFEF
Wb%!20
1<>0
utils$(utile%)=
s(Wb%+60)
utilid%(utile%)=Wb%!24
uwid(
s(Wb%+28),Wb%!20)
uboxw%<v% uboxw%=v%
utile%+=1
Msg_Info%:
tsk%<>Task_h%
Wbtsk%!12=0
Receipt of Message_Info - return an info string.
/s$="Spaint - a very simple paint program. "
remotetag%>0
s$=s$+"Linked to '"+wn$+"'"
s$=s$+"Not linked to anything."
string0(Wbtsk%+20,s$):!Wbtsk%=24+
s(Wbtsk%+20))
Wbtsk%!12=Wbtsk%!8
Wmess%,17,Wbtsk%,tsk%
return of Message_Info - display info string (if any)
Wb%!12=myref%
s(Wb%+20)<>""
repmsg(
s(Wb%+20))
Receipt of Message_WhosAbout - check details of object and respond with ImHere
Msg_Whos%
(Wb%!20
&FFF)=&FF9
tsk%<>Task_h%
v%=Wb%!24:v%=(!v%+v%!4)!40)>>27:IFv%=6 THEN:REM only 32bpp sprites need apply?
1gb%!4=Task_h%:gb%!8=0:gb%!12=0:gb%!16=Msg_Im%
inplace%
gb%!20=%10011
gb%!20=%11:
flags word
,gb%!24=0:
string0(gb%+28,"Simple Paint")
string0(gb%+60,"!spaint"):!gb%=64+(
s(gb%+60))
Wmess%,17,gb%,tsk%
ENDIF
Following not used by this example. This message is
returned after the owning task has successfully changed the size of the
object in response to Message_Resize sent. Check myref before acting
as it may be a resize request by another program.
Msg_ResizeAck%
Wb%!12=myref%
dotheresize:myref%=0
Receipt of Message_DoYourStuff
open remote window and display the object.
Msg_Do%
tsk%=Wb%!4
are we already editing something?
if so (and its not this tag), send the old local task an unhook...
remotetag%>0
remotetag%<>Wb%!24
tskh%=localtask%:ms0%=0:ms1%=remotetag%:
pca(Msg_Unhook%)
new local task...
localtask%=Wb%!4
uflg%=Wb%!36
beginning an inplace session so close the remote window (if open).
(uflg%
%10000)<>0
inplace%
CwT(m_remote%)
newmunge
inplace on so opentoolbar and send Msg_Hook (which will generate msg_ObjPos for us)
(uflg%
%10000)<>0
remotetag%>0
inplace%
tskh%=localtask%:
pca(Msg_Hook%):
Ow(w_remotet%,-1,-1,-1)
object position message.
open toolbar at correct position and depth
Msg_ObjPos%
Wb%!24=remotetag%
=remotescale%=Wb%!48:remotexpos%=Wb%!52:remoteypos%=Wb%!56
Dremotescaley%=Wb%!28:
remotescaley%=0 remotescaley%=remotescale%
xown%=Wb%!32:yown%=Wb%!36
!gblk%=w_remotet%:gblk%!4=Wb%!32:gblk%!8=Wb%!36-64:gblk%!12=gblk%!4+192:gblk%!16=gblk%!8+64:gblk%!20=0:gblk%!24=0:gblk%!28=Wb%!44:
Wow%,,gblk%
sent an unhook message.
as Spaint can handle both sides of the protocol it
must check to see if it is the remote or local task which is asking it
to unhook.
Msg_Unhook%
remote task - therefore we are the local so delete trap icon.
Wb%!24=localtag%
tsk%=remotetask%
deleteRicon(0):aremote%=-1:remotetask%=0
local task - therefore we are the remote so close window/toolbar
Wb%!24=remotetag%
tsk%=localtask%
remotetag%=-1:
Cw(m_remote%):
Cw(w_remotet%):localtask%=0
sent a hook message by a remote task
create a trap icon and send Msg_ObjPos
Msg_Hook%
Wb%!24=localtag%
?remotewin%=Wb%!32:remotetask%=Wb%!4:aremote%=0:rbut%=Wb%!28
5remoteicon%=
createRicon(0,0,xwL%*2,ywL%*2,rbut%)
gwi(m_local%):y1a%=y1%-yscrol%:yscrola%=yscrol%:xscrola%=xscrol%
xposU%=winx%:yposU%=y1a%
xposL%=xposU%:yposL%=yposU%
xposL%<x0%
xposL%=x0%
yposL%<y0%
yposL%=y0%
xposL%>x1%
xposL%=x1%
yposL%>y1%
yposL%=y1%
sfac%=65536:
100% scale
Jms2%=m_local%:ms3%=w_localt%:v%=s%:tskh%=remotetask%:
pca(Msg_ObjPos%)
Message_Changed message
assume nothing is the same!
Msg_Changed%
Wb%!24=remotetag%
newmunge
Wb%!24=localtag%
tsk%<>Task_h%
prime_local(local$):
redrawit(m_local%)
Message_Deselect - delink from object as it has been deleted.
Msg_Desel%
Wb%!24=localtag%
aremote%>=0
deleteRicon(0):aremote%=-1
Wb%!24=remotetag%
remotetag%=0:localtask%=0
#wn$="Nothing":$maint%="Nothing"
maino%
redrawit(m_remote%)
Cw(w_remotet%)
Message_Done% someone has modified the entire object
so redraw it. Its size and other parameters are still the same though.
Msg_Done%
remotetag%=Wb%!24
redrawit(m_remote%)
Wb%!24=localtag%
redrawit(m_local%)
Message_UpdateArea - an area of the object has been modified
update the correct area of the window quickly.
Msg_Uparea%
remotetag%=Wb%!24
+=ms0%=Wb%!28:ms1%=Wb%!32:ms2%=Wb%!36-ms0%:ms3%=Wb%!40-ms1%
spritexm%=4:spriteym%=4
redrawW(m_remote%,ms0%,ms1%,ms2%,ms3%)
localtag%=Wb%!24
0=ms0%=Wb%!28:ms1%=Wb%!32:ms2%=Wb%!36-ms0%:ms3%=Wb%!40-ms1%
spritexm%=4:spriteym%=4
redrawW(m_local%,ms0%,ms1%,ms2%,ms3%)
Example return from Message_MiscOp (Compo_GiveDetails)
not used by this program.
Msg_Misc%:
tsk%<>Task_h%
Wb%!20
Sub_Associated%
'"Details of object "
'"Masks:"
xx%=0
xx%;" address="~Wb%!(40+xx%*4):
'"Opacity=";Wb%!68
"Math=";Wb%!72
&400C1:
initsptrans
&400C0:
"Wimp_CreateSubMenu",,Wb%!20,Wb%!24,Wb%!28
&502:
helptext
&47700,&47701:vh%=Wb%!20:v2%=Wb%!28:
mess%=&47700
oFCOL1%=v2%
(Wb%!24
1)=1
v2%=-1
mx%,my%,bt%:
(bt%=5
mess%=&47700)
ColourChanged
pcol%=v2%:oFCOL1%=pcol%
mess%=-1
&47702:vh%=Wb%!20:v2%=Wb%!28
mx%,my%,b%
pcol%=oFCOL1%
b%<>1
&67703,0,Wb%!20:lcpw%=0
!!!PCA!!!
new or radically modified remote object so re-read its details (width and height may have changed etc.)
newmunge
Wb%!20<>&FF9
woops, we can't edit that...
remotetag%>0
tskh%=localtask%:ms0%=0:ms1%=remotetag%:
pca(Msg_Unhook%)
Z0remotetag%=-1:wn$="Nothing":
Cw(m_remote%):
remotetag%=Wb%!24
mess%=Msg_Do%
wn$=
s(Wb%+40):
wn$=""
wn$="<The image with no name>"
mess%=Msg_Changed%
s(Wb%+32):
w$<>""
wn$=w$
initsptrans
Spop%,552,!remotetag%,!remotetag%+remotetag%!4
,,,xwhook%,ywhook%
(uflg%
%10000)=0
inplace%=0
prime_remote:
Ow(m_remote%,-1,-1,-1)
!!!PCA!!!
new/updated local image
broadcast Message_Changed
alternative would be to broadcast Message_Deselect for old object.
in this case we ask anyone who was linked into the old object
to accept the new one. This may fail (eg new object is different type/bpp)
in which case the app receiving Message_Changed should delink quietly
loadsprite(s$)
local$=s$
r_fi(s$):spril%=length%
doclaimg(spril%,spria%,"mem1","SPaint image",m64%)
rGlocal%=
ourarea(spria%):!local%=spril%:
"LOAD "+s$+" "+
~(local%+4)
s3local2%=local%+local%!8:
first sprite in area.
!!!PCA!!!
localtag%=-1
"PCA_CreateTag",,local%,local%!8,!local%,0
localtag%
x+localtag%!0=local%:localtag%!4=local%!8
hack - we can't resize when the window is open!
{-!Wb%=m_local%:
"XWimp_CloseWindow",,Wb%
prime_local(s$)
Ow(m_local%,-1,-1,-1)
redrawit(m_local%)
7ms0%=localtag%:ms0$=
gls(local$):
pca(Msg_Changed%)
mini_poll(8)
aremote%>=0
resizeRicon(0,0,0,xwL%*xpix%,ywL%*ypix%)
open the local window to suit the new size of the object.
prime_local(s$)
local2%=local%+local%!8
Spop%,552,!localtag%,!localtag%+localtag%!4
,,,xwL%,ywL%
local%>0
"Wimp_ReadPixTrans",&200,!localtag%,!localtag%+localtag%!4,,,,stransW%,sgblkB%
XCtGet%,!localtag%,!localtag%+localtag%!4,-1,-1,sgblkB%,1
setsize(m_local%,ywL%*ypix%/ypixf,xwL%*xpix%/xpixf)
$localt%="Local:"+s$
prime_remote
setsize(m_remote%,ywhook%*ypix%/ypixf,xwhook%*xpix%/xpixf)
$maint%="Linked to:"+wn$
maino%
!Wb%=m_remote%:
Wgwst%,,Wb%:
CwT(m_remote%):x%=Wb%!4:y%=Wb%!8
x%=-1:y%=-1
Ow(m_remote%,x%,y%,-1)
quit the program.
terminate
!!!PCA!!! local must remember to broadcast Msg_Desel before removing your object.
localtag%>0
pca(Msg_Desel%)
localtag%>0
"PCA_DeleteTag",localtag%:localtag%=-1
!!!PCA!!! remote must send Msg_Unhook before quitting.
remotetag%>0
tskh%=remotetask%:ms0%=1:ms1%=remotetag%:
pca(Msg_Unhook%)
spril%=0:
killara(spria%)
ms_end
"Wimp_CloseDown",Task_h%:
"XOS_Exit"
user clicked in a remote window.
remote_win
Bt%=2
gpi:ppick%=
picker("Paint colour",pcol%,mox%-128,moy%+128,%1,%100)
remotetag%=0
Icn%<>-&414350
G!gb%=m_remote%:
Wgwst%,,gb%:winx%=gb%!4-gb%!20:y1a%=gb%!16-gb%!24
scalefacX=1:scalefacY=1
"moy%=moy%-y1a%:mox%=mox%-winx%
scalefacX=remotescale%/65536
!scalefacY=remotescaley%/65536
&winx%=remotexpos%:y1a%=remoteypos%
omox%=mox%:omoy%=moy%
swtos(!remotetag%,!remotetag%+remotetag%!4)
Bt%=4
CtSgcol%,pcol%,,,256,0
Bt%=1
CtSgcol%,0,,,256,0
mox%,moy%,size2%
swbak
Kms0%=mox%-size2%:ms1%=moy%-size2%:ms2%=mox%+size2%+4:ms3%=moy%+size2%+4
ms0%<0 ms0%=0
ms1%<0 ms1%=0
ms2%>xwhook%*2 ms2%=xwhook%*2
ms3%>ywhook%*2 ms3%=ywhook%*2
maino%
`!Wb%=m_remote%:Wb%!4=ms0%*mscd:Wb%!8=ms1%*mscd:Wb%!12=Wb%!4+ms2%*mscd:Wb%!16=Wb%!8+ms3%*mscd
Wupdw%,,Wb%
more%
&x0%=Wb%!4-Wb%!20:y0%=Wb%!16-Wb%!24
more%
Spop%,564,!remotetag%,!remotetag%+remotetag%!4,x0%,y0%,0,stransW%,sgblk%
Wgr%,0,Wb%
more%
!!!PCA!!!
user has painted into remote object so
broadcast message_updatearea so other apps using
the object can redraw the appropriate part of their windows
pca(Msg_Uparea%)
mini_poll(1)
gpi:mox%=mox%-winx%:moy%=moy%-y1a%
+mox%=mox%/scalefacX:moy%=moy%/scalefacY
Bt%=0
Riconpositions
do resizeRicon for each linked object which has moved
delete 'remote' trap icon
this is a _simple_ version as Spaint
can only handle one object at a time.
more sophistocated apps will have to do better.
deleteRicon(i%):
i%<0
9!gblk%=m_local%:gblk%!4=i%:
"Wimp_DeleteIcon",,gblk%
i%*32+remoteicblk%=ricptr%-32
ricptr%-=32
(ricptr%!20
1<<23)<>0
ricptr%>remoteicblk%
ricptr%-=32
resize 'remote' trap icon
resizeRicon(i%,x%,y%,w%,h%)
"XWimp_ResizeIcon",m_local%,i%,x%,y%,(x%+w%),(y%+h%)
r0;F
IF (F AND 1)<>0 THEN PROCreperr(FNs(r0+4)):ENDPROC
gwi(m_local%):y1a%=y1%-yscrol%:yscrola%=yscrol%:xscrola%=xscrol%
xposU%=winx%:yposU%=y1a%
xposL%=xposU%:yposL%=yposU%
xposL%<x0%
xposL%=x0%
yposL%<y0%
yposL%=y0%
xposL%>x1%
xposL%=x1%
yposL%>y1%
yposL%=y1%
sfac%=65536:
100% scale
Dms2%=m_local%:ms3%=w_localt%:tskh%=remotetask%:
pca(Msg_ObjPos%)
!!!PCA!!! create a 'remote' trap icon to cover the object
a simple version. For more complex apps (multiple objects)
something better will have to be done.
createRicon(x%,y%,w%,h%,flgs%)
ricptr%>=remoteicblk%+32*10
1,"Remote icon store full!"
#flgs%=flgs%>>28:flgs%=flgs%<<12
!ricptr%=m_local%
Cricptr%!4=x%:ricptr%!8=y%:ricptr%!12=(x%+w%):ricptr%!16=(y%+h%)
7ricptr%!20=flgs%:
Rbdr% ricptr%!20=ricptr%!20+%100
"Wimp_CreateIcon",aremote%,ricptr%
ricptr%+=32
!!!PCA!!!
send message on to remote task.
remotemessage(R%)
sp%=-1:y1a%=y1%-yscrol%
locate object which matches icon...
Icn%=remoteicon%
remotetask%<>0
Q!Wb%=!Wb%-winx%:Wb%!4=Wb%!4-y1a%:Wb%!8=tBt%:Wb%!12=remotewin%:Wb%!16=-&414350
"Wimp_SendMessage",R%,Wb%,remotetask%
!!!PCA!!!
Central Message despatch proc.
pca(msg%)
don't bother with remote update messages if no remote object in use:
remotetag%=0
(msg%=Msg_Resize%
msg%=Msg_Uparea%
msg%=Msg_Misc%)
7gb%!4=Task_h%:gb%!8=0:gb%!12=0:gb%!16=msg%:send%=17
msg%
Send Message_WhosAbout
Msg_Whos%
!util$="#Utilities":pcatask%=0
utiltsk%()=0:utile%=0
utilid%()=0
uf%()=0
#$uboxw%=0:
max width of dialogue
sprite, local tag
%)gb%!20=&FF9:gb%!24=localtag%:gb%!28=0
&%!gb%=32:th%=0:
broadcast message
Ask task for info about itself.
Msg_Info%
*!gb%!20=0:!gb%=24:th%=pcatask%
Tell task to do its stuff (link onto object)
Msg_Do%
.)gb%!20=&FF9:gb%!24=localtag%:gb%!28=0
/8gb%!32=utilid%(item%):gb%!36=uf%(item%):rflg%=gb%!36
string0(gb%+40,
gls(local$))
!gb%=44+
s(gb%+40))
2Bth%=utiltsk%(item%):
send message direct to appropriate task.
Broadcast message_done (not used by this program as it
has no 'whole object modified' functions).
Msg_Done%
gb%!20=&FF9
gb%!24=remotetag%:gb%!28=0
!gb%=32:th%=0
Broadcast Message_UpdateArea
so other tasks can redraw appropriate area of their windows.
Msg_Uparea%
>_gb%!20=&FF9:gb%!24=remotetag%:gb%!28=ms0%:gb%!32=ms1%:gb%!36=ms2%:gb%!40=ms3%:!gb%=44:th%=0
Send Resize_Request to owning task
not used by this program.
ms0% is the new size of the object
total size - including header.
owner will reply with ResizeAck if successful
Msg_Resize%
FMgb%!20=&FF9:gb%!24=remotetag%:gb%!28=0:gb%!32=ms0%:gb%!36=0:!gb%=40:th%=0
send%=18
Broadcast Message_Changed
sent when new local image and after ResizeAck and data structure changes.
Msg_Changed%
L$gb%!20=&FF9:gb%!24=ms0%:gb%!28=0
ms0$<>""
string0(gb%+32,ms0$):!gb%=36+
s(gb%+32))
gb%!32=0:!gb%=36
N th%=0
Broadcast Message_MiscOp with Sub_GiveInfoCompo
not used by this program.
Msg_Misc%
SIgb%!20=Sub_Give%:gb%!24=&FF9:gb%!28=remotetag%:gb%!32=0:!gb%=36:th%=0
Broadcast Message_Deselect as object has been deleted.
Msg_Desel%
gb%!20=&FF9
gb%!24=localtag%:gb%!28=0
YF!gb%=32:th%=0:pcatask%=0:remotetask%=0:
deleteRicon(0):aremote%=-1
send msg_objPos to remote task
see Wimp_Poll loop for call details.
Msg_ObjPos%
gb%!20=0
gb%!24=localtag%:gb%!28=0
`rgb%!32=xposL%:gb%!36=yposL%:gb%!40=ms2%:gb%!44=ms3%:gb%!48=sfac%:gb%!52=xposU%:gb%!56=yposU%:th%=tskh%:!gb%=60
send msg_Hook to local task
this asks it to trap messages to the object and
pass them back to us.
Msg_Hook%
gb%!20=0
f9gb%!24=remotetag%:gb%!28=%11<<28:
window button type
g&gb%!32=m_remote%:!gb%=36:th%=tskh%
send msg_unhook
Msg_Unhook%
gb%!20=0
gb%!24=ms1%:gb%!28=0
m1gb%!32=m_local%:gb%!36=ms0%:!gb%=40:th%=tskh%
Hey, thats our local tag (we'd better delete the trap icon...)
ms1%=localtag%
remotetask%=0:
deleteRicon(0):aremote%=-1
send the message and keep ref for checking in Message_Receipt
Wmess%,send%,gb%,th%:myref%=gb%!8
!!!PCA!!!
generate the plug-in dialogue
start by sending Message_WhosAbout and
poll until the messages stop flooding in.
pcasprite
pca(Msg_Whos%)
mini_poll(0)
RR%=0
util$="#Utilities"
repmsg("No utilities are available for this object at the moment. Please load a utility providing application and try again.")
simple menu...
popuptype%=1
Ocurrbuff%=cbstr%:maxbuff%=cbstr%+&80:menufree%=cbbuff%:menuend%=cbbuff%+&80
;m_pca%=
cmen(util$):
menu(m_pca%,mox%-186,moy%+12)
...or something more ambitious
>!Wb%=pca_w%:
"Wimp_DeleteWindow",,Wb%:c%=(1<<28)+(1<<29)
If more than five utilities give it a scrollbar (and limit opened size to five)
utile%>5
e%=(1<<28)+(1<<29)
e%=0
.pca_wblock%!28=(pca_wblock%!28
Wcw%,,pca_wblock%
pca_w%
maximum height of dialogue.
ole2h%=((uboxh%+8)*utile%)
open as a menu positioned such that the first item is centred about the mouse pointer.
setsize3(pca_w%,ole2h%,uboxw%+10,mox%-uboxw%/2,moy%-ole2h%/2):wh%=Wb%!16-Wb%!8
Cw(pca_w%):x%=mox%-uboxw%/2:y%=moy%+(uboxh%/2)
while coping with pointer near the edge of the screen!
x%<0 x%=0
y%-wh%<0 y%=wh%
Wcm%,,pca_w%,x%,y%
general proc. for setting the maximum extent of a window - modified to limit
the displayed size to a maximum of 5* the height of a pca dialogue item.
setsize3(whn%,h%,w%,x%,y%)
x%<0 x%=0
y%<0 y%=0
U!Wb%=whn%:
Wgwst%,,Wb%:Wb%!4=0:Wb%!8=0:Wb%!16=h%:Wb%!12=w%:
&600D7,whn%,(Wb%+4)
h%>(uboxh%+8)*5 Wb%!16=(uboxh%+8)*5
YWb%!28=-1:Wb%!4=Wb%!4+x%:Wb%!8=Wb%!8+y%:Wb%!12=Wb%!12+x%:Wb%!16=Wb%!16+y%:
Wow%,,Wb%
!!!PCA!!!
user has chosen an item in the PCA dialogue
either send Message_DoYourStuff or Message_Info
depending on flags and where user clicked.
pca_win
get window info an work out which button they clicked on.
gwi(pca_w%):oBt%=Bt%:y1a%=y1%-yscrol%
9item%=(moy%-y1a%)/(uboxh%+8):
item%>utile%-1 item%=-1
xx%=mox%-winx%
item%>=0
make the 'button' click
h!Wb%=pca_w%:Wb%!4=0:Wb%!8=item%*(uboxh%+8):Wb%!12=vissizX%:Wb%!16=Wb%!8+(uboxh%+2):
rdpca(
,item%,
Bt%=0
h!Wb%=pca_w%:Wb%!4=0:Wb%!8=item%*(uboxh%+8):Wb%!12=vissizX%:Wb%!16=Wb%!8+(uboxh%+2):
rdpca(
,item%,0)
pcatask%=utiltsk%(item%)
clicked on info or elsewhere in button?
xx%<uboxw%-42
((uf%(item%)
%10)=0)
Does the utility want sole access to the object?
(uf%(item%)
%1000)<>0
pca(Msg_Desel%)
make _sure_ there is a tag for the local object.
we do it when loading the object so this isn't strictly
necessary...If you don' want a PCA tag for every object
you create then this is the time to create it.
localtag%<0
"PCA_CreateTag",,local%,local%!8,0,0
localtag%
*!localtag%=local%:localtag%!4=local%!8
are we already in an inplace session?
if so, send an unhook to the previous remote...
((uf%(item%)
%10000)<>0
aremote%<>-1)
remotetask%=utiltsk%(item%)
remotetask%<>0
tskh%=remotetask%:ms0%=1:ms1%=localtag%:
pca(Msg_Unhook%)
tell the utility to do its stuff...
pcatsk%=utiltsk%(item%)
pca(Msg_Do%)
+pcatsk%=utiltsk%(item%):
pca(Msg_Info%)
Only close dialogue if SELECT clicked.
oBt%=4
Cw(pca_w%)
select_menu
check_adj=
adjusting%=
adjusting%=
mnhnd%=m_ibar%
!Wb%=2
terminate
mnhnd%=m_ibar%
!Wb%=1
oo(w_prefs%,4,inplace%):
Ow(w_prefs%,-1,-1,-1)
mnhnd%=mm_remote%
!Wb%
!!!PCA!!!
not used by demo, example 'change object size'
function.
double size request
Ucursize%=!remotetag%:cursize%=!cursize%:
read total size from sprite area header
Nadat%=!remotetag%+remotetag%!4:adat%=adat%+adat%!32:hdr%=adat%-!remotetag%
%ms0%=hdr%+xwhook%*4*2*(ywhook%*2)
pca(Msg_Resize%)
pca(Msg_Misc%)
mnhnd%=m_pca%
item%=!Wb%
(uf%(item%)
%1000)<>0
v%=0:
pca(Msg_Desel%)
pcatask%=utiltsk%(item%)
pca(Msg_Do%)
adjusting%
menu(mnhnd%,mousex%,mousey%):
mnhnd%=-1
prefs_win
Icn%
2,3:popuptype%=Icn%-2:
uiG(w_prefs%,2,3,0):
ui(w_prefs%,popuptype%+2,1<<21)
4:inplace%=
inplace%:
oo(w_prefs%,4,inplace%)
!!!PCA!!!
user has toggled inplace editing option
Did we begin with inplace on?
(uflg%
%10000)<>0
remotetag%>0
inplace%=0
yes, now off so send (temporary) unhook and open remote window.
=tskh%=localtask%:ms0%=0:ms1%=remotetag%:
pca(Msg_Unhook%)
prime_remote
maino%
!Wb%=m_remote%:
Wgwst%,,Wb%:
CwT(m_remote%):x%=Wb%!4:y%=Wb%!8
x%=-1:y%=-1
Ow(m_remote%,x%,y%,-1)
Ow(m_remote%,-1,-1,-1)
redrawit(m_remote%)
yes, and now turned on again so close our window and send Msg_Hook
CwT(m_remote%):tskh%=remotetask%:
pca(Msg_Hook%):
Ow(w_remotet%,-1,-1,-1)
remoteT_win
Icn%
!!!PCA!!! User has clicked close icon in remote toolbar - we unhook
0:tskh%=remotetask%:ms0%=1:ms1%=remotetag%:
pca(Msg_Unhook%):remotetag%=-1:
Cw(m_remote%):
Cw(w_remotet%)
1:ppick%=
picker("Paint colour",pcol%,mox%-128,moy%+128,%1,%100)
localT_win
Icn%
info
utils
pcasprite
close
!!!PCA!!!
localtag%>0
pca(Msg_Desel%):
Cw(m_local%)
click:tBt%=Wb%!8:Bt%=tBt%:mox%=Wb%!0:moy%=Wb%!4:Icn%=Wb%!16:Win%=Wb%!12
Win%
m_remote%:
remote_win
m_local%:
local_win
pca_w%:
pca_win
w_prefs%:
prefs_win
w_report%:
Icn%=0
Cw(w_report%)
w_remotet%:
remoteT_win
w_localt%:
localT_win
Icn%=icnbh%
Bt%=2
menu(m_ibar%,mox%-144,204)
Icn%=icnbh%
Bt%=4
remotetag%>0
localtag%>0
remotetag%>0
inplace%
7?EX%=0:
prime_remote:
EX%
Ow(m_remote%,-1,-1,-1)
EX%=0
remotetask%<>0
inplace%
remotetag%>0
Ow(w_remotet%,-1,-1,-1)
localtag%>0
prime_local(local$):
Ow(m_local%,-1,-1,-1)
reperr("Spaint has nothing to work on at the moment. Either link an image in or drag an image to the icon.")
*************************************************************************************************
bits'n pieces of little interest follow...
getpath(s$):n%=
(s$):
:ch$=
s$,n%,1):n%-=1:
(n%<=0
ch$="."
ch$=":"
ch$=
n%>0
s$,n%+1)
varpresent(s$):
"XOS_ReadVarVal",s$,gblk%,(1<<31),0,3
,,exists%:=exists%<>0
gls(s$):n%=
(s$):
:ch$=
s$,n%,1):n%-=1:
(n%<=0
ch$="."
ch$=":"
ch$=
n%>0
(s$)-n%-1)
s$,10)
r_fi(nme$)
"XOS_File",5,nme$
there%,B,ft%,D,length% ;F
ft%=(ft%>>8)
1)<>0
there%=255
ft%=&FCA
there%=1
ff%=
(nme$):
"OS_GBPB",4,ff%,gblk%,32:
#ff%:ff%=0:orlen%=gblk%!4:type%=!(gblk%+8):type%=(type%>>8)
&FFF
IFft%=pshopty%
there%=1
ff%=
(nme$):
"OS_GBPB",4,ff%,gblk%,32:
#ff%:ff%=0:
!gblk%=&53504238
ft%=&524F42:type%=&524F42
frc_redraw:
WfrcR%,-1,0,0,&FFFF,&FFFF:
CwT(hand%):
(Temporary) close window - used to allow window resize.
hand%<=0
`)!Wb%=hand%:
"XWimp_CloseWindow",,Wb%
hand%=m_remote%
maino%=0:!Wb%=w_remotet%:
"XWimp_CloseWindow",,Wb%
hand%=m_local%
!Wb%=w_localt%:
"XWimp_CloseWindow",,Wb%
Cw(hand%)
hand%<=0
g)!Wb%=hand%:
"XWimp_CloseWindow",,Wb%
hand%=m_remote%
maino%=0:!Wb%=w_remotet%:
"XWimp_CloseWindow",,Wb%
hand%=m_local%
!Wb%=w_localt%:
"XWimp_CloseWindow",,Wb%
!!!PCA!!! closing local window - tell the remote to close its toolbar with an unhook.
hand%=m_local%
tskh%=remotetask%:ms0%=1:ms1%=localtag%:
pca(Msg_Unhook%)
!!!PCA!!! closing remote window - tell the local.
hand%=m_remote%
tskh%=localtask%:ms0%=1:ms1%=remotetag%:
pca(Msg_Unhook%):remotetag%=-1
Confirmchange(str1$):!GB%=1:$(GB%+4)=str1$
"Wimp_ReportError",GB%,19,"SPaint"
,resp%
=(resp%=1)
mini_poll(s5%)
s2%=0
&400C7,0,Wb%
RR%
redraw(0)
Wow%,,Wb%
Cw(!Wb%)
mini_click
key_pressed
17,18,19:R%=RR%:
recieve_msg
mini_click
local_win
Icn%>=0
gwi(m_local%):
remotemessage(R%):
Bt%=4
pcasprite
Bt%=2
menu(m_ibar%,mox%-128,moy%+48)
spritep1(v%):=v%+v%!8
swtosm(v1%,v2%):
v1%<&8000
v2%<&8000
&524F42,"Redirection to invalid sprite."
J!savea%=0:
Spop%,573,v1%,v2%,savea%
sw0%,sw1%,sw2%,sw3%:switched%=
swtos(v1%,v2%):
v1%<&8000
v2%<&8000
&524F42,"Redirection to invalid sprite."
J!savea%=0:
Spop%,572,v1%,v2%,savea%
sw0%,sw1%,sw2%,sw3%:switched%=
swto(v%)
M!savea%=0:
Spop%,572,v%,v%+v%!8,savea%
sw0%,sw1%,sw2%,sw3%:switched%=
swbak
switched%
Spop%,sw0%,sw1%,sw2%,sw3%:switched%=0
picker(s$,col%,x%,y%,f,f2)
$gb%=s$
A!Mgb%=f2:
col%=-1
(f2
%1)<>0
col%=&FFFFFF00:!Mgb%=%111
YMgb%!4=gb%:Mgb%!8=x%:Mgb%!12=(1<<31):Mgb%!16=(1<<31)-1:Mgb%!20=y%:Mgb%!24=0:Mgb%!28=0
Mgb%!32=col%
Mgb%!36=0
"ColourPicker_OpenDialogue",f,Mgb%
h%,lcpw%
wword(
b%,v%)
!b%=v%:b%+=4:
wstring(
b%,s$)
$b%=s$:b%=b%+4+
nudge
-58 moy%+=1:
mox%,moy%
-26 mox%-=1:
mox%,moy%
-122 mox%+=1:
mox%,moy%
-42 moy%-=1:
mox%,moy%
mox%,moy%,Bt%:
nudge
rpanes
(!gb%=!Wb%:
Wgwst%,,gb%:flg%=gb%!32
m_local%:!gblk%=w_localt%:tooly%=gb%!8-gb%!16+192:toolyy%=192:toolx%=64:toolxx%=64
m_remote%:!gblk%=w_remotet%:tooly%=104:toolyy%=64:toolx%=0:toolxx%=192
gblk%!28=Wb%!28
(flg%
2097152)=0
(flg%
131072)<>0
Wb%!28<>-1
Wb%!28=!gblk%
(flg%
2097152)<>0
Wb%!28<>-1 Wb%!28=!gblk%
Wow%,,Wb%:gblk%!28=Wb%!28
bgblk%!8=Wb%!8-tooly%:
gblk%!8<0
Wb%!8>0
gblk%!8=0
Wb%!8<=0
gblk%!8<0
gblk%!8=Wb%!8
gblk%!16=gblk%!8+toolyy%
_gblk%!4=Wb%!4-toolx%:
gblk%!4<0
Wb%!4>0
gblk%!4=0
Wb%!4<=0
gblk%!4<0
gblk%!4=Wb%!4
gblk%!12=gblk%!4+toolxx%-2
gblk%!20=0:gblk%!24=0
!gblk%<>h%
Wow%,,gblk%
(flg%
2097152)=0
Wow%,,Wb%
initsptrans
&400C7,1,Wb%
redraw(0)
2:h%=!Wb%
h%=m_local%
h%=m_remote%
rpanes
Wow%,,Wb%
h%=m_local%
aremote%>=0
gwi(m_local%):y1a%=y1%-yscrol%:yscrola%=yscrol%:xscrola%=xscrol%
xposU%=winx%:yposU%=y1a%
xposL%=xposU%:yposL%=yposU%
xposL%<x0%
xposL%=x0%
yposL%<y0%
yposL%=y0%
xposL%>x1%
xposL%=x1%
yposL%>y1%
yposL%=y1%
sfac%=65536:
100% scale
Dms2%=m_local%:ms3%=w_localt%:tskh%=remotetask%:
pca(Msg_ObjPos%)
Cw(!Wb%)
click
key_pressed
select_menu
17,18:
recieve_msg
Ow(h%,x%,y%,bhnd%)
h%=m_remote%
maino%=-1
!Wb%=h%:
x%=-1
y%=-1
Wgwst%,,Wb%:Wb%!28=bhnd%:
Wow%,,Wb%
h%=m_local%
h%=m_remote%
rpanes
Wgwst%,,Wb%:xsize%=Wb%!12-Wb%!4:ysize%=Wb%!16-Wb%!8
E!Wb%=h%:Wb%!4=x%:Wb%!12=Wb%!4+xsize%:Wb%!8=y%:Wb%!16=Wb%!8+ysize%
Wb%!8=y%:Wb%!16=Wb%!8+ysize%:Wb%!28=bhnd%:SYS"Wimp_OpenWindow",,Wb%
"Wimp_OpenWindow",,Wb%
h%=m_local%
h%=m_remote%
rpanes
&35,-1,4
,,xpix%:
&35,-1,5
,,ypix%
&35,-1,11
,,sw%:
&35,-1,12
,,sh%
Expix%=1<<xpix%:ypix%=1<<ypix%:sw%=xpix%*(sw%+1):sh%=ypix%*(sh%+1)
xpixf=xpix%/2:ypixf=ypix%/2
repmsg(str1$)
"POINTER 1":
&35,-1,3
,,nocol%
wi(w_report%,1,str1$):$msgtit%="Spaint":
Wgpi%,,GB%:
Ow(w_report%,!GB%-356,GB%!4-42,-1)
reperr(str1$):mnhnd%=0
1,"In Error code:"+
$+" "+
"POINTER 1":
"OS_ReadModeVariable",
,,nocol%
!gb%=1:$(gb%+4)=str1$
"Wimp_ReportError",gb%,2,"Spaint"
key_pressed:win%=!Wb%:key%=Wb%!24:icn%=Wb%!4:mine%=
win%=lcpw% mine%=
win%=gensave%
key%=13
oksave(
ri(gensave%,2)):mine%=
mine%
"Wimp_ProcessKey",key%
read_andload(s$,ft%,win%,Icn%):EX%=0
win%
-2,m_local%
ft%=&FF9
loadsprite(s$)
xwp%=0
checkpath(nme$)
nme$,":")=0
nme$,"<")=0
nme$,".")=0
nme$<>"<Wimp$Scrap>"
onoff(win%,Icn%,state%):
state%
ui(win%,Icn%,0)
ui(win%,Icn%,2097152)
a(A%,B%):
NiceA%,A%,B%:
da(A%,B%):
NiceDa%,A%,B%:
aG(A%,B%,C%):
NiceAg%,A%,B%,C%:
daG(A%,B%,C%):
NiceDag%,A%,B%,C%
WcGp%,,gblk%:
!gblk%=A%
gblk%!4>=B%
gblk%!4<=C%
WcSp%,-1
warning(win%,icn%)
-E!Wb%=win%:Wb%!4=icn%:Wb%!8=11<<24:Wb%!12=%1111<<24:
Wsist%,,Wb%
ok(win%,icn%)
1D!Wb%=win%:Wb%!4=icn%:Wb%!8=7<<24:Wb%!12=%1111<<24:
Wsist%,,Wb%
ui(hand%,no%,state%):!gb%=hand%:gb%!4=no%:gb%!8=state%:gb%!12=2097152:
Wsist%,,gb%:
uiG(hand%,start%,end%,state%):
hand%<=0
7V!gb%=hand%:gb%!8=state%:gb%!12=2097152:
l%=start%
end%:gb%!4=l%:
Wsist%,,gb%:
wii(win%,icn%,text$):!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:
s(gb%!32)<>text$ $(gb%!32)=text$:gb%!8=0:gb%!12=0:
Wsist%,,gb%
wi(win%,icn%,text$):!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:
gb%!28<&8000
gb%!28>&800000
&524F42,"Icon not indir. or invalid. Handle "+
s(gb%!28)<>text$
$(gb%!28)=text$:gb%!8=0:gb%!12=0:
Wsist%,,gb%
icnok(win%,icn%):
icn%=0
A8!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:v%=gb%!(8+16)>>22
(v%
%1)=0
setsize(whn%,h%,w%)
Fc!Wb%=whn%:
Wgwst%,,Wb%:Wb%!4=0:Wb%!8=0:Wb%!16=h%:Wb%!12=w%:
&600D7,whn%,(Wb%+4):
Wgwst%,,Wb%
loadsquashed(nme$,base%,off%)
reperr(
$,"(code "+
+")"):
resizeslot(0):EX%=
&406C0
r_fi(nme$):rlen%=length%:length%-=off%:
"Squash_Decompress",%1000,-1
work%
"Wimp_SlotSize",-1,-1
current,,free:free-=32*1024
free<work%+4096+1024
reperr(
ms("Sorrlc"),""):EX%=
length%
free>work%+length%+outsize%
free=work%+length%+outsize%
EX%=0:
resizeslot(free)
EX%
reperr(
ms("Sorrlc"),""):EX%=
T*freec%=free-work%:worka%=current+&8000
"Wimp_SlotSize",-1,-1
current
freec%-length%>1024
WYouta%=worka%+work%+length%:outl%=(current+&8000)-outa%:ina%=worka%+work%:inl%=length%
YPhlf%=freec%/2:outa%=worka%+work%+hlf%:outl%=hlf%:ina%=worka%+work%:inl%=hlf%
r5%=outl%:otype%=-1
\-fileoff%=0:offe%=
:cont%=0:r3%=0:start%=0
inl%>=length%
outl%>=outsize%
start%=%100
"Hourglass_Percentage",0
`,offc%=inl%:
getbit(nme$,off%,ina%,offc%)
a5r1%=worka%:r2%=ina%:r3%=offc%:r4%=outa%:r5%=outl%
offe%
cont%=0
cont%=1
"Hourglass_Percentage",(fileoff%/outsize%)*100
"Squash_Decompress",start%
(cont%<<1),r1%,r2%,r3%,r4%,r5%
status%,r1%,r2%,r3%,r4%,r5%
start%=1
status%=2
storeaway(outa%,r4%-outa%,fileoff%,base%,outsize%,otype%,0):r4%=outa%:r5%=outl%
fileoff%>=outsize%
status%=0:off%=rlen%:r4%=outa%
status%=1
status%=0
storeaway(outa%,r4%-outa%,fileoff%,base%,outsize%,otype%,0):r4%=outa%:r5%=outl%
off%+=(offc%-r3%)
off%>=rlen%
status%=0
&406C1
resizeslot(0)
getbit(nme$,off%,addr%,
offc%):
off%+offc%>rlen%
offc%=rlen%-off%:offe%=
offc%=0
qAF%=
(nme$):
#F%=off%:
"OS_GBPB",4,F%,addr%,offc%:
#F%:F%=0:
storeaway(unsquashbuffer,unsquashed,
fileoff%,base%,outsize%,otype%,filter%):
unsquashed<=0
sfA%=unsquashbuffer:B%=base%+fileoff%:C%=unsquashed:
B%+C%>base%+outsize%
C%=(base%+outsize%)-(B%)
D%=0
C%>0
moveto,A%,B%,C%
C%=0:fileoff%=outsize%
fileoff%+=C%
carpos
gwi(hand%):!gb%=hand%:
Wgwst%,,gb%:x0%=gb%!4:y0%=gb%!8:x1%=gb%!12:y1%=gb%!16:vissizX%=x1%-x0%:vissizY%=y1%-y0%:xscrol%=gb%!20:yscrol%=gb%!24:winx%=x0%:wy%=y0%
}'wflg%=gb%!32:wo%=(wflg%
1<<16)<>0
wy%+=yscrol%:winx%-=xscrol%
ri(win%,icn%):!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:=
s(gb%!28)
r_icid(win%,icn%):!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:=
s(gb%!32)
w_icid(win%,icn%,s$):!gb%=win%:gb%!4=icn%:
Wgist%,,gb%:$(gb%!32)=s$:gb%!8=0:gb%!12=0:
Wsist%,,gb%:
helptext:Wb%!16=&503:Wb%!12=Wb%!8:icn%=Wb%!36:nme$="":htx%=-1:
Wb%!32
V$(Wb%+20)=nme$:Wb%!0=(((20+
(nme$)+1)
4)*4)+4:$(Wb%+21+
(nme$))=
Wmess%,17,Wb%
sc(r%,g%,b%):
CtSgcol%,(b%<<24)+(g%<<16)+(r%<<8),,,256,0:
scE(r%,g%,b%):
CtSgcol%,(b%<<24)+(g%<<16)+(r%<<8),,,256,3:
isld(x%,y%,w%):
w%>0
w%<256
x%+(255-w%),y%,w%,18
w%<255
w%>=0
XWscol%,0:
x%,y%,(255-w%),18
w%<0
w%>255
XWscol%,2:
x%,y%,256,18
string0(l%,a$):$l%=a$:l%?
a$=0:
ar(v%)
!v%/(v%!8/xpixf)>v%!4/(v%!12/ypixf)
!v%=v%!4:v%!8=v%!12*xpixf
xpixf<>1
v%!4=!v%*xpixf
v%!4=!v%
v%!12=v%!8*ypixf
redrawW(h%,x00%,y00%,x11%,y11%):!Wb%=h%:Wb%!4=x00%*mscd-spritexm%:Wb%!8=y00%*mscd-spriteym%:Wb%!12=Wb%!4+x11%*mscd+spritexm%*2:Wb%!16=Wb%!8+y11%*mscd+spriteym%*2
redraw(-1)
rword(v%)
$v2%=v%
v2%*4<>v% v%=v2%*4+4
rword2(v%)
"v2%=v%
v2%*4<>v% v%=v2%*4
blobs(x0%,y0%,x1%,y1%,x2%,y2%,x3%,y3%):
wx%+x0%,wy%+y0%,6:
wx%+x3%,wy%+y3%,6:
wx%+x1%,wy%+y1%,6:
wx%+x2%,wy%+y2%,6:
blob(x%,y%):
x%,y%,6:
blob2(x%,y%):
x%-4,y%-4,16,16:
redrawit(hand%):!GB%=hand%:
"Wimp_GetWindowOutline",,GB%:
WfrcR%,-1,GB%!4,GB%!8,GB%!12,GB%!16:
rdi(hand%,icn%):
hand%<=0
!gb%=hand%:gb%!4=icn%:
Wgist%,,gb%:
WfrcR%,hand%,gb%!8,gb%!12,gb%!16,gb%!20:
go%:
"Wimp_GetRectangle",,GB%
go%:
getwininfo(hand%):!Wb%=hand%:
Wgwst%,,Wb%:xbase%=Wb%!4:ybase%=Wb%!8:width%=Wb%!12:height%=Wb%!16:
GetLeafname(name%):
ch$,n%,name$:name$=
s(name%):
name$,".")=0)
name$,":")=0))
=name$
(name$):
:ch$=
name$,n%,1):n%-=1:
(n%<=0
ch$="."
ch$=":")
n%>0
name$,
(name$)-n%-1)
s(s%):
?s%<32 =""
.n$="":
?s%>31
n$<255:n$+=
?s%:s%+=1:
resizeslot(cc%)
Wslt%,-1,-1
,,free%
free%+(slsiz%-basesiz%)<cc%
EX%=
reperr(
ms_exp("mem1",
(((slsiz%-basesiz%+cc%)-free%)/1024),"")):
Wslt%,(basesiz%+cc%),-1:
Wslt%,-1,-1
slsiz%
slsiz%<basesiz%+cc%
EX%=
Wslt%,basesiz%,-1:slsiz%=basesiz%:
reperr(
ms_exp("mem1",
((basesiz%+cc%-slsiz%)/1024),""))
claims%=slsiz%-basesiz%
check_adj
"Wimp_GetPointerInfo",,GB%+300
(%111
GB%!308=1)
(%111
GB%!308=2)
quitreq(E$,box%):
RES%:!GB%=0:$(GB%+4)=
E$,100)+
box%=255
"Wimp_ReportError",GB%,19,"SPaint"
,resp%
"Wimp_ReportError",GB%,box%,"SPaint"
,resp%
=resp%=1
decode(hand%,Wb%,gb%):
"Wimp_DecodeMenu",,hand%,Wb%,gb%:=$gb%
grey(h%,i%):
h%>0 !gb%=h%:gb%!4=i%:gb%!8=&2000000:gb%!12=&F000000:
Wsist%,,gb%
notselect(h%,i%):
h%<=0
=!gb%=h%:gb%!4=i%:gb%!8=&A000:gb%!12=&F000:
Wsist%,,gb%:
black(h%,i%):
h%>0 !gb%=h%:gb%!4=i%:gb%!8=&7000000:gb%!12=&F000000:
Wsist%,,gb%
encodemenu(mnhnd%)
mnhnd%<&8000
1,"Bad menuhandle"
PROCclm(m_remote%)
tk(hand%,icn%):
icn%<0
4hand%!(28+(24*icn%))=hand%!(28+(24*icn%))
&01:
clm(hand%):
hand%<&8000
1,"menu handle &"+
~hand%+" called for clearing is invalid."
[hand%+=28:
:!hand%=!hand%
1:hand%!8=hand%!8
&400000:hand%+=24:
!(hand%-24)
2<<6:
shade(mh%,I%):mh%!(28+8+24*I%)=mh%!(28+8+24*I%)
&40000:
tick(mh%,I%):
I%<0 I%=0
,mh%!(28+(24*I%))=mh%!(28+(24*I%))
&01:
select(h%,i%):
h%>0 !gb%=h%:gb%!4=i%:gb%!8=&7000000:gb%!12=&F000000:
Wsist%,,gb%:
deselect(h%,i%):
h%>0 !gb%=h%:gb%!4=i%:gb%!8=&4000000:gb%!12=&F000000:
Wsist%,,gb%
msgrep(str1$):$errb%=str1$
!gb%=0:$(gb%+4)=str1$
"Wimp_ReportError",gb%,17,"SPaint Message"
,resp%
initall:
BL% 16,nameblk% 255:adjusting%=
:mainW_active%=
init_Wimp:mnhnd%=0:
initSys:
sprites:
load_templates:
createmenus:scrapref%=-1:
triplezero(v):
@%:@%=(1<<24)+(2<<16)+(3<<8)+12:=
doublezero(v):
@%:@%=(1<<24)+(2<<16)+(2<<8)+12:=
singlezero(v):
@%:@%=(1<<24)+(2<<16)+(1<<8)+12:=
azero(v):
@%:@%=(1<<24)+(2<<16)+(1<<8)+12:v$=
v$,2)=".0"
(v$)-2)
alt(v%):
=" *"
initSys
"Wimp_Initialise",200,&4B534154,"Simple Paint"
,Task_h%
SpriteName% 14:$SpriteName%="!spaint"
!Wb%=-1:Wb%!4=0:Wb%!8=0:Wb%!12=76:Wb%!16=76:Wb%!20=&7000311A:Wb%!24=SpriteName%:Wb%!28=1:Wb%!32=12:
"Wimp_CreateIcon",,Wb%
icnbh%
sprites
r_fi("<SPaint$Dir>.Sprites22")
there%<>1
(ft%<>&FCA
ft%<>&FF9)
1,"!Spaint.Sprites missing/corrupt. Please install again."
ft%=&FCA
sblock% orlen%+16:!sblock%=orlen%+16
sblock% length%+16:!sblock%=length%+16
*sblock%!4=0:sblock%!8=16:sblock%!12=16
ft%=&FCA
Vfl%=orlen%+4:outsize%=orlen%:
loadsquashed("<SPaint$Dir>.Sprites22",sblock%+4,&14)
"XOS_Exit"
ft%=&FF9
Spop%,522,sblock%,"<SPaint$Dir>.Sprites22"
reperr("Spaint Sprites are corrupt or missing. Please reinstall the program.",""):
"XOS_Exit"
load_templates:st%=styleindir:ste%=styleindir+&1300
"Wimp_OpenTemplate",,"<SPaint$Dir>.Templates"
Wlt%,,wad%(1),st%,ste%,-1,"info",0
,,stx%:wad%(1)!64=sblock%:st%=stx%:
Wcw%,,wad%(1)
w_info%
#split_hand%=-1:restore_hand%=-1
Wlt%,,GB%,st%,ste%,-1,"generalsave",0
,,stx%:GB%!64=1:st%=stx%:
Wcw%,,GB%
gensave%
Wlt%,,GB%,st%,ste%,-1,"prefs",0
,,stx%:GB%!64=1:st%=stx%:
Wcw%,,GB%
w_prefs%
Wlt%,,GB%,st%,ste%,-1,"remote",0
,,stx%:maint%=st%:GB%!64=sblock%:st%=stx%:
Wcw%,,GB%
m_remote%
Wlt%,,GB%,st%,ste%,-1,"local",0
,,stx%:localt%=st%:GB%!64=sblock%:st%=stx%:
Wcw%,,GB%
m_local%
Wlt%,,GB%,st%,ste%,-1,"report",0
,,stx%:GB%!64=1:msgtit%=st%:st%=stx%:
Wcw%,,GB%
w_report%
Wlt%,,GB%,st%,ste%,-1,"localtool",0
,,stx%:GB%!64=sblock%:st%=stx%:
Wcw%,,GB%
w_localt%
Wlt%,,GB%,st%,ste%,-1,"remotetool",0
,,stx%:GB%!64=sblock%:st%=stx%:
Wcw%,,GB%
w_remotet%
!!!PCA!!!
keep the window create block for the PCA dialogue as we
need to delete and recreate in order to add the scrollbar.
pca_wblock% 256,pca_windir% 100
Wlt%,,pca_wblock%,pca_windir%,pca_windir%+100,-1,"ole2",0:GB%!64=sblock%:
Wcw%,,pca_wblock%
pca_w%
"Wimp_CloseTemplate",,"<SPaint$Dir>.Templates"
end%
4,30:
6,4,0:
6,229,0:
st%>=ste%
1,"indirection overlap when loading windows.":
PROCdefaultstrings
oo(win%,Icn%,state%):
state%
ui(win%,Icn%,0)
ui(win%,Icn%,1<<21)
allow(win%,icn%)
L!gb%=win%:gb%!4=icn%:gb%!8=0<<22:gb%!12=1<<22:
"Wimp_SetIconState",,gb%
disallow(win%,icn%)
!L!gb%=win%:gb%!4=icn%:gb%!8=1<<22:gb%!12=1<<22:
"Wimp_SetIconState",,gb%
createmenus
menufree% &800:menuend%=menufree%+&800
buffer% &400:maxbuff%=buffer%+&400:currbuff%=buffer%
("<SPaint$Dir>.menus")
F%=0
ms("nomenus"):
"OS_Exit"
submsg%=
:wid%()=4
wbptr%=1
submsg%=
m_file%=
cmen(
,#m_ibar%=
cmen(
#F%):numfonts%=0
mm_remote%=
cmen(
menu(m%,moux%,mouy%)
mnhnd%=m%
encodemenu(mnhnd%):
"Wimp_CreateMenu",,mnhnd%,moux%+100,mouy%+12
moux%<>0
mouy%<>0
mousex%=moux%:mousey%=mouy%
cmen(menu$)
menufree%>menuend%-28 =-1
m%,m$
9"menuptr%=menufree%:i%=0:ctr%=0
menu$,1)="#"
i%=1:menutitle$=
par("\",i%)
menutitle$=""
menuptr%!20=40:$menuptr%=menutitle$:menuptr%?12=7:menuptr%?13=2:menuptr%?14=7:menuptr%?15=0:menuptr%!16=172:menuptr%!24=0:menuptr%+=28:maxx%=
menutitle$-3
:item$=
par("\",i%):
menuitem(item$):
item$=""
menuptr%>=menuend%-24
=%!(menuptr%-24)=!(menuptr%-24)
>"m%=menufree%:m%!16=maxx%*16+12
menufree%=menuptr%
menuitem(nme$)
nme$=""
menuptr%+24>menuend%
flg%,i%:
submsg% flg%=8
flg%=0
nme$,">")
i%>0
GCsubptr%=
nme$,i%+1):
nme$,i%+1)="i_font%" fontsub%=menuptr%+4
nme$=
nme$,i%-1)
subptr%=-1
nme$,1)="#" nme$=
nme$,
nme$-1):flg%+=&02
L;menuptr%!0=flg%:menuptr%!4=subptr%:menuptr%!8=&07000021
nme$,1)="$"
N1!menuptr%+=&04:menuptr%!8+=&100:i%=
nme$,"(")
i%>0
nme$,i%+1):nme$=
nme$,i%-1)
L%=12
P7menuptr%!12=
nme$,2):menuptr%!16=-1:menuptr%!20=L%
L%>15
L%=15
nme$=
L%-1," ")
nme$<=12
$(menuptr%+12)=nme$
workspace(
nme$+1):$I%=nme$
WRmenuptr%!12=I%:menuptr%!16=-1:menuptr%!20=
nme$+1:menuptr%!8=menuptr%!8
&100
nme$>maxx% maxx%=
menuptr%+=24
par(sep$,
pos%):i1%=pos%+1:pos%=
menu$+sep$,sep$,i1%):=
menu$,i1%,pos%-i1%)
workspace(L%)
currbuff%+L%>maxbuff%
1,"No room to store menu definitions - too many fonts ?"
currbuff%+=L%:=currbuff%-L%
setupstores:offset%=0:
lopx%=1
required%:wad%(lopx%)=generalstore%+offset%:offset%+=required%:
offset%>&800
1,"No room for window storage."
&500,&100
str(num):
"XOS_Release",3,wrchv%,possaddr%:
reperr(
$+" code number "+
):="0"
h3!possaddr%=gb%:
131103,3,wrchv%,possaddr%:
131104,3,wrchv%,possaddr%
j+s$=$gb%:
s$,1)=
32:s$=
(s$)-1):
s$,1)<
32:s$=
assemble_blit
space% &1A00
p+ccr%=0:ccg%=1:ccb%=2:ro%=8:go%=9:bo%=10
r%=11:g%=12:b%=14
rd%=4:gd%=5:bd%=7
opt=0
P%=space%
[OPT opt
.moveto
\r0=src%
\r1=des%
\r2=len%
{ \r3=0 for words, 1 for bytes
CMP R2,#0:MOVLE PC,R14
CMP R0,R1:
Q PC,R14
CMP R3,#0:BNE movebytes
.movewords
CMP R0,R1:BLE else
\ src%>des%
MOV R3,#0:SUB R6,R2,#4
.for1m
!LDR R5,[R0,R3]:STR R5,[R1,R3]
$ADD R3,R3,#4:CMP R3,R6:BLE for1m
MOV PC,R14
.else
SUB R3,R2,#4
.for2m
!LDR R5,[R0,R3]:STR R5,[R1,R3]
SUBS R3,R3,#4
BGE for2m
MOV PC,R14
.movebytes
.truemoveb
CMP R0,R1:BLE elseb
\ src%>des%
MOV R3,#0
.for1mb
0LDRB R5,[R0,R3]:STRB R5,[R1,R3]:ADD R3,R3,#1
CMP R3,R2:BLT for1mb
MOV PC,R14
.elseb
SUB R3,R2,#1
.for2mb
#LDRB R5,[R0,R3]:STRB R5,[R1,R3]
SUBS R3,R3,#1
BGE for2mb
MOV PC,R14
.copydata%
; r0 =source ptr
; r1 =dest ptr
; r2 =length
Z.copywordsl:TST R2,#31:LDRNE R3,[R0],#4:STRNE R3,[R1],#4:SUBNE R2,R2,#4:BNE copywordsl
TEQ R2,#0
NLDMNEIA R0!,{r5-r12}:STMNEIA R1!,{r5-r12}:SUBNES R2,R2,#8*4:BNE copywordsl
MOV PC,R14
4.copyj:MOV R0,R2:MOV R1,R3:MOV R2,R4:B copydata%
.NiceAg%
!MOV R4,#0:MOV R7,#1:B groupdo
.NiceDag%
%MOV R4,#1<<22:MOV R7,#0:B groupdo
.groupdo
; r0 = window handle
; r1 = min_ic
; r2 = max_ic
3MOV R8,R0:MOV R9,R1:MOV R10,R2:STMFD R13!,{R14}
MOV R5,#1<<22
STR R8,window
.loop
STR R9,icon
ADR R1,block
SWI "XWimp_GetIconState"
MLDR R12,flags:MOV R12,R12,LSR#22:
R12,R12,#1:CMP R12,R7:; is it shaded ?
BNE ok
; change it
#STR R4,eorword:STR R5,clearword
ADR R1,block
SWI "XWimp_SetIconState"
$ADD R9,R9,#1:CMP R9,R10:BLE loop
LDMFD R13!,{PC}
.block
.window EQUD 0
.icon EQUD 0
.eorword EQUD 0
.clearword EQUD 0
.data2 EQUD 0
EQUD 0
!; bit 22 of flags =shaded bit
"; bits 12-15 =button type
.flags EQUD 0
.data0 EQUD 0
.data1 EQUD 0
.data2 EQUD 0
.data3 EQUD 0
.NiceDa%
; r0 =window
; r1 =icon
MOV R2,R1:B NiceDag%
.NiceA%
; r0 = window
; r1 = icon
MOV R2,R1:B NiceAg%
; !!!PCA!!!
C; used by the dialogue redraw code to simulate 'r1' style icons
.bdr%
&; simulate Acorn style 'r1' border
.MOV R9,R0:MOV R10,R1:MOV R11,R2:MOV R12,R3
MOV R0,#0
SWI &600E6
; lh side
GMOV R0,#4:SUB R1,R9,#2:SUB R2,R10,#2:SWI "OS_Plot":; move x0-2,y0-2
5MOV R0,#5:MOV R2,R12:SWI "OS_Plot":; draw x0-2,y1
7MOV R0,#4:SUB R1,R1,#2:SWI "OS_Plot":; move x0-4,y1
:MOV R0,#5:SUB R2,R10,#4:SWI "OS_Plot":; draw x0-4,y0-4
; top
)MOV R0,#4:ADD R2,R12,#4:SWI "OS_Plot"
DMOV R0,#5:ADD R1,R11,#2:SWI "OS_Plot":; draw x0-4,y1+4,x1+2,y1+4
DMOV R0,#4:SUB R1,R1,#2:SUB R2,R2,#2:SWI "OS_Plot":; move x1,y1+2
@MOV R0,#5:SUB R1,R9,#4:SWI "OS_Plot"; draw x0-4,y1+2,x1,y1+2
MOV R0,#4
SWI &600E6
;bottom
GMOV R0,#4:SUB R1,R9,#2:SUB R2,R10,#4:SWI "OS_Plot":; move x0-2,y0-4
:MOV R0,#5:ADD R1,R11,#4:SWI "OS_Plot":; draw x1+2,y0-4
EMOV R0,#4:SUB R1,R1,#0:SUB R2,R10,#2:SWI "OS_Plot":; move x1,y0-2
3MOV R0,#5:MOV R1,R9:SWI"OS_Plot":; draw x0,y0-2
;right
4MOV R0,#4:ADD R1,R11,#2:MOV R2,R10:SWI "OS_Plot"
)MOV R0,#5:ADD R2,R12,#2:SWI "OS_Plot"
4MOV R0,#4:ADD R1,R11,#4:MOV R2,R10:SWI "OS_Plot"
)MOV R0,#5:ADD R2,R12,#4:SWI "OS_Plot"
MOV PC,R14
Dynamic area version...
createarea(size%,s$,
aa%,maxm%)
4,30:
$:mm$=
ms("vmfail"):EX%=
:areasize%=0:aa%=0:=-1
areasize%=0
"XOS_DynamicArea",0,-1,size%,-1,%10000000+(1<<31
virtual%),maxm%,0,0,s$
r0,aa%,,areabase%;F%
1)<>0
killara(aa%):mm$="Couldn't create "+s$+" area. Probably not enough free memory or disc space.":aa%=0:size%=0:EX%=
"OS_ReadDynamicArea",aa%
,areasize%
areasize%<size%
killara(aa%):
42,"Couldn't create "+s$+" area. Probably not enough free memory."
=areabase%
ourarea(v%):
v%=0
&524F42,"Dynamic area "+
v%+" called by SPaint is invalid!"
"OS_DynamicArea",2,v%
,,areasize%,addr%
=addr%
areasize(v%):
v%=0
&524F42,"Dynamic area "+
v%+" called by SPaint is invalid!"
"OS_DynamicArea",2,v%
,,areasize%,addr%
=areasize%
killara(v%)
v%<>0
"XOS_DynamicArea",1,v%
min(v1,v2):
v1<v2
max(v1,v2):
v1>v2
DA version, general area create/claim
doclaimg(size%,
number%,msg$,arean$,maxm%):EX%=0
size%=0
killara(number%):number%=0:
number%=0
areabase%=
createarea(size%,arean$,number%,maxm%):csize%=areasize%:
number%=0
EX%=
repmsg(
ms_exp(msg$,
rounds(size%/1024),"")):number%=0:
7)b%=
ourarea(number%):csize%=areasize%
Wslt%,-1,-1
,,free%:
free%<(size%-csize%)
virtual%
repmsg(
ms_exp(msg$,
rounds((size%-csize%-free%)/1024),"")):EX%=
ourarea(number%)
: v%=0:change%=size%-areasize%
change%<>0
"XOS_ChangeDynamicArea",number%,change%
r0,v%;F%:
(change%)
change%>0
reperr("DynamicArea memory change failed badly. (Passed "+
(size%/1024))+"k)",""):EX%=
ourarea(number%)
ms_load(A$):
"MessageTrans_FileInfo",,A$:
"OS_Module",6,,,17+
,,ms_desc%:$(ms_desc%+16)=A$:
"MessageTrans_OpenFile",ms_desc%,ms_desc%+16:
ms_end:
"XMessageTrans_CloseFile",ms_desc%:
"XOS_Module",7,,ms_desc%:
ms(nme$):=
ms_exp(nme$,"","")
ms_exp(A$,B$,C$):
398594,ms_desc%,A$,gb%,256,B$,C$
,,,zl%;zf%:
="tag '"+A$+"' not present in messages."
gb%?zl%=13:=$gb%
init_variables
J6wh%=-256:rd%=&FF00:cy%=-65536:gr%=&FF0000:myref%=0
CtHSVtRGB%=&40759:CtRGBtHSV%=&40758:Wscol%=&400E6:CtSgcol%=&40743:CtSOgcol%=&40748:Wrdw%=&400C8:Wgr%=&400CA:XWgr%=&600CA:Wgpi%=&400CF
Spop%=&2E:XSpop%=&2002E:CtSfc%=&4074F:CtInval%=&40750:CtStb%=&40740:Wlt%=&600DB:Wcw%=&400C1:Wslt%=&600EC:Wgist%=&400CE:Wsist%=&400CD:Wgwst%=&400CB:Ptx%=&40086:XPtx%=&60086:WfrcR%=&400D1:XWfrcR%=&600D1:Wupdw%=&400C9:XCtGet%=&40763
WcSp%=&400D2:Ffnt%=&40081:Fctp%=&40089:Fctos%=&40088:Lfnt%=&40082:Strw%=&40085:WgR%=&600CA:Fsfnt%=&4008A:Wmess%=&400E7:Fcar%=&40087
Bbox%=&40097:XWscol%=&600E6:XWgrec%=&600CA:GSTrns%=&20027:WcGp%=&400D3:WcSp%=&400D2:Wcm%=&400D4:Wow%=&400C5:WclW%=&600C6:Wsist%=&400CD:Drwf%=&40702:Drwstr%=&40704:XDwS%=&60704
maino%=0:overmain%=0
Spop%=&2E:CtSfc%=&4074F:CtInval%=&40750:CtStb%=&40740:Wlt%=&600DB:Wcw%=&400C1:Wslt%=&600EC:Wgist%=&400CE:Wsist%=&400CD:Wgwst%=&400CB:Ptx%=&40086:WfrcR%=&400D1:XSndC%=&60140
QmFfnt%=&40081:Fctp%=&40089:Fctos%=&40088:Lfnt%=&40082:Strw%=&40085:WgR%=&600CA:Fsfnt%=&4008A:Wmess%=&400E7
XOags%=&20009
S:Bbox%=&40097:XWscol%=&600E6:XWgrec%=&600CA:Wcm%=&600D4
!!!PCA!!!
PCA message numbers
XUMsg_Whos%=&83484:Msg_Im%=&83485:Msg_Do%=&83486:Msg_Desel%=&83487:Msg_Done%=&83488
Msg_Moving%=&83489:Msg_Changed%=&8348A:Msg_Resize%=&8348B:Msg_Uparea%=&8348C:Msg_ResizeAck%=&8348D:Msg_Misc%=&8348E:Msg_Info%=&8348F
Z+Sub_Give%=&83480:Sub_Associated%=&83481
\:Msg_ObjPos%=&83490:Msg_Hook%=&83491:Msg_Unhook%=&83492
PCA popup dialogue/menu
_kutil$="#Utilities":pcatask%=0:
utiltsk%(24),utilid%(24),uf%(24),utils$(24):utile%=0:uboxw%=0:uboxh%=96
`3popuptype%=0:m_pca%=0:
0 - dialogue 1 - menu
pointers to remote objects
remotetag%=-1:wn$=""
e;pcol%=&FFFFFF00:size%=64:size2%=64/2+4:ppick%=0:lcpw%=0
strans% 32,stransW% 32,sgblk% 256,sgblkB% 256*4,savea% 1024,c0% 1024,Mgb% 256,ascale0p% 32,sgblkg% 256*4
ms_load("<SPaint$Dir>.messages")
"Wimp_SlotSize",-1,-1
slsiz%:basesiz%=slsiz%
kFty01%=104:ty02%=64:tx01%=0:tx02%=258:viewR%=-1:viewG%=-1:viewB%=-1
buff% &400,buffo% &400,buffb% &400,gb% &400,gbw% &200,gblk% &400,GWb% &400,gb2% &100
m!page%=64*1024:g%=0:handle1%=0
n virtual%=0:m64%=64*1024*1024
mscd=1
"XOS_SWINumberFromString",,"DragASprite_Start"
ds%;F
ds%=-1
"XOS_SWINumberFromString",,"DragASprite_Stop"
de%;F
de%=-1
6,161,28
,,f%:
(f%
2)=0
ds%=-1:de%=-1
!!!PCA!!! local dynamic area and sprite details
xFlocal%=0:local2%=0:localtag%=-1:spria%=0:spril%=0:local$="Nothing"
!!!PCA!!! inplace editing (remote) flags and storage...
{$inplace%=-1:localtask%=0:uflg%=0
!!!PCA!!! inplace editing (local) flags and storage...
aremote%=-1:remotetask%=0
remoteicblk% 32*10:ricptr%=remoteicblk%:Rbdr%=0
buffers for simple menu - can be scratch space
cbstr% &120,cbbuff% &120
end%=
savingfile%=0:DRAGGING%=0
wad%(32),Wbtsk% &300,wid%(32),GB% &2400,styleindir &1300,generalstore% &500:wid%()=0:lastopen%=-1:gb%=GB%+&1700:gblk%=GB%+&1A00:Wb%=GB%:
setupstores
EX%=
F%=0:outform%=0