1 -> rexxbgui
.library version
4.0
3 -> Copyright © Jilles Tjoelker
1999
6 -> * Version number bumped because of new functions
.
7 -> * Added image buttons
.
8 -> * Added a simple file requester function
.
9 -> * Added a function to set up listview control with the arrow keys
.
10 -> * Bug fixed
: I
once disabled CYC_Active but forgot to enable it again
.
13 -> * Version number bumped because of new functions
.
14 -> * Added separators
and cycle gadgets
.
15 -> * Added version testing functions
bguirexxversion() and bguiversion().
18 -> * Version number bumped because of new functions
.
20 -> * Added progress
bar (suggested by Ingo Musquinier
) and indicator
.
21 -> * Bug fixed
: bguiwindow() did
not get the argument count correctly
. This
22 -> caused problems
, because ARexx does
not clear extra argument slots but
23 -> instead leaves in them what values happen to be contained in them
from
24 -> previous function calls
.
27 -> * New functions
: bguiwinbusy(), bguiwinready(), bguipages(), bguimx(),
28 -> bguiactivategadget(), bguilist(), bguiaddcondit(), bguilistvaddentry(),
29 -> bguilistvcommand(), bguilistvreplacesel()
30 -> * New argument for bgui
[hv
]group(), equal
, to force equal width
or height
31 -> of the objects in the group
32 -> * New argument for
bguiwindow(), pos
, to open the window on another position
33 -> than centred on the screen
34 -> * Some nonfunctional tags removed
35 -> * New tags
: BT_#?
, PAGE_#?
, MX_#?
, TAG_IGNORE
36 -> * Better documentation
37 -> * Bug fixed
: the library could be flushed
from memory when a
bguiopen() was
39 -> * A control
-C break
is now accepted immediately in
bguiwinwaitevent() and
40 -> bguiwait() and passed to ARexx
.
41 -> * Bug fixed
: BGUI
41.10 took the command name
, which
is always equal to
"", for
42 -> the prefs filename
. Fixed by temporarily setting the pr_Cli pointer to zero
.
44 -> Look in the example scripts for more information
.
45 -> General ARexx limitation
: functions can only have up to
15 arguments
.
49 -> Escape sequences can be used in most texts
, including labels
, frame titles
50 -> info object contents
and listview entries
. Frame titles may have shadow
.
51 -> Listview entries
and labels within objects can be text on background
or
52 -> filltext on fill
; when you change the colours it cannot be restored
.
53 -> ESC
='1b'x
or just use the Esc key to put it in a
string constant
.
55 -> ESC||ESC no operation
; used to
separate sequences ending in a digit
56 -> from normal digits
.
57 -> ESC
'u' underlined
on (do not use for indicating a hotkey
)
60 -> ESC
'z' underscore
on (can indicate the hotkey for a gadget
, only visual
61 -> though
, use BT_Key to make it work
)
63 -> ESC
'd'n set DrawInfo pen #
n (2=text
, 3=shine
, 4=shadow
, 5=selected gadget
64 -> fill
, 6=text on fill
, 7=background
, 8=important text
)
65 -> ESC
'p'n set colour #n
66 -> ESC
'D'n set DrawInfo pen #n
as background
67 -> ESC
'P'n set colour #n
as background
68 -> ESC
's' shadow
on (additionally use ESC
'd3')
69 -> ESC
'-'ch turn something
off (ch
=u
/b
/i
/s
/z
)
70 -> ESC
'c' centre this
and the following lines
71 -> ESC
'r' right
-justify this
and the following lines
72 -> ESC
'l' left
-justify this
and the following lines
73 -> '0a'x new line
. This does
not work for listview entries
and frame titles
.
78 OPT OSVERSION
=37,LARGE
80 MODULE
'rexx/storage','rexxsyslib','tools/rexxvar','rexx/rxslib',
81 'exec/nodes','exec/lists','exec/ports','dos/dos','icon',
82 'exec/tasks','exec/libraries','exec/memory','amigalib/lists',
83 'utility','dos/dosextens','utility/tagitem','tools/boopsi',
84 'intuition/intuition','intuition/gadgetclass','bgui',
85 'libraries/bgui','libraries/gadtools','workbench/workbench',
86 'libraries/asl','utility/hooks','tools/installhook',
87 'devices/inputevent','*strchr','*stricmp'
89 LIBRARY
'rexxbgui.library',4,0,'rexxbgui.library 4.0 (24.6.99)' IS
92 OBJECT idcmphook OF hook
103 stringspace
:mlh
-> MinList of stringbuffer
104 objects
:mlh
-> MinList of objnode
105 images
:mlh
-> MinList of imagenode
107 chipmem
:PTR TO memblock
118 dobj
:PTR TO diskobject
133 ENUM TAG_INT
,TAG_STRING
,TAG_OBJECT
,TAG_MENU
,TAG_MAX
141 DEF templist
[160]:LIST
,tempstr
[256]:STRING,tasknode
=NIL
:PTR TO tasknode
142 DEF rexxbguibase
:PTR TO lib
144 PROC
idcmphook_func(h
:PTR TO idcmphook
,wd_obj
,imsg
:PTR TO intuimessage
)
145 DEF code
,qual
,wnd
,reportid
=0,ridflags
=0
146 IF h
.window_object
<>wd_obj
THEN RETURN
147 GetAttr(WINDOW_Window
,wd_obj
,{wnd
})
148 code
:=imsg
.code
; qual
:=imsg
.qualifier
149 IF imsg
.class=IDCMP_RAWKEY
150 IF (code
=67) OR (code
=68)
152 ELSEIF code
=$
4C
-> Arrow up
153 IF imsg
.qualifier
AND (IEQUALIFIER_LSHIFT
OR IEQUALIFIER_RSHIFT
)
154 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_Page_Up
,0])
155 ELSEIF imsg
.qualifier
AND (IEQUALIFIER_LALT
OR IEQUALIFIER_RALT
)
156 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_First
,0])
158 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_Previous
,0])
160 reportid
:=h
.doarrowmessages
161 ELSEIF code
=$
4D
-> Arrow down
162 IF imsg
.qualifier
AND (IEQUALIFIER_LSHIFT
OR IEQUALIFIER_RSHIFT
)
163 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_Page_Down
,0])
164 ELSEIF imsg
.qualifier
AND (IEQUALIFIER_LALT
OR IEQUALIFIER_RALT
)
165 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_Last
,0])
167 SetGadgetAttrsA(h
.listview
,wnd
,NIL
,[LISTV_Select
,LISTV_Select_Next
,0])
169 reportid
:=h
.doarrowmessages
172 ListCopy(templist
,[WM_REPORT_ID
])
173 listadd2(templist
,reportid
,ridflags
)
174 domethod(wd_obj
,templist
)
177 PROC
query(rm
:PTR TO rexxmsg
) HANDLE
178 DEF rc
=1,result=NIL
,q
:PTR TO CHAR
,wnd
:PTR TO window
180 DEF obj
,n
,i
,plong
:PTR TO LONG
181 DEF dos
:PTR TO doslibrary
,temp2str
[80]:STRING,c
182 DEF t
:PTR TO taginfo
,flags
184 MOVE
.L A6
,rexxbguibase
186 StrCopy(tempstr
,rm
.args
[0],4)
187 IF stricmp(tempstr
,'bgui') THEN Raise(0)
190 utilitybase
:=dos
.utilitybase
191 rexxsysbase
:=rm
.libbase
192 funcname
:=rm
.args
[0]+4
193 IF funcname
[]="_" THEN funcname
++
195 IF stricmp(funcname
,'open')=0
196 /* success
=bguiopen([taskname
],[noerrorifopenfail
])
198 -> This function opens bgui
.library
. Version
41 is required
.
199 -> taskname indicates the name of the prefs file
, default
"ARexx".
200 -> Predefined are
: ID
.WIN(CLOSE|NOMORE|INACTIVE|ACTIVE
).
201 -> If this function has
not yet been called
, all functions starting with
202 -> 'bgui' cause
"Error return from function".
204 IF tasknode
:=findtasknode(rm
)
209 tasknode
:=addtasknode(rm
,rm
.args
[1])
211 tasknode
:=addtasknode(rm
,NIL
)
213 rc
:=setRexxVar(rm
,'ID.WINCLOSE','65536',STRLEN
) OR
214 setRexxVar(rm
,'ID.WINNOMORE','131072',STRLEN
) OR
215 setRexxVar(rm
,'ID.WININACTIVE','196608',STRLEN
) OR
216 setRexxVar(rm
,'ID.WINACTIVE','262144',STRLEN
)
218 freetasknode(rm
,tasknode
)
222 result:=CreateArgstring('1',STRLEN
)
224 IF n
>=2 AND rm
.args
[2]
225 result:=CreateArgstring('0',STRLEN
)
230 ELSEIF (tasknode
:=findtasknode(rm
))=NIL
232 ELSEIF stricmp(funcname
,'wait')=0
235 -> Wait for most events
; Control
-C
is passed trough to ARexx
236 -> (signal on break_c
).
237 i
:=Wait($FFFF0000
OR SIGBREAKF_CTRL_C
)
238 IF i
AND SIGBREAKF_CTRL_C
239 SetSignal(SIGBREAKF_CTRL_C
,SIGBREAKF_CTRL_C
)
242 result:=CreateArgstring('1',STRLEN
)
243 ELSEIF stricmp(funcname
,'winevent')=0
244 /* id
=bguiwinevent(winobj
,[destvar
])
246 -> This function does
not wait for events
.
247 IF rm
.action
AND $F
<1
248 rc
:=17 -> Wrong number of arguments
250 installhook(tasknode
.idcmphook
,{idcmphook_func
})
251 obj
:=Long(rm
.args
[1])
252 rc
:=domethod(obj
,[WM_HANDLEIDCMP
])
253 StringF(tempstr
,'\d',rc
)
254 result:=CreateArgstring(tempstr
,EstrLen(tempstr
))
257 rc
:=setRexxVar(rm
,rm
.args
[2],tempstr
,EstrLen(tempstr
))
260 ELSEIF stricmp(funcname
,'winwaitevent')=0
261 /* id
=bguiwaitwinevent(winobj
,[destvar
])
263 -> This function
is much more efficient than the
bguiwinevent()/bguiwait()
265 IF rm
.action
AND $F
<1
266 rc
:=17 -> Wrong number of arguments
268 installhook(tasknode
.idcmphook
,{idcmphook_func
})
269 obj
:=Long(rm
.args
[1])
271 WHILE (rc
:=domethod(obj
,[WM_HANDLEIDCMP
]))=WMHI_NOMORE
272 i
:=Wait($FFFF0000
OR SIGBREAKF_CTRL_C
)
273 EXIT i
AND SIGBREAKF_CTRL_C
275 IF i
AND SIGBREAKF_CTRL_C
276 SetSignal(SIGBREAKF_CTRL_C
,SIGBREAKF_CTRL_C
)
278 StringF(tempstr
,'\d',rc
)
279 result:=CreateArgstring(tempstr
,EstrLen(tempstr
))
282 rc
:=setRexxVar(rm
,rm
.args
[2],tempstr
,EstrLen(tempstr
))
285 ELSEIF stricmp(funcname
,'winopen')=0
286 /* success
=bguiwinopen(winobj
)
288 -> This function must be used to open a window
. When a window object
is created
,
289 -> it does
not open automatically
, unlike some other GUI engines
' behaviour.
290 -> This enables you to do things like bguiwintabcycleorder() in time.
291 IF rm.action AND $F<>1 OR (rm.args[1]=NIL)
292 rc:=17 -> Wrong number of arguments
293 ELSEIF LengthArgstring(rm.args[1])<>4
294 rc:=18 -> Invalid argument to function
296 obj:=Long(rm.args[1])
298 IF domethod(obj,[WM_OPEN])
299 result:=CreateArgstring('1',STRLEN)
301 result:=CreateArgstring('0',STRLEN)
304 ELSEIF stricmp(funcname,'winclose
')=0
305 /* x=bguiwinclose(winobj)
307 IF rm.action AND $F<>1 OR (rm.args[1]=NIL)
308 rc:=17 -> Wrong number of arguments
309 ELSEIF LengthArgstring(rm.args[1])<>4
310 rc:=18 -> Invalid argument to function
313 obj:=Long(rm.args[1])
314 domethod(obj,[WM_CLOSE])
315 result:=CreateArgstring('1',STRLEN)
317 ELSEIF stricmp(funcname,'winbusy
')=0
318 /* success=bguiwinbusy(winobj)
320 -> Use this function to set a busy pointer and zero-size requester that blocks
321 -> input on a window. It nests, i.e. the window will not be unblocked until
322 -> one bguiwinready() has been done for each bguiwinbusy() executed.
323 IF rm.action AND $F<>1 OR (rm.args[1]=NIL)
324 rc:=17 -> Wrong number of arguments
325 ELSEIF LengthArgstring(rm.args[1])<>4
326 rc:=18 -> Invalid argument to function
328 obj:=Long(rm.args[1])
329 rc:=domethod(obj,[WM_SLEEP])
330 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
333 ELSEIF stricmp(funcname,'winready
')=0
334 /* success=bguiwinready(winobj)
336 IF rm.action AND $F<>1 OR (rm.args[1]=NIL)
337 rc:=17 -> Wrong number of arguments
338 ELSEIF LengthArgstring(rm.args[1])<>4
339 rc:=18 -> Invalid argument to function
341 obj:=Long(rm.args[1])
342 rc:=domethod(obj,[WM_WAKEUP])
343 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
346 ELSEIF stricmp(funcname,'window
')=0
347 /* obj=bguiwindow(title,mastergroup,[scalew],[scaleh],[refwin],[scrname],[pos],[menu])
349 -> scale[wh]: 0% = minimum size, 100% = full screen
350 -> Precede scalew and/or scaleh with a minus sign to lock the dimension.
351 -> Locking both removes the size gadget.
352 -> refwin: the new window object will open on the same screen as refwin
353 -> pos 'S
' centre on screen
354 -> 'M
' centre on mouse pointer
355 -> 'T
' top-left of the screen
356 -> 'W
' centre on window
357 -> 'B
' l t w h position in screen (pixel) coordinates
358 -> 'R
' l t w h centre window on this box
359 -> '*' (anywhere) do not activate window upon opening (doesn't really
360 -> fit here but this saves arguments
)
361 -> menu
: concatenate
bguimenu() results
362 rc
,result:=createwindow(rm
,templist
,tempstr
)
363 ELSEIF stricmp(funcname
,'layout')=0
364 /* info
=bguilayout(tag
,value
,[tag
],[value
],...)
366 -> Concatenate the return value of this to an object
. It does
not work for
368 IF (n
:=rm
.action
AND $F
)<2 OR Odd(n
)
370 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
)
371 rc
:=17 -> Wrong number of arguments
374 ListCopy(templist
,[-1])
375 FOR q
:=1 TO n
-1 STEP
2
376 t
:=findtag(rm
.args
[q
])
377 SELECT TAG_MAX OF t
.type
378 CASE TAG_INT
; listadd2(templist
,t
.value
,Val(rm
.args
[q
+1]))
379 DEFAULT
; rc
:=18 -> Invalid argument to function
384 ListAdd(templist
,[TAG_DONE
])
385 result:=CreateArgstring(templist
,ListLen(templist
)*4)
388 ELSEIF stricmp(funcname
,'varspace')=0
389 /* info
=bguivarspace(weight
)
391 -> A weight controlled spacing in a group
; 1<weight
<1023
392 -> bguilayout() cannot be used on this
.
393 IF (rm
.action
AND $F
)<>1
395 ELSEIF rm
.args
[1]=NIL
396 rc
:=17 -> Wrong number of arguments
397 ELSEIF (q
:=Val(rm
.args
[1]))<=0
398 rc
:=18 -> Invalid argument to function
400 rc
:=18 -> Invalid argument to function
403 result:=CreateArgstring({q
},SIZEOF LONG
)
405 ELSEIF stricmp(funcname
,'hgroup')=0 OR ((q
:=stricmp(funcname
,'vgroup'))=0)
406 /* obj
=bgui
[hv
]group(objects
,[spacing
],[offset
],[title
],[equal
])
408 -> Double use of objects
or forgotten
'||' is caught
-> error
12.
409 -> spacing
/offset
-1 narrow
410 -> -2 normal (default
, unlike groupclass itself
)
412 -> offset
'F' frame (required for a title
)
413 -> equal
'W' all objects the same width
414 -> 'H' all objects the same height
415 -> 'S' all objects the same width
and height
417 ListCopy(templist
,[GROUP_Style
,GRSTYLE_VERTICAL
])
421 IF (n
:=rm
.action
AND $F
)<1
423 ELSEIF rm
.args
[1]=NIL
426 IF rm
.args
[2] AND (n
>=2)
427 listadd2(templist
,GROUP_Spacing
,Val(rm
.args
[2]))
429 listadd2(templist
,GROUP_Spacing
,GRSPACE_NORMAL
)
431 IF rm
.args
[3] AND (n
>=3)
432 IF Char(rm
.args
[3])="f" OR (Char(rm
.args
[3])="F")
434 GROUP_HorizOffset
,GRSPACE_NORMAL
,
435 GROUP_VertOffset
,GRSPACE_NORMAL
,
436 FRM_Type
,FRTYPE_DEFAULT
439 listadd2(templist
,GROUP_HorizOffset
,Val(rm
.args
[3]))
440 listadd2(templist
,GROUP_VertOffset
,Val(rm
.args
[3]))
443 IF rm
.args
[4] AND (n
>=4)
444 listadd2(templist
,FRM_Title
,addstring(rm
.args
[4]))
446 IF rm
.args
[5] AND (n
>=5)
447 IF (c
:=Char(rm
.args
[5]))="w" OR (c
="W")
448 ListAdd(templist
,[GROUP_EqualWidth
,TRUE])
449 ELSEIF c
="h" OR (c
="H")
450 ListAdd(templist
,[GROUP_EqualHeight
,TRUE])
451 ELSEIF c
="s" OR (c
="S")
452 ListAdd(templist
,[GROUP_EqualWidth
,TRUE,GROUP_EqualHeight
,TRUE])
457 q
:=plong
+LengthArgstring(rm
.args
[1])
460 IF obj
>0 AND (obj
<1024)
461 listadd2(templist
,GROUP_SpaceObject
,obj
)
463 IF (n
:=ListLen(templist
))>=4 AND (templist
[n
-1]=0) AND (templist
[n
-2]=0)
464 SetList(templist
,n
-2)
468 listadd1(templist
,plong
[])
471 ListAdd(templist
,[TAG_END
,0])
478 ELSEIF removeobjnode(obj
)
479 listadd2(templist
,GROUP_Member
,obj
)
480 ListAdd(templist
,[TAG_END
,0])
482 rc
:=18 -> Invalid argument to function
486 ListAdd(templist
,[TAG_DONE
])
488 IF obj
:=BgUI_NewObjectA(BGUI_GROUP_GADGET
,templist
)
493 result:=CreateArgstring({obj
},4)
499 ELSEIF stricmp(funcname
,'pages')=0
500 /* obj
=bguipages(name
,objects
)
502 -> This function only creates OBJ
.name
, not ID
.name
.
503 -> Do not set PAGE_Active values which are out of range
!
504 -> The usage of pages increases the number of objects that can be in a window
505 -> and therefore object
creation time
. The BGUI prefs program
is an example of
507 IF rm
.action
AND $F
<>2 OR (rm
.args
[1]=NIL
) OR (rm
.args
[2]=NIL
)
510 ListCopy(templist
,[TAG_IGNORE
,0])
513 q
:=plong
+LengthArgstring(rm
.args
[2])
516 IF removeobjnode(obj
)
517 listadd2(templist
,PAGE_Member
,obj
)
519 rc
:=18 -> Invalid argument to function
523 ListAdd(templist
,[TAG_DONE
])
525 IF obj
:=BgUI_NewObjectA(BGUI_PAGE_GADGET
,templist
)
530 StringF(tempstr
,'OBJ.\s',rm
.args
[1])
532 rc
:=setRexxVar(rm
,tempstr
,{obj
},4)
533 result:=CreateArgstring({obj
},4)
539 ELSEIF stricmp(funcname
,'button')=0
540 /* obj
=bguibutton(name
,label
)
542 -> As other
"real" gadget
creation functions
, this one sets both ID
.name
543 -> (compare with
bguiwinevent() or bguiwinwaitevent() result) and OBJ
.name (for
544 -> bguiget() and similar functions
).
546 -> Prefix the keyboard shortcut with
'_' in label
. This also applies to other
547 -> gadgets
. Take care that
all shortcuts are different
! BGUI does
not check
548 -> this (MUI doesn
't either). This type of bug is present in much software.
549 IF rm.action AND $F<>2
550 rc:=17 -> Wrong number of arguments
553 StringF(tempstr,'ID
.\s
',rm.args[1])
555 tasknode.lastid:=tasknode.lastid+1
557 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
558 listadd2(templist,GA_ID,q)
559 listadd2(templist,LAB_Label,addstring(rm.args[2]))
560 listadd1(templist,TAG_DONE)
561 IF obj:=BgUI_NewObjectA(BGUI_BUTTON_GADGET,templist)
563 StringF(tempstr,'OBJ
.\s
',rm.args[1])
565 rc:=setRexxVar(rm,tempstr,{obj},4)
566 result:=CreateArgstring({obj},4)
571 ELSEIF stricmp(funcname,'toggle
')=0
572 /* obj=bguitoggle(name,label,[state])
574 IF (n:=rm.action AND $F)<2 OR (n>3)
575 rc:=17 -> Wrong number of arguments
576 ELSEIF rm.args[1]=NIL OR (rm.args[2]=NIL)
577 rc:=17 -> Wrong number of arguments
580 StringF(tempstr,'ID
.\s
',rm.args[1])
582 tasknode.lastid:=tasknode.lastid+1
584 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
585 listadd2(templist,GA_ID,q)
586 listadd2(templist,LAB_Label,addstring(rm.args[2]))
588 listadd2(templist,GA_SELECTED,Val(rm.args[3]))
590 ListAdd(templist,[GA_SELECTED,FALSE])
592 ListAdd(templist,[GA_TOGGLESELECT,TRUE,TAG_DONE])
593 IF obj:=BgUI_NewObjectA(BGUI_BUTTON_GADGET,templist)
595 StringF(tempstr,'OBJ
.\s
',rm.args[1])
597 rc:=setRexxVar(rm,tempstr,{obj},4)
598 result:=CreateArgstring({obj},4)
603 ELSEIF stricmp(funcname,'checkbox
')=0
604 /* obj=bguicheckbox(name,[label],[state])
606 IF (n:=rm.action AND $F)<2 OR (n>3)
607 rc:=17 -> Wrong number of arguments
608 ELSEIF rm.args[1]=NIL
609 rc:=17 -> Wrong number of arguments
612 StringF(tempstr,'ID
.\s
',rm.args[1])
614 tasknode.lastid:=tasknode.lastid+1
616 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
617 listadd2(templist,GA_ID,q)
618 IF rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
620 listadd2(templist,GA_SELECTED,Val(rm.args[3]))
622 ListAdd(templist,[GA_SELECTED,FALSE])
624 ListAdd(templist,[TAG_DONE])
625 IF obj:=BgUI_NewObjectA(BGUI_CHECKBOX_GADGET,templist)
627 StringF(tempstr,'OBJ
.\s
',rm.args[1])
629 rc:=setRexxVar(rm,tempstr,{obj},4)
630 result:=CreateArgstring({obj},4)
635 ELSEIF stricmp(funcname,'ibutton
')=0
636 /* obj=bguiibutton(name,itype,idata,[label],[lplace])
640 -> itype 'B
' BGUI built-in
643 -> 'V
' vector (not yet implemented)
644 -> '-' (anywhere) no frame
645 -> '*' (anywhere) no spacing between frame and image
646 -> idata (itype='B
') number, 'F
'=getfile, 'P
'=popup, 'D
'=getpath
647 -> (itype='I
') filename without .info
648 -> (itype='M
') one or two results of bguiimage() (normal & selected)
649 -> (itype='V
') string
650 -> lplace 'L
' left (default)
654 rc,result:=createibutton(rm,tempstr,templist)
655 ELSEIF stricmp(funcname,'info
')=0
656 /* obj=bguiinfo(name,[label],contents)
658 -> Non-clickable information object.
659 IF rm.action AND $F<>3
660 rc:=17 -> Wrong number of arguments
663 StringF(tempstr,'ID
.\s
',rm.args[1])
665 tasknode.lastid:=tasknode.lastid+1
667 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
668 listadd2(templist,GA_ID,q)
669 listadd2(templist,INFO_FixTextWidth,TRUE)
670 listadd2(templist,FRM_Type,FRTYPE_DEFAULT)
671 IF rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
672 listadd2(templist,INFO_TextFormat,q:=rm.args[3])
673 n:=1; WHILE c:=q[]++ DO IF c="\n" THEN n++
674 listadd2(templist,INFO_MinLines,n)
675 listadd1(templist,TAG_DONE)
676 IF obj:=BgUI_NewObjectA(BGUI_INFO_GADGET,templist)
678 StringF(tempstr,'OBJ
.\s
',rm.args[1])
680 rc:=setRexxVar(rm,tempstr,{obj},4)
681 result:=CreateArgstring({obj},4)
686 ELSEIF stricmp(funcname,'string')=0
687 /* obj=bguistring(name,[label],[contents],maxchars)
689 IF rm.action AND $F<>4
690 rc:=17 -> Wrong number of arguments
691 ELSEIF rm.args[1]=NIL OR (rm.args[4]=NIL)
692 rc:=17 -> Wrong number of arguments
695 StringF(tempstr,'ID
.\s
',rm.args[1])
697 tasknode.lastid:=tasknode.lastid+1
699 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
700 listadd2(templist,GA_ID,q)
701 IF rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
703 listadd2(templist,STRINGA_TEXTVAL,rm.args[3])
705 listadd2(templist,STRINGA_MAXCHARS,Val(rm.args[4]))
706 listadd1(templist,TAG_DONE)
707 IF obj:=BgUI_NewObjectA(BGUI_STRING_GADGET,templist)
709 StringF(tempstr,'OBJ
.\s
',rm.args[1])
711 rc:=setRexxVar(rm,tempstr,{obj},4)
712 result:=CreateArgstring({obj},4)
717 ELSEIF stricmp(funcname,'integer')=0
718 /* obj=bguiinteger(name,[label],[contents],[maxchars],[min],[max])
720 -> It is not guaranteed, that min<=bguiget(int,STRINGA_LongVal)<=max.
721 IF (n:=rm.action AND $F)>6
722 rc:=17 -> Wrong number of arguments
723 ELSEIF rm.args[1]=NIL
724 rc:=17 -> Wrong number of arguments
727 StringF(tempstr,'ID
.\s
',rm.args[1])
729 tasknode.lastid:=tasknode.lastid+1
731 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
732 listadd2(templist,GA_ID,q)
734 IF rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
736 IF n>=3 AND rm.args[3]
737 listadd2(templist,STRINGA_LONGVAL,Val(rm.args[3]))
739 listadd2(templist,STRINGA_LONGVAL,0)
741 IF n>=4 AND rm.args[4]
742 listadd2(templist,STRINGA_MAXCHARS,Val(rm.args[4]))
744 listadd2(templist,STRINGA_MAXCHARS,12)
746 IF n>=5 AND rm.args[5]
747 listadd2(templist,STRINGA_IntegerMin,Val(rm.args[5]))
749 listadd2(templist,STRINGA_IntegerMin,$80000000)
751 IF n>=6 AND rm.args[6]
752 listadd2(templist,STRINGA_IntegerMax,Val(rm.args[6]))
754 listadd2(templist,STRINGA_IntegerMax,$7FFFFFFF)
756 listadd1(templist,TAG_DONE)
757 IF obj:=BgUI_NewObjectA(BGUI_STRING_GADGET,templist)
758 IF rm.args[3]=NIL OR (n<3)
759 GetAttr(STRINGA_TEXTVAL,obj,{q})
760 SetGadgetAttrsA(obj,NIL,NIL,[STRINGA_LONGVAL,0,TAG_DONE])
764 StringF(tempstr,'OBJ
.\s
',rm.args[1])
766 rc:=setRexxVar(rm,tempstr,{obj},4)
767 result:=CreateArgstring({obj},4)
772 ELSEIF stricmp(funcname,'listview
')=0
773 /* obj=bguilistview(name,[label],[stem],[type],[ncolumns])
775 -> type 'R
' read-only
776 -> 'S
' select (default)
778 -> In multi-column listview entries, the columns are separated by a tab
779 -> character. Attributes set with escape sequences do not continue from
780 -> one column to the next.
781 -> Optionally, you can append column weights to ncolumns, e.g. '3 10 45 45' to
782 -> create one small column and two wider ones.
783 IF (n:=rm.action AND $F)<1 OR (n>5)
784 rc:=17 -> Wrong number of arguments
787 StringF(tempstr,'ID
.\s
',rm.args[1])
789 tasknode.lastid:=tasknode.lastid+1
791 setRexxVar(rm,tempstr,StringF(temp2str,'\d
',q),EstrLen(temp2str))
792 listadd2(templist,GA_ID,q)
793 IF n>=2 AND rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
794 IF n>=4 AND (q:=rm.args[4])
797 ListAdd(templist,[LISTV_ReadOnly,TRUE])
798 ELSEIF c="D" OR (c="d")
799 ListAdd(templist,[LISTV_ShowDropSpot,TRUE,BT_DragObject,TRUE,BT_DropObject,TRUE])
802 IF n>=5 AND (q:=rm.args[5])
803 listadd2(templist,LISTV_Columns,Val(q,{c}))
804 ListAdd(templist,[LISTV_DragColumns,TRUE])
806 IF q[]>"9" OR (q[]<"0") THEN q++
812 IF q[]>"9" OR (q[]<"0") THEN q++
815 IF plong<>tempstr THEN listadd2(templist,LISTV_ColumnWeights,tempstr)
817 listadd1(templist,TAG_DONE)
818 IF obj:=BgUI_NewObjectA(BGUI_LISTVIEW_GADGET,templist)
820 StringF(tempstr,'OBJ
.\s
',rm.args[1])
822 rc:=setRexxVar(rm,tempstr,{obj},4)
823 result:=CreateArgstring({obj},4)
824 IF n>=3 AND (q:=rm.args[3])
825 StringF(tempstr,'\s
.COUNT
',q)
827 IF getRexxVar(rm,tempstr,{n})=0
830 StringF(tempstr,'\s
.\d
',q,i)
832 IF getRexxVar(rm,tempstr,{c})=0
833 ListCopy(templist,[LVM_ADDSINGLE,NIL])
835 ListAdd(templist,[LVAP_TAIL,0])
836 domethod(obj,templist)
845 ELSEIF stricmp(funcname,'mx
')=0
846 /* obj=bguimx(name,[label],stem,[type])
848 -> type 'R
' radio buttons (default)
850 -> 'U
' upside down tabs
851 -> The number of entries is limited to 63 (it must fit on the screen, so it's
not
852 -> much of a limitation
)
853 IF (n
:=rm
.action
AND $F
)<3 OR (n
>4)
854 rc
:=17 -> Wrong number of arguments
855 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[3]=NIL
)
858 StringF(tempstr
,'ID.\s',rm
.args
[1])
860 tasknode
.lastid
:=tasknode
.lastid
+1
862 setRexxVar(rm
,tempstr
,StringF(temp2str
,'\d',q
),EstrLen(temp2str
))
863 listadd2(templist
,GA_ID
,q
)
864 ListAdd(templist
,[LAB_NoPlaceIn
,TRUE])
865 IF n
>=2 AND rm
.args
[2] THEN listadd2(templist
,LAB_Label
,addstring(rm
.args
[2]))
866 IF n
>=4 AND (q
:=rm
.args
[4])
869 ListAdd(templist
,[MX_TabsObject
,TRUE])
870 ELSEIF c
="U" OR (c
="u")
871 ListAdd(templist
,[MX_TabsObject
,TRUE,MX_TabsUpsideDown
,TRUE])
873 ListAdd(templist
,[GROUP_Style
,GRSTYLE_VERTICAL
])
877 StringF(temp2str
,'\s.COUNT',q
)
880 IF getRexxVar(rm
,temp2str
,{n
})=0
881 n
:=Bounds(Val(n
),0,63)
883 StringF(temp2str
,'\s.\d',q
,i
)
885 IF getRexxVar(rm
,temp2str
,{c
})=0
886 plong
[]++:=addstring(c
)
889 IF plong
=tempstr
THEN plong
[]++:=addstring('\eb\ei\euNO LABELS')
891 listadd2(templist
,MX_Labels
,tempstr
)
892 listadd1(templist
,TAG_DONE
)
893 IF obj
:=BgUI_NewObjectA(BGUI_MX_GADGET
,templist
)
895 StringF(tempstr
,'OBJ.\s',rm
.args
[1])
897 rc
:=setRexxVar(rm
,tempstr
,{obj
},4)
898 result:=CreateArgstring({obj
},4)
906 ELSEIF stricmp(funcname
,'cycle')=0
907 /* obj
=bguicycle(name
,[label
],stem
,[type
])
909 -> type
'P' force popup regardless of BGUI prefs
910 -> 'N' popup
if enabled in BGUI
prefs (default
)
911 -> Pop on active setting
is taken
from BGUI prefs
912 -> The number of entries
is limited to
63 (BGUI popup cycles truncate a list that
913 -> doesn
't fit on the screen, so it's
not much of a limitation
)
914 IF (n
:=rm
.action
AND $F
)<3 OR (n
>4)
915 rc
:=17 -> Wrong number of arguments
916 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[3]=NIL
)
919 StringF(tempstr
,'ID.\s',rm
.args
[1])
921 tasknode
.lastid
:=tasknode
.lastid
+1
923 setRexxVar(rm
,tempstr
,StringF(temp2str
,'\d',q
),EstrLen(temp2str
))
924 listadd2(templist
,GA_ID
,q
)
925 ListAdd(templist
,[LAB_NoPlaceIn
,TRUE])
926 IF n
>=2 AND rm
.args
[2] THEN listadd2(templist
,LAB_Label
,addstring(rm
.args
[2]))
927 IF n
>=4 AND (q
:=rm
.args
[4])
930 ListAdd(templist
,[CYC_Popup
,TRUE])
934 StringF(temp2str
,'\s.COUNT',q
)
937 IF getRexxVar(rm
,temp2str
,{n
})=0
938 n
:=Bounds(Val(n
),0,63)
940 StringF(temp2str
,'\s.\d',q
,i
)
942 IF getRexxVar(rm
,temp2str
,{c
})=0
943 plong
[]++:=addstring(c
)
946 IF plong
=tempstr
THEN plong
[]++:=addstring('\eb\ei\euNO LABELS')
948 listadd2(templist
,CYC_Labels
,tempstr
)
949 listadd1(templist
,TAG_DONE
)
950 IF obj
:=BgUI_NewObjectA(BGUI_CYCLE_GADGET
,templist
)
952 StringF(tempstr
,'OBJ.\s',rm
.args
[1])
954 rc
:=setRexxVar(rm
,tempstr
,{obj
},4)
955 result:=CreateArgstring({obj
},4)
963 ELSEIF stricmp(funcname
,'progress')=0
964 /* obj
=bguiprogress(name
,[label
],min
,max
,[format
],[type
])
966 -> format
: C
-style format
string for text in the gadget
. Use %ld
as a
967 -> placeholder for the number
. Other percent signs must be doubled
. Other
968 -> possibilities
: "%03ld" forces a field size of three digits
and pads on the
969 -> left with zeroes
. "%lD" formats the number according to the language selected
970 -> and works only
if locale
.library
is installed
. "%lx" creates a hexadecimal
972 -> BGUI
41.10 draws the text in the last colour
used (if done
=max
then the
973 -> progress bar colour
else the background colour
) because of a bug
, therefore
974 -> the format
string should begin with ESC
'd2'ESC||
ESC (not necessarily
2).
975 -> ESC
'D'n
is also recommended
if the text should be always visible on two
976 -> colour screens
or screens with strange
pens (e
.g
. non
-newlook (no
3D look
)).
977 -> If you don
't want the problems of a format string, then you can use
978 -> bguiaddmap() to put the number in an indicator next to the progress bar.
979 -> type 'H
' horizontal
981 -> The amount done is set to zero or the minimum.
982 IF (n:=rm.action AND $F)<4 OR (n>6)
983 rc:=17 -> Wrong number of arguments
984 ELSEIF rm.args[1]=NIL OR (rm.args[3]=NIL) OR (rm.args[4]=NIL)
985 rc:=17 -> Wrong number of arguments
988 IF rm.args[2] THEN listadd2(templist,LAB_Label,addstring(rm.args[2]))
989 listadd2(templist,PROGRESS_Min,Val(rm.args[3]))
990 listadd2(templist,PROGRESS_Max,Val(rm.args[4]))
991 IF n>=5 AND rm.args[5]
992 listadd2(templist,PROGRESS_FormatString,addstring(rm.args[5]))
994 IF n>=6 AND rm.args[6]
995 IF (c:=Char(rm.args[6]))="V" OR (c="v")
996 ListAdd(templist,[PROGRESS_Vertical,TRUE])
999 ListAdd(templist,[TAG_DONE])
1000 IF obj:=BgUI_NewObjectA(BGUI_PROGRESS_GADGET,templist)
1002 StringF(tempstr,'OBJ
.\s
',rm.args[1])
1004 rc:=setRexxVar(rm,tempstr,{obj},4)
1005 result:=CreateArgstring({obj},4)
1010 ELSEIF stricmp(funcname,'indicator
')=0
1011 /* obj=bguiindicator(name,[label],min,max,[level],[justify],[format])
1013 -> Textual level indication gadget.
1014 -> justify 'L
' left (default)
1017 -> format: the same thing as in bguiprogress() except that setting colours is
1018 -> not necessary and that it has a default "%ld".
1019 rc,result:=createindicator(rm,templist)
1020 ELSEIF stricmp(funcname,'hseparator
')=0
1021 /* obj=bguihseparator([title])
1023 -> Horizontal separator line with optional title.
1024 -> Use in vertical groups only.
1025 -> This function does not take a name argument because modifying the object is not
1026 -> supported by RexxBGUI and not useful anyway.
1027 IF (n:=rm.action AND $F)>1
1028 rc:=17 -> Wrong number of arguments
1031 listadd2(templist,SEP_Horiz,TRUE)
1032 IF n>=1 AND rm.args[1] THEN listadd2(templist,SEP_Title,addstring(rm.args[1]))
1033 listadd1(templist,TAG_DONE)
1034 IF obj:=BgUI_NewObjectA(BGUI_SEPARATOR_GADGET,templist)
1037 result:=CreateArgstring({obj},4)
1042 ELSEIF stricmp(funcname,'vseparator
')=0
1043 /* obj=bguivseparator()
1045 -> Vertical separator line.
1046 -> Use in horizontal groups only.
1047 -> This function does not take a name argument because modifying the object is not
1048 -> supported by RexxBGUI and not useful anyway.
1050 rc:=17 -> Wrong number of arguments
1052 IF obj:=BgUI_NewObjectA(BGUI_SEPARATOR_GADGET,[SEP_Horiz,FALSE,TAG_DONE])
1055 result:=CreateArgstring({obj},4)
1060 ELSEIF stricmp(funcname,'get
')=0
1061 /* res=bguiget(obj,attr)
1063 -> Error descriptions here:
1064 -> "Invalid keyword" if you supplied an attribute that RexxBGUI does not know -
1065 -> see "tags" further on in this file for which attributes are available.
1066 -> "Error return from function" if the obj parameter was not OK or if the
1067 -> object did not understand the attribute, for example an attribute of another
1068 -> gadget class or one that is not gettable;
1069 -> "Wrong number of arguments" if rm->rm_Action & 0xF is not 2 or if
1070 -> rm_Args[1] or rm_Args[2] is equal to zero.
1071 IF rm.action AND $F<>2 OR (rm.args[1]=NIL) OR (rm.args[2]=NIL)
1072 rc:=17 -> Wrong number of arguments
1073 ELSEIF LengthArgstring(rm.args[1])<>4
1074 rc:=18 -> Invalid argument to function
1075 ELSEIF (t:=findtag(rm.args[2]))=NIL
1076 rc:=33 -> Invalid keyword
1079 SELECT TAG_MAX OF t.type
1081 IF GetAttr(t.value,Long(rm.args[1]),{q})
1082 StringF(tempstr,'\d
',q)
1083 result:=CreateArgstring(tempstr,EstrLen(tempstr))
1085 rc:=18 -> Invalid argument to function
1088 IF GetAttr(t.value,Long(rm.args[1]),{q})
1090 result:=CreateArgstring(q,StrLen(q))
1092 result:=CreateArgstring('',0)
1095 rc:=18 -> Invalid argument to function
1098 IF GetAttr(t.value,Long(rm.args[1]),{q})
1099 result:=CreateArgstring({q},4)
1103 DEFAULT; rc:=18 -> Invalid argument to function
1106 ELSEIF stricmp(funcname,'set
')=0
1107 /* x=bguiset(obj,[refwin],tag,value,[tag],[value],...)
1109 -> refwin: window object in which the gadget is located; necessary if you want
1110 -> visual updating. Specifying another window causes strange results...
1111 -> If you need to set more than 6 tags, split it out over multiple calls and
1112 -> omit refwin in all possibly except the last. Put at least one attribute
1113 -> causing visual update in the last call, if you want any update.
1114 IF (n:=rm.action AND $F)<4 OR Odd(n) OR (rm.args[1]=NIL)
1115 rc:=17 -> Wrong number of arguments
1116 ELSEIF LengthArgstring(rm.args[1])<>4
1117 rc:=18 -> Invalid argument to function
1121 IF LengthArgstring(rm.args[2])=4
1122 GetAttr(WINDOW_Window,Long(rm.args[2]),{wnd})
1125 obj:=Long(rm.args[1])
1128 FOR q:=3 TO n-1 STEP 2
1129 t:=findtag(rm.args[q])
1130 IF t=NIL THEN rc:=33 -> Invalid keyword
1132 SELECT TAG_MAX OF t.type
1133 CASE TAG_INT; listadd2(templist,t.value,Val(rm.args[q+1]))
1136 PutChar(obj+40,Char(rm.args[q+1]))
1138 listadd2(templist,t.value,obj+40)
1140 listadd2(templist,t.value,rm.args[q+1])
1143 IF LengthArgstring(rm.args[q+1])=4
1144 listadd2(templist,t.value,Long(rm.args[q+1]))
1148 DEFAULT; rc:=18 -> Invalid argument to function
1153 ListAdd(templist,[TAG_DONE])
1154 rc:=SetGadgetAttrsA(obj,wnd,NIL,templist)
1155 StringF(tempstr,'\d
',rc)
1156 result:=CreateArgstring(tempstr,EstrLen(tempstr))
1160 ELSEIF stricmp(funcname,'req
')=0
1161 /* gad=bguireq(text,gadgets,[title],[refwin],[scrname])
1163 -> RequestChoice/rtEZRequest() like requester. Use '|
' to separate the gadgets.
1164 -> An asterisk adds return as a shortcut for the button it stands before and
1165 -> escape for the last one. Underscores can be used to prefix keyboard shortcuts.
1166 -> The window specified by refwin will automatically get a busypointer.
1167 -> Title defaults to refwin's title
, or "BGUI Request" or its localized
1168 -> equivalent
if wndobj
is not given
.
1169 -> Scrname does
not work
.
1170 -> gad
: 1 for the first
, 2 for the second
, etc
. and 0 for the last gadget
.
1171 IF (n
:=rm
.action
AND $F
)<2
1172 rc
:=17 -> Wrong number of arguments
1174 IF n
>=5 AND rm
.args
[5]
1176 obj
:=LockPubScreen(rm
.args
[5])
1177 templist
[]:=rm
.args
[1]
1178 rc
:=bguireq(NIL
,n
>=3 AND rm
.args
[3],'\s',rm
.args
[2],templist
,obj BUT NIL
)
1179 IF obj
THEN UnlockPubScreen(rm
.args
[5],obj
)
1182 IF n
>=4 AND rm
.args
[4]
1183 IF LengthArgstring(rm
.args
[4])=4
1184 obj
:=Long(rm
.args
[4])
1185 GetAttr(WINDOW_Window
,obj
,{q
})
1188 templist
[]:=rm
.args
[1]
1189 rc
:=bguireq(q
,n
>=3 AND rm
.args
[3],'\s',rm
.args
[2],templist
)
1191 StringF(tempstr
,'\d',rc
)
1192 result:=CreateArgstring(tempstr
,EstrLen(tempstr
))
1195 ELSEIF stricmp(funcname
,'addmap')=0
1196 /* success
=bguiaddmap(srcobj
,dstobj
,sattr
,dattr
)
1198 -> This function connects two objects so srcobj will update dstobj
's dattr
1199 -> when its sattr changes. This happens even without bguiwinevent().
1202 -> Listview with connected string gadget:
1203 -> call bguiaddmap(obj.listv,obj.str,LISTV_Entry,STRINGA_TextVal)
1204 -> Listview to select a page (#of listview entries must be #of pages!!!):
1205 -> call bguiaddmap(obj.listv,obj.pages,LISTV_EntryNumber,PAGE_Active)
1207 -> The number of attributes that can cause notification (sattr) or be updated
1208 -> (dattr) is more limited than the number that can be used with bguiget() or
1209 -> bguiset(). If notification does not work, you'll have to fall back to the
1210 -> latter mechanism
.
1212 -> There
is no
"initial" notification
.
1214 -> Notification of LGO attributes may cause a crash
. Using
bguiset() is safer
.
1215 IF rm
.action
AND $F
<>4
1216 rc
:=17 -> Wrong number of arguments
1217 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
) OR (rm
.args
[3]=NIL
) OR (rm
.args
[4]=NIL
)
1218 rc
:=17 -> Wrong number of arguments
1219 ELSEIF LengthArgstring(rm
.args
[1])<>4
1220 rc
:=18 -> Invalid argument to function
1221 ELSEIF LengthArgstring(rm
.args
[2])<>4
1222 rc
:=18 -> Invalid argument to function
1224 ListCopy(templist
,[BASE_ADDMAP
])
1225 listadd1(templist
,Long(rm
.args
[2]))
1226 listadd1(templist
,templist
+12)
1227 rc
:=18 -> Invalid argument to function
1228 IF t
:=findtag(rm
.args
[3])
1229 listadd1(templist
,t
.value
)
1230 IF t
:=findtag(rm
.args
[4])
1231 listadd1(templist
,t
.value
)
1232 ListAdd(templist
,[TAG_DONE
])
1233 rc
:=domethod(Long(rm
.args
[1]),templist
)
1234 result:=CreateArgstring(StringF(tempstr
,'\d',rc
),EstrLen(tempstr
))
1239 ELSEIF stricmp(funcname
,'addcondit')=0
1240 /* success
=bguiaddcondit(srcobj
,dstobj
,iftag
,ifval
,thtag
,thval
,eltag
,elval
)
1241 0 1 2 3 4 5 6 7 8 */
1242 -> This function connects two objects so srcobj will update dstobj depending
1243 -> on its ifattr
. This
is more
or less equivalent to doing this when srcobj
's
1245 -> IF bguiget(srcobj,iftag)=ifval THEN CALL bguiset(dstobj,thtag,thval),
1246 -> ELSE CALL bguiset(dstobj,eltag,elval)
1247 -> This happens even without bguiwinevent(). See also bguiaddmap().
1249 -> Integer tags only.
1251 -> Always test boolean tags for 0 and never for 1.
1254 -> Yes/No setting that makes a choice impossible:
1255 -> call bguiaddcondit(obj.check,obj.mx,GA_Selected,0,MX_EnableButton,0,
1256 -> ,MX_DisableButton,0)
1258 -> MX_DisableButton,n will never change MX_Active. You have to check separately
1259 -> if the selection is still possible.
1261 -> If you init the checkbox to on, the first MX button will not be enabled
1262 -> initially. If you init the checkbox to off and set it to on after this call,
1264 IF rm.action AND $F<>8
1265 rc:=17 -> Wrong number of arguments
1266 ELSEIF rm.args[1]=NIL OR (rm.args[2]=NIL) OR (rm.args[3]=NIL) OR (rm.args[4]=NIL)
1267 rc:=17 -> Wrong number of arguments
1268 ELSEIF rm.args[5]=NIL OR (rm.args[6]=NIL) OR (rm.args[7]=NIL) OR (rm.args[8]=NIL)
1269 rc:=17 -> Wrong number of arguments
1270 ELSEIF LengthArgstring(rm.args[1])<>4
1271 rc:=18 -> Invalid argument to function
1272 ELSEIF LengthArgstring(rm.args[2])<>4
1273 rc:=18 -> Invalid argument to function
1275 ListCopy(templist,[BASE_ADDCONDITIONAL])
1276 listadd1(templist,Long(rm.args[2]))
1277 rc:=18 -> Invalid argument to function
1278 IF t:=findtag(rm.args[3])
1279 listadd2(templist,t.value,Val(rm.args[4]))
1280 IF t:=findtag(rm.args[5])
1281 listadd2(templist,t.value,Val(rm.args[6]))
1282 IF t:=findtag(rm.args[7])
1283 listadd2(templist,t.value,Val(rm.args[8]))
1284 rc:=domethod(Long(rm.args[1]),templist)
1285 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
1291 ELSEIF stricmp(funcname,'listvgetentries
')=0
1292 /* count=bguilistvgetentries(listvobj,stemname,[type])
1295 -> 'S
' selected only
1296 IF (n:=rm.action AND $F)<2 OR (rm.args[1]=NIL) OR (rm.args[2]=NIL)
1297 rc:=17 -> Wrong number of arguments
1298 ELSEIF LengthArgstring(rm.args[1])<>4
1299 rc:=18 -> Invalid argument to function
1302 obj:=Long(rm.args[1])
1305 IF rm.args[3] AND (n>=3)
1306 IF (c:=Char(rm.args[3]))="S" OR (c="s") THEN flags:=LVGEF_SELECTED
1309 ListCopy(templist,[LVM_FIRSTENTRY,NIL])
1310 listadd1(templist,flags)
1311 i:=domethod(obj,templist)
1312 templist[]:=LVM_NEXTENTRY
1314 StringF(tempstr,'\s
.\d
',q,n)
1317 EXIT setRexxVar(rm,tempstr,i,StrLen(i))
1321 i:=domethod(obj,templist)
1324 StringF(temp2str,'\s
.COUNT
',q)
1326 IF setRexxVar(rm,temp2str,StringF(tempstr,'\d
',n),EstrLen(tempstr))
1330 result:=CreateArgstring(tempstr,EstrLen(tempstr))
1334 ELSEIF stricmp(funcname,'listvaddentry
')=0
1335 /* success=bguilistvaddentry(listvobj,[refwin],entry,[where],[flags])
1340 -> number add before entry n
1343 -> '+' make visible by scrolling list if necessary
1344 -> '-' do not make visible
1345 -> 'S
' or 'M
' makes visible automatically unless disabled with '-'
1346 IF (n:=rm.action AND $F)<3 OR (rm.args[1]=NIL) OR (rm.args[3]=NIL)
1347 rc:=17 -> Wrong number of arguments
1348 ELSEIF LengthArgstring(rm.args[1])<>4
1349 rc:=18 -> Invalid argument to function
1354 IF LengthArgstring(rm.args[2])=4
1355 GetAttr(WINDOW_Window,Long(rm.args[2]),{wnd})
1358 ListCopy(templist,[LVM_ADDSINGLE,NIL])
1359 listadd1(templist,rm.args[3])
1360 ListAdd(templist,[LVAP_TAIL])
1361 IF n>=4 AND rm.args[4]
1362 IF (c:=Char(rm.args[4]))>="0" AND (c<="9") OR (c="%") OR (c="$")
1363 ListCopy(templist,[LVM_INSERTSINGLE,NIL])
1364 listadd1(templist,Val(rm.args[4]))
1365 listadd1(templist,rm.args[3])
1367 ListCopy(templist,[LVM_ADDSINGLE,NIL])
1368 listadd1(templist,rm.args[3])
1370 ListAdd(templist,[LVAP_HEAD])
1371 ELSEIF c="S" OR (c="s")
1372 ListAdd(templist,[LVAP_SORTED])
1374 ListAdd(templist,[LVAP_TAIL])
1379 IF n>=5 AND rm.args[5]
1380 IF (c:=Char(rm.args[5]))="s" OR (c="S")
1381 flags:=flags OR LVASF_SELECT
1382 ELSEIF c="m" OR (c="M")
1383 flags:=flags OR LVASF_MULTISELECT
1385 IF strchr(rm.args[5],"+")
1386 flags:=flags OR LVASF_MAKEVISIBLE
1387 ELSEIF strchr(rm.args[5],"-")
1388 flags:=flags OR LVASF_NOT_VISIBLE
1391 listadd1(templist,flags)
1392 rc:=domethod(Long(rm.args[1]),templist)
1393 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
1396 ListCopy(templist,[LVM_REFRESH,NIL])
1397 BgUI_DoGadgetMethodA(Long(rm.args[1]),wnd,NIL,templist)
1400 ELSEIF stricmp(funcname,'listvcommand
')=0
1401 /* rc=bguilistvcommand(listvobj,[refwin],command)
1403 -> command 'clear
' delete all entries
1404 -> 'refresh
' refresh listview and scroller
1406 -> 'redraw
' redraw all entries only
1407 -> 'remselected
' also selects new entry
1408 IF (n:=rm.action AND $F)<>3 OR (rm.args[1]=NIL) OR (rm.args[3]=NIL)
1409 rc:=17 -> Wrong number of arguments
1410 ELSEIF LengthArgstring(rm.args[1])<>4
1411 rc:=18 -> Invalid argument to function
1416 IF LengthArgstring(rm.args[2])=4
1417 GetAttr(WINDOW_Window,Long(rm.args[2]),{wnd})
1421 IF stricmp(c,'clear
')=0
1423 ELSEIF stricmp(c,'refresh
')=0
1425 ELSEIF stricmp(c,'sort
')=0
1427 ELSEIF stricmp(c,'redraw
')=0
1429 ELSEIF stricmp(c,'remselected
')=0
1432 rc:=33 -> Invalid keyword
1436 listadd2(templist,i,NIL)
1437 rc:=BgUI_DoGadgetMethodA(Long(rm.args[1]),wnd,NIL,templist)
1438 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
1442 ELSEIF stricmp(funcname,'listvreplacesel
')=0
1443 /* success=bguilistvreplacesel(listvobj,[refwin],new)
1445 -> Use this function to replace the first selected entry of a listview by another.
1446 -> If no entry is selected, a new one is added and selected.
1447 IF (n:=rm.action AND $F)<>3 OR (rm.args[1]=NIL) OR (rm.args[3]=NIL)
1448 rc:=17 -> Wrong number of arguments
1449 ELSEIF LengthArgstring(rm.args[1])<>4
1450 rc:=18 -> Invalid argument to function
1455 IF LengthArgstring(rm.args[2])=4
1456 GetAttr(WINDOW_Window,Long(rm.args[2]),{wnd})
1459 obj:=Long(rm.args[1])
1460 IF i:=domethod(obj,[LVM_FIRSTENTRY,NIL,LVGEF_SELECTED])
1461 ListCopy(templist,[LVM_REPLACE,NIL])
1462 listadd1(templist,i)
1463 listadd1(templist,rm.args[3])
1464 rc:=BgUI_DoGadgetMethodA(obj,wnd,NIL,templist)
1465 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
1468 ListCopy(templist,[LVM_ADDSINGLE,NIL])
1469 listadd1(templist,rm.args[3])
1470 ListAdd(templist,[LVAP_TAIL,LVASF_SELECT])
1471 rc:=domethod(obj,templist)
1472 result:=CreateArgstring(StringF(tempstr,'\d
',rc),EstrLen(tempstr))
1475 ListCopy(templist,[LVM_REFRESH,NIL])
1476 BgUI_DoGadgetMethodA(Long(rm.args[1]),wnd,NIL,templist)
1480 ELSEIF stricmp(funcname,'wintabcycleorder
')=0
1481 /* success=bguiwintabcycleorder(winobj,objects)
1483 -> RexxBGUI can only check the validity of the objects array to a limited
1484 -> extent: if a multiple of four spaces is intermixed wrong object pointers
1485 -> are used and a crash can be expected if tab is pressed in the first gadget.
1486 IF rm.action AND $F<>2
1487 rc:=17 -> Wrong number of arguments
1488 ELSEIF rm.args[1]=NIL
1489 rc:=17 -> Wrong number of arguments
1490 ELSEIF LengthArgstring(rm.args[1])<>4
1491 rc:=18 -> Invalid argument to function
1492 ELSEIF LengthArgstring(rm.args[2]) AND 3
1493 rc:=18 -> Invalid argument to function
1495 ListCopy(templist,[WM_TABCYCLE_ORDER])
1497 n:=LengthArgstring(plong)/4
1499 SetGadgetAttrsA(plong[q],NIL,NIL,[GA_TABCYCLE,TRUE,TAG_DONE])
1500 listadd1(templist,plong[q])
1502 ListAdd(templist,[NIL])
1503 obj:=Long(rm.args[1])
1504 rc:=domethod(obj,templist)
1505 StringF(tempstr,'\d
',rc)
1506 result:=CreateArgstring(tempstr,EstrLen(tempstr))
1509 ELSEIF stricmp(funcname,'image
')=0
1510 /* image=bguiimage(left,top,width,height,depth,data,planepick,planeonoff)
1511 0 1 2 3 4 5 6 7 8 */
1512 -> Creates an Image structure and returns the pointer. Use this for the idata
1513 -> parameter of bguiibutton() if itype='M
'.
1515 -> Create these function calls with the MakeImage program.
1516 rc,result:=createimage(rm)
1517 ELSEIF stricmp(funcname,'menu
')=0
1518 /* nm=bguimenu(type,[label],[commkey],[flags],[mutualexclude],[id])
1520 -> Creates a NewMenu structure. Concatenate some of these and pass the result
1521 -> to bguiwindow(). If IDs (bguiwinevent()) are to be shared between gadgets
1522 -> and menuitems, create the gadgets first. Do not give a checkbox and a
1523 -> CHECKIT|TOGGLE item the same ID as it will be impossible to distinguish
1526 -> type '1' menu title
1529 -> Omitting label gives a separator bar (automatically disabled).
1530 -> commkey: RAmiga-... shortcut
1532 -> 'CHECKIT
' can be checked (not unchecked)
1533 -> 'CHECKED
' has checkmark
1534 -> 'TOGGLE
' specify CHECKIT too
1535 -> mutualexclude: selecting this CHECKIT item deselects these items
1536 -> (bit #x means item #x)
1537 -> id: may be either a number or a name of a variable
1538 -> number: selecting the item generates this ID
1539 -> variable: generate a new ID and store it in the variable
1540 -> Therefore you can write bguimenu(...,id.quit) and it will
1541 -> automatically share its ID with a gadget's
, if it
is present
.
1544 -> menu
=bguimenu(1,'Project')||
,
1545 -> bguimenu(2,'About...','?',,,id
.about
)||
,
1547 -> bguimenu(2,'Quit','Q',,,id
.quit
)||
,
1548 -> bguimenu(1,'Testing')||
,
1549 -> bguimenu(2,'Have your cake',,'CHECKIT CHECKED','10'b
,id
.hyc
)||
,
1550 -> bguimenu(2,'Eat it too',,'CHECKIT','01'b
,id
.eit
)||
,
1551 -> bguimenu(2,'On or off???',,'CHECKIT TOGGLE',,id
.ooo
)||
,
1553 -> bguimenu(2,'Subitems')||
,
1554 -> bguimenu(3,'Subitem #1','1',,,id
.sub1
)||
,
1555 -> bguimenu(3,'Subitem #2','2',,,id
.sub2
)||
,
1556 -> bguimenu(3,'Subitem #3','3','DISABLED',,id
.sub3
)
1557 IF (n
:=rm
.action
AND $F
)>6 OR (n
<1)
1558 rc
:=17 -> Wrong number of arguments
1559 ELSEIF rm
.args
[1]=NIL
1560 rc
:=17 -> Wrong number of arguments
1562 rc
,result:=makenm(rm
,tempstr
)
1564 ELSEIF stricmp(funcname
,'windisablemenu')=0
1565 /* success
=bguiwindisablemenu(winobj
,id
,state
)
1567 IF rm
.action
AND $F
<>3
1568 rc
:=17 -> Wrong number of arguments
1569 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
) OR (rm
.args
[3]=NIL
)
1570 rc
:=17 -> Wrong number of arguments
1571 ELSEIF LengthArgstring(rm
.args
[1])<>4
1572 rc
:=18 -> Invalid argument to function
1574 ListCopy(templist
,[WM_DISABLEMENU
])
1575 listadd2(templist
,Val(rm
.args
[2]),Val(rm
.args
[3]))
1576 rc
:=domethod(Long(rm
.args
[1]),templist
)
1577 result:=CreateArgstring(StringF(tempstr
,'\d',rc
),EstrLen(tempstr
))
1580 ELSEIF stricmp(funcname
,'wincheckitem')=0
1581 /* success
=bguiwincheckitem(winobj
,id
,state
)
1583 IF rm
.action
AND $F
<>3
1584 rc
:=17 -> Wrong number of arguments
1585 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
) OR (rm
.args
[3]=NIL
)
1586 rc
:=17 -> Wrong number of arguments
1587 ELSEIF LengthArgstring(rm
.args
[1])<>4
1588 rc
:=18 -> Invalid argument to function
1590 ListCopy(templist
,[WM_CHECKITEM
])
1591 listadd2(templist
,Val(rm
.args
[2]),Val(rm
.args
[3]))
1592 rc
:=domethod(Long(rm
.args
[1]),templist
)
1593 result:=CreateArgstring(StringF(tempstr
,'\d',rc
),EstrLen(tempstr
))
1596 ELSEIF stricmp(funcname
,'winmenudisabled')=0
1597 /* rc
=bguiwinmenudisabled(winobj
,id
)
1601 -> -1 unknown menu
/no menus at
all attached to window
1602 IF rm
.action
AND $F
<>2
1603 rc
:=17 -> Wrong number of arguments
1604 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
)
1605 rc
:=17 -> Wrong number of arguments
1606 ELSEIF LengthArgstring(rm
.args
[1])<>4
1607 rc
:=18 -> Invalid argument to function
1609 ListCopy(templist
,[WM_MENUDISABLED
])
1610 listadd1(templist
,Val(rm
.args
[2]))
1611 rc
:=domethod(Long(rm
.args
[1]),templist
)
1612 result:=CreateArgstring(StringF(tempstr
,'\d',rc
),EstrLen(tempstr
))
1615 ELSEIF stricmp(funcname
,'winitemchecked')=0
1616 /* rc
=bguiwinitemchecked(winobj
,id
)
1620 -> -1 unknown menu
/no menus at
all attached to window
1621 IF rm
.action
AND $F
<>2
1622 rc
:=17 -> Wrong number of arguments
1623 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
)
1624 rc
:=17 -> Wrong number of arguments
1625 ELSEIF LengthArgstring(rm
.args
[1])<>4
1626 rc
:=18 -> Invalid argument to function
1628 ListCopy(templist
,[WM_ITEMCHECKED
])
1629 listadd1(templist
,Val(rm
.args
[2]))
1630 rc
:=domethod(Long(rm
.args
[1]),templist
)
1631 result:=CreateArgstring(StringF(tempstr
,'\d',rc
),EstrLen(tempstr
))
1634 ELSEIF stricmp(funcname
,'activategadget')=0
1635 /* success
=bguiactivategadget(gadget
,refwin
)
1637 -> This call may fail
, although that
's usually not a severe problem...
1638 -> RexxBGUI can only check the validity of the objects to a limited extent.
1639 IF rm.action AND $F<>2
1640 rc:=17 -> Wrong number of arguments
1641 ELSEIF rm.args[1]=NIL OR (rm.args[2]=NIL)
1642 rc:=17 -> Wrong number of arguments
1643 ELSEIF LengthArgstring(rm.args[1])<>4
1644 rc:=18 -> Invalid argument to function
1645 ELSEIF LengthArgstring(rm.args[2])<>4
1646 rc:=18 -> Invalid argument to function
1648 GetAttr(WINDOW_Window,Long(rm.args[2]),{wnd})
1649 rc:=ActivateGadget(Long(rm.args[1]),wnd,NIL)
1650 StringF(tempstr,'\d
',rc)
1651 result:=CreateArgstring(tempstr,EstrLen(tempstr))
1654 ELSEIF stricmp(funcname,'close
')=0
1657 -> This MUST be called before exiting the script.
1658 freetasknode(rm,tasknode)
1660 result:=CreateArgstring('1',STRLEN)
1661 ELSEIF stricmp(funcname,'readentries
')=0
1662 /* success=bguireadentries(filename,stemname)
1664 -> When using READLN(), EOF cannot be distinguished from an empty line.
1665 -> Therefore this function is present. It reads lines from a file to a stem
1666 -> in a format suitable for the listview gadget.
1667 IF (n:=rm.action AND $F)<>2 OR (rm.args[1]=NIL) OR (rm.args[2]=NIL)
1668 rc:=17 -> Wrong number of arguments
1671 IF obj:=Open(rm.args[1],OLDFILE)
1674 WHILE Fgets(obj,tempstr,StrMax(tempstr))
1675 IF i:=strchr(tempstr,"\n") THEN i[]:=0
1676 StringF(temp2str,'\s
.\d
',q,n)
1679 EXIT setRexxVar(rm,temp2str,tempstr,StrLen(tempstr))
1685 StringF(temp2str,'\s
.COUNT
',q)
1688 IF setRexxVar(rm,temp2str,StringF(tempstr,'\d
',n),EstrLen(tempstr))
1689 result:=CreateArgstring('0',1)
1691 result:=CreateArgstring('1',1)
1695 result:=CreateArgstring('0',1)
1699 result:=CreateArgstring('0',1)
1702 ELSEIF stricmp(funcname,'list
')=0
1703 /* stemname=bguilist(stemname,entry0,[entry1],...)
1705 -> This function allows you to place small lists (<=14 entries) for listviews
1706 -> directly in the gadget creation function, a bit like in E [e0,e1,...].
1707 -> It sets stemname.COUNT and stemname.x (0<=x<stemname.COUNT)
1711 -> bguilistview('switcher
',,bguilist('pnames
','Single
-Select
','Multi
-Select
'))||,
1713 -> drop pnames. /* not really necessary */
1714 IF (n:=rm.action AND $F)<2 OR (rm.args[1]=NIL) OR (rm.args[2]=NIL)
1715 rc:=17 -> Wrong number of arguments
1720 StringF(tempstr,'\s
.\d
',rm.args[1],i)
1722 rc:=setRexxVar(rm,tempstr,rm.args[i+2],LengthArgstring(rm.args[i+2]))
1726 StringF(tempstr,'\s
.COUNT
',rm.args[1])
1728 rc:=setRexxVar(rm,tempstr,StringF(temp2str,'\d
',n-1),EstrLen(temp2str))
1729 IF rc=0 THEN result:=CreateArgstring(rm.args[1],LengthArgstring(rm.args[1]))
1732 ELSEIF stricmp(funcname,'listvcontrol
')=0
1733 /* x=bguilistvcontrol([listvobj],[winobj],[arrows_id],[enter_id])
1735 -> This function will cause the arrow keys up and down to control the the
1736 -> listview. They do only in the window specified. You can receive events for
1737 -> the arrow keys and for return and enter keys. You can specify either a number
1738 -> or a variable name which will receive a newly generated ID.
1739 -> Leaving out all arguments turns off this feature. If an argument is left out,
1740 -> (but there are arguments at all), that setting is not changed.
1741 -> Never ever set winobj if listvobj is invalid.
1742 -> Initially, winobj is zero and the other values are undefined.
1743 rc,result:=setlistvcontrol(rm,tempstr)
1744 ELSEIF stricmp(funcname,'filereq
')=0
1745 /* path=bguifilereq([path],[title],[winobj],[flags],[patvar])
1747 -> Subsequent calls will remember the path, the pattern and the requester's
1748 -> position
and size
, but
not the title
, the window object pointer
and the flags
.
1749 -> winobj
: window object pointer
. The requester will open on the same screen
and
1750 -> the window will be locked
like bguiwinbusy().
1751 -> flags
'DOSAVEMODE'
1752 -> 'DOPATTERNS' pattern gadget
; a pattern may be used without it
1756 -> patvar
: name of a variable that contains the pattern
. When the requester
is
1757 -> closed
, the possibly changed pattern
is stored in it
. If the variable does
not
1758 -> exist
, the argument
is used literally
as a pattern
, but the changed pattern
is
1759 -> not stored in any variable
.
1760 -> If the requester was cancelled
, the function returns the empty
string, else it
1761 -> returns the
path (the drawer
and file concatenated with a slash in between
if
1763 rc
,result:=dofrq(rm
,templist
,tempstr
)
1764 ELSEIF stricmp(funcname
,'error')=0
1765 /* x
=bguierror(code
)
1767 -> This function causes an ARexx error
, e
.g
. bguierror(12) causes
"Error return
1769 IF rm
.action
AND $F
<>1
1770 rc
:=17 -> Wrong number of arguments
1774 ELSEIF stricmp(funcname
,'rexxversion')=0
1775 /* result=bguirexxversion([version
],[revision
])
1777 -> Syntax #
1: available
=bguirexxversion(version
,[revision
])
1778 -> Syntax #
2: version
=bguirexxversion() /* could return
'3.0' */
1779 IF rm
.action
AND $F
>2
1780 rc
:=17 -> Wrong number of arguments
1783 IF n
>=1 AND rm
.args
[1] THEN i
:=Val(rm
.args
[1])
1784 IF n
>=2 AND rm
.args
[2] THEN q
:=Val(rm
.args
[2])
1785 rc
,result:=checkversion(rexxbguibase
,i
,q
,tempstr
)
1787 ELSEIF stricmp(funcname
,'version')=0
1788 /* result=bguiversion([version
],[revision
])
1790 -> Syntax #
1: available
=bguiversion(version
,[revision
])
1791 -> Syntax #
2: version
=bguiversion() /* could return
'41.8' */
1792 IF rm
.action
AND $F
>2
1793 rc
:=17 -> Wrong number of arguments
1796 IF n
>=1 AND rm
.args
[1] THEN i
:=Val(rm
.args
[1])
1797 IF n
>=2 AND rm
.args
[2] THEN q
:=Val(rm
.args
[2])
1798 rc
,result:=checkversion(bguibase
,i
,q
,tempstr
)
1802 IF rc
=-1 THEN rc
:=12
1806 PROC
checkversion(lib
:PTR TO lib
,ver
,rev
,tempstr
/* scratch
*/)
1808 IF ver
<lib
.version
OR (ver
=lib
.version
AND (rev
<=lib
.revision
))
1809 RETURN
0,CreateArgstring('1',1)
1811 RETURN
0,CreateArgstring('0',1)
1814 StringF(tempstr
,'\d.\d',lib
.version
,lib
.revision
)
1815 RETURN
0,CreateArgstring(tempstr
,EstrLen(tempstr
))
1819 PROC
setlistvcontrol(rm
:PTR TO rexxmsg
,tempstr
:PTR TO CHAR
/* scratch
*/)
1820 DEF n
,s
,h
:PTR TO idcmphook
,i
,r
1821 h
:=tasknode
.idcmphook
1822 IF (n
:=rm
.action
AND $F
)>4 THEN RETURN
17 -> Wrong number of arguments
1823 IF n
=0 THEN h
.window_object
:=NIL
1824 IF n
>=1 AND (s
:=rm
.args
[1])
1825 IF LengthArgstring(s
)=4
1829 IF n
>=2 AND (s
:=rm
.args
[2])
1830 IF LengthArgstring(s
)=4
1831 h
.window_object
:=Long(s
)
1834 IF n
>=3 AND (s
:=rm
.args
[3])
1837 tasknode
.lastid
:=tasknode
.lastid
+1
1839 IF setRexxVar(rm
,s
,StringF(tempstr
,'\d',i
),EstrLen(tempstr
)) THEN RETURN
12
1841 h
.doarrowmessages
:=i
1843 IF n
>=4 AND (s
:=rm
.args
[4])
1846 tasknode
.lastid
:=tasknode
.lastid
+1
1848 IF setRexxVar(rm
,s
,StringF(tempstr
,'\d',i
),EstrLen(tempstr
)) THEN RETURN
12
1852 ENDPROC
0,CreateArgstring('1',1)
1854 PROC
dofrq(rm
:PTR TO rexxmsg
,templist
:PTR TO LONG
/* scratch
*/,
1855 tempstr
:PTR TO CHAR
/* scratch
*/)
1856 DEF rc
,result,n
,frq
,obj
,s
,flags1
,flags2
,i
,varexisted
=FALSE,lockedwinobj
=NIL
1857 IF tasknode
.filereq
=NIL
1858 tasknode
.filereq
:=BgUI_NewObjectA(BGUI_FILEREQ_OBJECT
,NIL
)
1859 IF tasknode
.filereq
=NIL
THEN RETURN
12
1861 frq
:=tasknode
.filereq
1863 IF n
>=2 AND rm
.args
[2]
1864 setattr(frq
,ASLFR_TITLETEXT
,rm
.args
[2])
1866 setattr(frq
,ASLFR_TITLETEXT
,NIL
)
1868 SetAttrsA(frq
,[ASLFR_WINDOW
,NIL
,TAG_DONE
])
1869 IF n
>=3 AND rm
.args
[3]
1870 IF LengthArgstring(rm
.args
[3])=4
1871 IF lockedwinobj
:=Long(rm
.args
[3])
1872 domethod(lockedwinobj
,[WM_SLEEP
])
1873 GetAttr(WINDOW_Window
,lockedwinobj
,{obj
})
1874 setattr(frq
,ASLFR_WINDOW
,obj
)
1878 flags1
:=0; flags2
:=0
1879 IF s
:=rm
.args
[4] AND (n
>=4)
1882 WHILE s
[]>="A" AND (s
[]<="z") DO StrAdd(tempstr
,s
,1) BUT s
++
1883 IF stricmp(tempstr
,'dosavemode')=0
1884 flags1
:=flags1
OR FRF_DOSAVEMODE
1885 ELSEIF stricmp(tempstr
,'dopatterns')=0
1886 flags1
:=flags1
OR FRF_DOPATTERNS
1887 ELSEIF stricmp(tempstr
,'drawersonly')=0
1888 flags2
:=flags2
OR FRF_DRAWERSONLY
1889 ELSEIF stricmp(tempstr
,'filterdrawers')=0
1890 flags2
:=flags2
OR FRF_FILTERDRAWERS
1891 ELSEIF stricmp(tempstr
,'rejecticons')=0
1892 flags2
:=flags2
OR FRF_REJECTICONS
1894 WHILE s
[]<"A" OR (s
[]>"z") AND s
[] DO s
++
1897 setattr(frq
,ASLFR_FLAGS1
,flags1
)
1898 setattr(frq
,ASLFR_FLAGS2
,flags2
)
1899 IF n
>=5 AND (s
:=rm
.args
[5])
1900 StrCopy(tempstr
,s
); UpperStr(tempstr
); i
:=NIL
1901 IF getRexxVar(rm
,tempstr
,{i
})=0 AND i
1902 setattr(frq
,ASLFR_INITIALPATTERN
,i
)
1905 setattr(frq
,ASLFR_INITIALPATTERN
,s
)
1908 IF n
>=1 AND (s
:=rm
.args
[1])
1909 IF flags2
AND FRF_DRAWERSONLY
1910 setattr(frq
,FILEREQ_Drawer
,s
)
1912 setattr(frq
,FILEREQ_File
,FilePart(s
))
1914 PutChar(PathPart(tempstr
),0)
1915 setattr(frq
,FILEREQ_Drawer
,tempstr
)
1919 IF domethod(frq
,[ASLM_DOREQUEST
])=ASLREQ_OK
1920 GetAttr(IF flags2
AND FRF_DRAWERSONLY
THEN FILEREQ_Drawer
ELSE FILEREQ_Path
,frq
,{s
})
1921 result:=CreateArgstring(s
,StrLen(s
))
1923 result:=CreateArgstring('',0)
1926 StrCopy(tempstr
,rm
.args
[5]); UpperStr(tempstr
)
1927 GetAttr(FILEREQ_Pattern
,frq
,{i
})
1928 setRexxVar(rm
,tempstr
,i
,StrLen(i
))
1930 IF lockedwinobj
THEN domethod(lockedwinobj
,[WM_WAKEUP
])
1933 PROC
setattr(obj
,attr
,val
)
1934 DEF t
[3]:ARRAY OF LONG
1941 PROC
createibutton(rm
:PTR TO rexxmsg
,tempstr
/* stratch
*/,
1942 templist
:PTR TO LONG
/* scratch
*/)
1943 DEF rc
,result,n
,obj
,c
,i
,temp2str
[80]:STRING,im
:PTR TO imagenode
1944 IF (n
:=rm
.action
AND $F
)<3 OR (n
>5)
1945 RETURN
17 -> Wrong number of arguments
1946 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[2]=NIL
) OR (rm
.args
[3]=NIL
)
1947 RETURN
17 -> Wrong number of arguments
1950 IF (c
:=Char(rm
.args
[2]))="B" OR (c
="b")
1956 ELSEIF c
="p" OR (c
="P")
1958 ELSEIF c
="d" OR (c
="D")
1962 listadd2(templist
,VIT_BuiltIn
,i
)
1963 ELSEIF c
="I" OR (c
="i")
1964 IF (im
:=addicon(rm
.args
[3]))=NIL
THEN RETURN
12
1965 listadd2(templist
,BUTTON_Image
,im
.dobj
.gadget
.gadgetrender
)
1966 IF i
:=im
.dobj
.gadget
.selectrender
1967 listadd2(templist
,BUTTON_SelectedImage
,i
)
1969 ELSEIF c
="M" OR (c
="m")
1970 IF (i
:=LengthArgstring(rm
.args
[3]))=4
1971 listadd2(templist
,BUTTON_Image
,Long(rm
.args
[3]))
1973 listadd2(templist
,BUTTON_Image
,Long(rm
.args
[3]))
1974 listadd2(templist
,BUTTON_SelectedImage
,Long(rm
.args
[3]+4))
1977 ELSEIF c
="V" OR (c
="v")
1982 IF strchr(rm
.args
[2],"-")
1983 ListAdd(templist
,[FRM_Type
,FRTYPE_NONE
,BUTTON_EncloseImage
,TRUE,FRM_EdgesOnly
,TRUE])
1985 IF strchr(rm
.args
[2],"*")
1986 ListAdd(templist
,[BUTTON_EncloseImage
,TRUE])
1988 IF n
>=4 AND rm
.args
[4]
1989 listadd2(templist
,LAB_Label
,addstring(rm
.args
[4]))
1991 IF n
>=5 AND rm
.args
[5]
1992 IF (c
:=Char(rm
.args
[5]))="l" OR (c
="L")
1994 ELSEIF c
="r" OR (c
="R")
1996 ELSEIF c
="a" OR (c
="A")
1998 ELSEIF c
="b" OR (c
="B")
2002 listadd2(templist
,LAB_Place
,i
)
2004 StringF(tempstr
,'ID.\s',rm
.args
[1])
2006 tasknode
.lastid
:=tasknode
.lastid
+1
2008 setRexxVar(rm
,tempstr
,StringF(temp2str
,'\d',i
),EstrLen(temp2str
))
2009 listadd2(templist
,GA_ID
,i
)
2010 ListAdd(templist
,[TAG_DONE
])
2011 IF obj
:=BgUI_NewObjectA(BGUI_BUTTON_GADGET
,templist
)
2013 StringF(tempstr
,'OBJ.\s',rm
.args
[1])
2015 rc
:=setRexxVar(rm
,tempstr
,{obj
},4)
2016 result:=CreateArgstring({obj
},4)
2022 PROC
createindicator(rm
:PTR TO rexxmsg
,templist
:PTR TO LONG
/* scratch
*/)
2023 DEF n
,c
,q
,obj
,rc
=1,result
2024 IF (n
:=rm
.action
AND $F
)<4 OR (n
>7)
2025 rc
:=17 -> Wrong number of arguments
2026 ELSEIF rm
.args
[1]=NIL
OR (rm
.args
[3]=NIL
) OR (rm
.args
[4]=NIL
)
2027 rc
:=17 -> Wrong number of arguments
2029 ListCopy(templist
,[FRM_Type
,FRTYPE_NONE
])
2030 IF rm
.args
[2] THEN listadd2(templist
,LAB_Label
,addstring(rm
.args
[2]))
2031 listadd2(templist
,INDIC_Min
,Val(rm
.args
[3]))
2032 listadd2(templist
,INDIC_Max
,Val(rm
.args
[4]))
2033 IF n
>=5 AND rm
.args
[5]
2034 listadd2(templist
,INDIC_Level
,Val(rm
.args
[5]))
2037 IF n
>=6 AND rm
.args
[6]
2038 IF (c
:=Char(rm
.args
[6]))="l" OR (c
="L")
2039 ListAdd(templist
,[INDIC_Justification
,IDJ_LEFT
])
2040 ELSEIF c
="c" OR (c
="C")
2041 ListAdd(templist
,[INDIC_Justification
,IDJ_CENTER
])
2042 ELSEIF c
="r" OR (c
="R")
2043 ListAdd(templist
,[INDIC_Justification
,IDJ_RIGHT
])
2047 IF n
>=7 AND rm
.args
[7]
2048 listadd2(templist
,INDIC_FormatString
,q
:=addstring(rm
.args
[7]))
2050 ListAdd(templist
,[TAG_DONE
])
2051 IF obj
:=BgUI_NewObjectA(BGUI_INDICATOR_GADGET
,templist
)
2053 /* 41.10: INDIC_FormatString
-S
--U */
2054 ListCopy(templist
,[INDIC_FormatString
])
2055 listadd1(templist
,q
)
2056 /* OM_SET INDIC_FormatString loses INDIC_Justification
*/
2058 ListAdd(templist
,[INDIC_Justification
,IDJ_LEFT
])
2059 ELSEIF c
="c" OR (c
="C")
2060 ListAdd(templist
,[INDIC_Justification
,IDJ_CENTER
])
2061 ELSEIF c
="r" OR (c
="R")
2062 ListAdd(templist
,[INDIC_Justification
,IDJ_RIGHT
])
2064 ListAdd(templist
,[TAG_DONE
])
2065 SetGadgetAttrsA(obj
,NIL
,NIL
,templist
)
2068 StringF(tempstr
,'OBJ.\s',rm
.args
[1])
2070 rc
:=setRexxVar(rm
,tempstr
,{obj
},4)
2071 result:=CreateArgstring({obj
},4)
2080 templist
:PTR TO LONG
/* scratch
*/,
2081 tempstr
:PTR TO LONG
/* scratch
*/
2083 DEF rc
=1,result,lock
,obj
,n
,q
,c
,i
,plong
:PTR TO LONG
,pint
:PTR TO INT
,
2085 IF (n
:=rm
.action
AND $F
)<2
2086 rc
:=17 -> Wrong number of arguments
2089 obj
:=Long(rm
.args
[2])
2090 IF removeobjnode(obj
)=0 THEN RETURN
12
2091 listadd2(templist
,WINDOW_MasterGroup
,obj
)
2092 listadd2(templist
,WINDOW_Title
,addstring(rm
.args
[1]))
2093 listadd2(templist
,WINDOW_AutoAspect
,TRUE)
2094 listadd2(templist
,WINDOW_CloseOnEsc
,TRUE)
2095 listadd2(templist
,WINDOW_AutoKeyLabel
,TRUE)
2096 listadd2(templist
,WINDOW_IDCMPHookBits
,IDCMP_RAWKEY
)
2097 listadd2(templist
,WINDOW_IDCMPHook
,tasknode
.idcmphook
)
2099 IF n
>=3 AND (q
:=rm
.args
[3])
2102 IF rc
THEN listadd2(templist
,WINDOW_ScaleWidth
,rc
)
2104 IF rc
THEN listadd2(templist
,WINDOW_ScaleWidth
,rc
)
2105 listadd2(templist
,WINDOW_LockWidth
,TRUE)
2109 IF n
>=4 AND (q
:=rm
.args
[4])
2112 IF rc
THEN listadd2(templist
,WINDOW_ScaleHeight
,rc
)
2114 IF rc
THEN listadd2(templist
,WINDOW_ScaleHeight
,rc
)
2115 listadd2(templist
,WINDOW_LockHeight
,TRUE)
2119 IF lock
=3 THEN ListAdd(templist
,[WINDOW_SizeGadget
,FALSE,WINDOW_TitleZip
,TRUE])
2121 IF rm
.args
[5] AND (n
>=5)
2122 IF LengthArgstring(rm
.args
[5])=4
2123 obj
:=Long(rm
.args
[5])
2124 GetAttr(WINDOW_Window
,obj
,{wnd
})
2125 listadd2(templist
,WINDOW_Screen
,wnd
.wscreen
)
2127 ELSEIF rm
.args
[6] AND (n
>=6)
2128 listadd2(templist
,WINDOW_PubScreenName
,addstring(rm
.args
[6]))
2130 IF n
>=7 AND rm
.args
[7]
2133 ListAdd(templist
,[WINDOW_Position
,POS_CENTERSCREEN
])
2134 ELSEIF c
="m" OR (c
="M")
2135 ListAdd(templist
,[WINDOW_Position
,POS_CENTERMOUSE
])
2136 ELSEIF c
="t" OR (c
="T")
2137 ListAdd(templist
,[WINDOW_Position
,POS_TOPLEFT
])
2138 ELSEIF c
="w" OR (c
="W") AND wnd
2139 listadd2(templist
,WINDOW_PosRelBox
,wnd
+4)
2140 ELSEIF c
="b" OR (c
="B")
2142 WHILE q
[]>"9" OR (q
[]<"0") AND (q
[]) DO q
++
2144 PutLong(tempstr
,0); PutLong(tempstr
+4,0)
2149 IF q
[]>"9" OR (q
[]<"0") THEN q
++
2152 pint
:=alloceven(8); CopyMem(tempstr
,pint
,8)
2153 listadd2(templist
,WINDOW_Bounds
,pint
)
2154 ELSEIF c
="r" OR (c
="R")
2156 WHILE q
[]>"9" OR (q
[]<"0") AND (q
[]) DO q
++
2158 PutLong(tempstr
,0); PutLong(tempstr
+4,0)
2163 IF q
[]>"9" OR (q
[]<"0") THEN q
++
2166 pint
:=alloceven(8); CopyMem(tempstr
,pint
,8)
2167 listadd2(templist
,WINDOW_PosRelBox
,pint
)
2169 IF strchr(rm
.args
[7],"*")
2170 ListAdd(templist
,[WINDOW_Activate
,FALSE])
2173 IF rm
.action
AND $F
>=8 AND (q
:=rm
.args
[8])
2174 IF LengthArgstring(q
)>SIZEOF newmenu
AND Char(q
)=1 THEN listadd2(templist
,WINDOW_MenuStrip
,q
)
2176 listadd1(templist
,TAG_DONE
)
2178 IF obj
:=BgUI_NewObjectA(BGUI_WINDOW_OBJECT
,templist
)
2181 result:=CreateArgstring({obj
},4)
2188 PROC
createimage(rm
:PTR TO rexxmsg
)
2189 DEF n
,i
,w
,h
,d
,sz
,data
,im
:PTR TO image
2190 IF (n
:=rm
.action
AND $F
)<>8 THEN RETURN
17
2191 FOR i
:=1 TO
8 DO IF rm
.args
[i
]=NIL
THEN RETURN
17
2196 IF LengthArgstring(rm
.args
[6])<>sz
THEN RETURN
12
2198 IF data
=NIL
THEN RETURN
12
2199 CopyMem(rm
.args
[6],data
,sz
)
2200 IF (im
:=alloceven(SIZEOF image
))=NIL
THEN RETURN
12
2201 im
.leftedge
:=Val(rm
.args
[1])
2202 im
.topedge
:=Val(rm
.args
[2])
2207 im
.planepick
:=Val(rm
.args
[7])
2208 im
.planeonoff
:=Val(rm
.args
[8])
2210 ENDPROC
0,CreateArgstring({im
},SIZEOF LONG
)
2212 PROC
makenm(rm
:PTR TO rexxmsg
,tempstr
/* scratch
*/)
2213 DEF i
,s
,nm
:newmenu
,n
,len
2214 /* 1<=Nargs
<=6, rm
.args
[1]<>NIL
*/
2216 i
:=Val(rm
.args
[1]); IF i
<=0 OR (i
>3) THEN RETURN
18 -> Invalid argument to function
2220 IF s
:=rm
.args
[4] AND (n
>=4)
2223 WHILE s
[]>="A" AND (s
[]<="z") DO StrAdd(tempstr
,s
,1) BUT s
++
2224 IF stricmp(tempstr
,'disabled')=0
2225 nm
.flags
:=nm
.flags
OR (IF i
=1 THEN NM_MENUDISABLED
ELSE NM_ITEMDISABLED
)
2226 ELSEIF stricmp(tempstr
,'checkit')=0
2227 nm
.flags
:=nm
.flags
OR CHECKIT
2228 ELSEIF stricmp(tempstr
,'checked')=0
2229 nm
.flags
:=nm
.flags
OR CHECKED
2230 ELSEIF stricmp(tempstr
,'toggle')=0
2231 nm
.flags
:=nm
.flags
OR MENUTOGGLE
2233 WHILE s
[]<"A" OR (s
[]>"z") AND s
[] DO s
++
2237 IF s
:=rm
.args
[5] AND (n
>=5)
2238 IF (len
:=LengthArgstring(s
))<=4
2240 CopyMem(s
,{i
}+4-len
,len
)
2247 IF s
:=rm
.args
[6] AND (n
>=6)
2249 tasknode
.lastid
:=tasknode
.lastid
+1
2251 IF setRexxVar(rm
,s
,StringF(tempstr
,'\d',i
),EstrLen(tempstr
)) THEN RETURN
12
2256 IF rm
.args
[2] AND (n
>=2)
2257 nm
.label
:=addstring(rm
.args
[2])
2259 IF nm
.label
=NIL
THEN nm
.label
:=NM_BARLABEL
2260 IF rm
.args
[3] AND (n
>=3)
2261 nm
.commkey
:=addstring(rm
.args
[3])
2265 s
:=CreateArgstring(nm
,SIZEOF newmenu
)
2266 IF s
=NIL
THEN RETURN
12 ELSE RETURN
0,s
2269 PROC
bguireq(wnd
,title
,text
,gadgets
,args
=NIL
,screen
=NIL
)
2271 rq
.flags
:=BREQF_AUTO_ASPECT
OR
2272 (IF wnd
THEN BREQF_LOCKWINDOW
ELSE 0) OR
2273 (IF InStr(gadgets
,'*')<>-1 THEN BREQF_FAST_KEYS
ELSE 0) OR
2274 (IF gadgets
[0]="%" AND (gadgets[1]="[") THEN BREQF_XEN_BUTTONS ELSE 0) OR
2275 (IF gadgets[0]="%" AND (gadgets
[1]="]") THEN BREQF_FUZZ_BUTTONS
ELSE 0)
2277 rq
.gadgetFormat
:=IF gadgets
[0]<>"%" OR
2278 (gadgets[1]<>"[" AND (gadgets[1]<>"]")) THEN gadgets ELSE gadgets+2
2280 rq.reqPos:=POS_CENTERMOUSE
2286 ENDPROC BgUI_RequestA(wnd,rq,args)
2289 DEF first[10]:STRING,q,next,t=NIL:PTR TO taginfo
2290 StrCopy(first,name,q:=InStr(name,'_'))
2291 IF q<=1 THEN RETURN 0
2292 IF q>=10 THEN RETURN 0
2296 /* TAGS: General information
2299 -> INT=integer, may be boolean (0 means false, anything else means true)
2301 -> OBJECT=4-byte pointer
2303 -> Applicability: ISGNU
2304 -> I=Init (not applicable for RexxBGUI)
2305 -> S=Set (bguiset())
2306 -> G=Get (bguiget())
2307 -> N=Notify (bguiaddmap() sattr/bguiaddcondit() ifattr)
2308 -> U=Update (bguiaddmap() dattr/bguiaddcondit() thattr/elattr)
2310 -> ?=not known to me, try it
2311 ELSEIF stricmp(first,'WINDOW')=0
2313 -> 'Activate',$800F06F1,TAG_INT,
2314 -> 'AutoAspect',$800F0718,TAG_INT,
2315 -> 'AutoKeyLabel',$800F0725,TAG_INT,
2316 -> 'Backdrop',$800F06F6,TAG_INT,
2317 -> 'Borderless',$800F06F5,TAG_INT,
2318 -> 'CloseGadget',$800F06ED,TAG_INT,
2319 -> 'CloseOnEsc',$800F071A,TAG_INT,
2320 -> 'DepthGadget',$800F06EE,TAG_INT,
2321 -> 'DragBar',$800F06EB,TAG_INT,
2322 -> 'HelpFile',$800F070F,TAG_STRING,
2323 -> 'HelpLine',$800F0711,TAG_INT,
2324 -> 'HelpNode',$800F0710,TAG_STRING,
2325 -> 'HelpText',$800F0716,TAG_STRING,
2326 -> 'LockHeight',$800F06E5,TAG_INT,
2327 -> 'LockWidth',$800F06E4,TAG_INT,
2328 -> 'MenuStrip',$800F0703,TAG_MENU,
2329 -> 'NoBufferRP',$800F0717,TAG_INT,
2330 -> 'NoVerify',$800F071D,TAG_INT,
2331 -> 'Position',$800F06E1,TAG_INT,
2332 -> 'PreBufferRP',$800F072B,TAG_INT,
2333 -> 'PubScreenName',$800F0706,TAG_STRING,
2334 -> 'RMBTrap',$800F06F2,TAG_INT,
2335 -> 'ReportMouse',$800F06F4,TAG_INT,
2336 -> 'ScaleHeight',$800F06E3,TAG_INT,
2337 -> 'ScaleWidth',$800F06E2,TAG_INT,
2338 -> 'ScreenTitle',$800F0702,TAG_STRING,
2339 -> 'ShowTitle',$800F06F7,TAG_INT,
2340 -> 'SizeBottom',$800F06EF,TAG_INT,
2341 -> 'SizeGadget',$800F06EC,TAG_INT,
2342 -> 'SizeRight',$800F06F0,TAG_INT,
2343 -> 'SmartRefresh',$800F06F3,TAG_INT,
2344 -> 'Title',$800F0701,TAG_STRING,
2345 -> 'TitleZip',$800F0724,TAG_INT,
2346 -> 'ToolTicks',$800F071F,TAG_INT,
2347 -> 'UniqueID',$800F0714,TAG_INT,
2348 'Window',$800F0715,TAG_OBJECT, -> --G--
2351 ELSEIF stricmp(first,'INFO')=0
2353 'TextFormat',$800F0281,TAG_STRING, -> IS--U
2354 'MinLines',$800F0283,TAG_INT,
2355 'FixTextWidth',$800F0284,TAG_INT,
2358 ELSEIF stricmp(first,'STRINGA')=0
2360 'TextVal',STRINGA_TEXTVAL,TAG_STRING, -> ISGNU makes string gadget
2361 'LongVal',STRINGA_LONGVAL,TAG_INT, -> ISGNU makes integer gadget
2362 'MaxChars',STRINGA_MAXCHARS,TAG_INT, -> I-?--
2363 'BufferPos',STRINGA_BUFFERPOS,TAG_INT, -> IS??? cursor position
2364 'DispPos',STRINGA_DISPPOS,TAG_INT, -> IS??? first char visible
2367 ELSEIF stricmp(first,'LGO')=0
2369 'FixWidth',LGO_FixWidth,TAG_INT,
2370 'FixHeight',LGO_FixHeight,TAG_INT,
2371 'Weight',LGO_Weight,TAG_INT,
2372 'FixMinWidth',LGO_FixMinWidth,TAG_INT,
2373 'FixMinHeight',LGO_FixMinHeight,TAG_INT,
2374 'Align',LGO_Align,TAG_INT,
2375 'NoAlign',LGO_NoAlign,TAG_INT,
2376 'FixAspect',LGO_FixAspect,TAG_INT, -> 65536*x+y 41.8 only
2377 'Visible',LGO_Visible,TAG_INT,
2380 ELSEIF stricmp(first,'LISTV')=0
2382 'Top',LISTV_Top,TAG_INT, -> ISG-U
2383 'ReadOnly',LISTV_ReadOnly,TAG_INT, -> ISG?? S/U will not change frame
2384 'MultiSelect',LISTV_MultiSelect,TAG_INT, -> IS?-U
2385 'Select',LISTV_Select,TAG_INT, -> -S--U
2386 'MakeVisible',LISTV_MakeVisible,TAG_INT, -> -S--U
2387 'Entry',LISTV_Entry,TAG_STRING, -> ---N-
2388 'EntryNumber',LISTV_EntryNumber,TAG_INT, -> ---N-
2389 'LastClicked',LISTV_LastClicked,TAG_STRING, -> --G--
2390 'LastClickedNum',LISTV_LastClickedNum,TAG_INT, -> --G--
2391 'NewPosition',LISTV_NewPosition,TAG_INT, -> ---N-
2392 'NumEntries',LISTV_NumEntries,TAG_INT, -> --G--
2393 'MinEntriesShown',LISTV_MinEntriesShown,TAG_INT, -> ISG??
2394 'SelectMulti',LISTV_SelectMulti,TAG_INT, -> -S--U
2395 'SelectNotVisible',LISTV_SelectNotVisible,TAG_INT, -> -S--U
2396 'SelectMultiNotVisible',LISTV_SelectMultiNotVisible,TAG_INT, -> -S--U
2397 'MultiSelectNoShift',LISTV_MultiSelectNoShift,TAG_INT, -> IS--U
2398 'Deselect',LISTV_Deselect,TAG_INT, -> -S--U
2399 'DropSpot',LISTV_DropSpot,TAG_INT, -> --G--
2400 'ShowDropSpot',LISTV_ShowDropSpot,TAG_INT, -> IS---
2401 'Columns',LISTV_Columns,TAG_INT, -> I-G--
2402 'DragColumns',LISTV_DragColumns,TAG_INT, -> ISG-U
2403 'Titles',LISTV_Titles,TAG_STRING, -> I-G-U 41.8 Enforcer hits
2404 'Titles!',LISTV_Titles,TAG_OBJECT, -> ISG-U static string problem
2405 'PreClear',LISTV_PreClear,TAG_INT, -> ISG--
2406 'LastColumn',LISTV_LastColumn,TAG_INT, -> --G--
2409 ELSEIF stricmp(first,'GA')=0
2411 'Disabled',GA_DISABLED,TAG_INT, -> IS?-U
2412 'Selected',GA_SELECTED,TAG_INT, -> ISGNU toggles/checkboxes only
2415 ELSEIF stricmp(first,'BT')=0
2417 'LabelClick',BT_LabelClick,TAG_INT, -> IS---
2418 'DragObject',BT_DragObject,TAG_INT, -> ISG--
2419 'DropObject',BT_DropObject,TAG_INT, -> ISG--
2420 'Key',BT_Key,TAG_STRING, -> ISG-- set after creating window object only
2421 'RawKey',BT_RawKey,TAG_INT, -> ISG-- set after creating window object only
2422 'Qualifier',BT_Qualifier,TAG_INT, -> ISG-- set after creating window object only
2425 ELSEIF stricmp(first,'PAGE')=0
2427 'Active',PAGE_Active,TAG_INT, -> ISG?U
2430 ELSEIF stricmp(first,'MX')=0
2432 'Active',MX_Active,TAG_INT, -> ISGNU
2433 'DisableButton',MX_DisableButton,TAG_INT, -> IS--U
2434 'EnableButton',MX_EnableButton,TAG_INT, -> IS--U
2437 ELSEIF stricmp(first,'CYC')=0
2439 'Active',CYC_Active,TAG_INT, -> ISGNU
2442 ELSEIF stricmp(first,'PROGRESS')=0
2444 'Min',PROGRESS_Min,TAG_INT, -> IS---
2445 'Max',PROGRESS_Max,TAG_INT, -> IS---
2446 'Done',PROGRESS_Done,TAG_INT, -> ISGNU
2449 ELSEIF stricmp(first,'INDIC')=0
2451 'Level',INDIC_Level,TAG_INT, -> IS--U
2454 ELSEIF stricmp(first,'TAG')=0
2456 'IGNORE',1,TAG_INT, -> IS--U does nothing!
2460 IF t=NIL THEN RETURN NIL
2462 IF stricmp(t[].name,next)=0
2469 PROC listadd1(list,e)
2476 PROC listadd2(list,e1,e2)
2484 PROC addobjnode(obj)
2485 DEF on=NIL:PTR TO objnode
2486 on:=AllocVec(SIZEOF objnode,0)
2487 IF on=NIL THEN RETURN NIL
2489 AddTail(tasknode.objects,on)
2492 PROC removeobjnode(obj)
2493 DEF on:PTR TO objnode
2494 on:=tasknode.objects.head
2505 PROC findtasknode(rm:PTR TO rexxmsg)
2506 DEF p=NIL,tn:PTR TO tasknode
2507 IF getRexxVar(rm,'bguitasknode',{p}) THEN RETURN NIL
2508 IF p=NIL THEN RETURN NIL
2510 bguibase:=tn.bguibase
2517 PROC addtasknode(rm:PTR TO rexxmsg,name) HANDLE
2518 DEF tn=NIL:PTR TO tasknode,tc:PTR TO tc,oldname,cli
2520 IF name=NIL THEN name:=tc::ln.name
2521 oldname:=tc::ln.name
2524 cli:=tc::process.cli
2526 bguibase:=OpenLibrary('bgui.library',41)
2527 tc::process.cli:=cli
2529 tc::ln.name:=oldname
2530 IF bguibase=NIL THEN Raise("LIB
")
2531 tn:=AllocVec(SIZEOF tasknode,MEMF_PUBLIC)
2532 IF tn=NIL THEN Raise("MEM
")
2534 tn.bguibase:=bguibase
2536 newList(tn.stringspace)
2541 tn.idcmphook.window_object:=NIL
2542 IF setRexxVar(rm,'bguitasknode',{tn},4) THEN Raise(1)
2543 rexxbguibase.opencnt:=rexxbguibase.opencnt+1
2546 IF tn THEN FreeVec(tn)
2547 IF bguibase THEN CloseLibrary(bguibase)
2551 PROC freetasknode(rm:PTR TO rexxmsg,tn:PTR TO tasknode)
2552 DEF o:PTR TO objnode,n:PTR TO stringbuffer,im:PTR TO imagenode
2554 WHILE n:=RemHead(tn.stringspace) DO FreeVec(n)
2555 WHILE o:=RemHead(tn.objects)
2556 DisposeObject(o.obj)
2559 IF iconbase:=OpenLibrary('icon.library',0)
2560 WHILE im:=RemHead(tn.images)
2561 FreeDiskObject(im.dobj)
2564 CloseLibrary(iconbase); iconbase:=NIL
2566 IF tn.filereq THEN DisposeObject(tn.filereq)
2574 CloseLibrary(tn.bguibase)
2576 rexxbguibase.opencnt:=rexxbguibase.opencnt-1
2577 setRexxVar(rm,'bguitasknode',[0],4)
2580 PROC addicon(filename) HANDLE
2581 DEF im=NIL:PTR TO imagenode,dobj=NIL
2582 im:=AllocVec(SIZEOF imagenode,0)
2583 IF im=NIL THEN RETURN NIL
2584 IF iconbase:=OpenLibrary('icon.library',0)
2585 dobj:=GetDiskObject(filename)
2586 CloseLibrary(iconbase); iconbase:=NIL
2588 IF dobj=NIL THEN Raise(1)
2590 AddTail(tasknode.images,im)
2593 IF im THEN FreeVec(im)
2597 DEF n:PTR TO stringbuffer,len,end,p
2599 IF len>=QUANTUM THEN RETURN NIL
2600 n:=tasknode.stringspace.head
2602 end:=n.space+QUANTUM
2603 IF (p:=n.ptr)+len+1<end
2604 CopyMem(old,p,len+1)
2610 IF (n:=AllocVec(SIZEOF stringbuffer,MEMF_PUBLIC))=NIL THEN RETURN NIL
2612 CopyMem(old,p,len+1)
2613 n.ptr:=n.space+len+1
2614 AddTail(tasknode.stringspace,n)
2618 DEF n:PTR TO stringbuffer,end,p
2620 IF len>=QUANTUM THEN RETURN NIL
2621 n:=tasknode.stringspace.head
2623 end:=n.space+QUANTUM
2624 IF (p:=n.ptr)+len<end
2626 RETURN p+1 AND $FFFFFFFE
2630 IF (n:=AllocVec(SIZEOF stringbuffer,MEMF_PUBLIC))=NIL THEN RETURN NIL
2633 AddTail(tasknode.stringspace,n)
2637 DEF m:PTR TO memblock
2638 m:=AllocVec(len+4,MEMF_CHIP OR MEMF_PUBLIC) /* SIZEOF memblock */
2639 m.next:=tasknode.chipmem
2645 /* PROC close() IS 0 */