home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / sviluppo / rxmui / examples / d&d.rexx < prev    next >
OS/2 REXX Batch file  |  1999-12-21  |  3KB  |  126 lines

  1. /*how to handle a manual d and d between 2 NList*/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8. call setrxmuistack(86000) /* big stack for nlist */
  9.  
  10. call createApp
  11.  
  12. call set("win","open",1)
  13. call getattr("win","open","o")
  14. if o=0 then do
  15.     say "can't open window"
  16.     exit
  17. end
  18.  
  19. call handleApp
  20. exit
  21. /***********************************************************************/
  22. handleApp: procedure
  23. ctrl_c=2**12
  24. s=0
  25. do forever
  26.     call handle("APP","H",s)
  27.     do i=0 to h.num-1
  28.         select
  29.             when h.i="QUIT" then exit
  30.             otherwise say h.num-1 h.i
  31.         end
  32.     end
  33.     s=wait(or(h.signals,ctrl_c))
  34.     if and(s,ctrl_c)~=0 then exit
  35. end
  36. * never reached */
  37. /***********************************************************************/
  38. err: procedure expose sigl rxmuierror
  39. parse arg res
  40. say signl "["res"]"
  41.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  42.     exit
  43. /***********************************************************************/
  44. createApp: procedure
  45.     app.Title="ManualD&D"
  46.     app.Version="$VER: ManualD&D 1.0 (22.11.99)"
  47.     app.Copyright="©1999, alfie"
  48.     app.Author="alfie"
  49.     app.Description="ManualD&D example"
  50.     app.Base="SHOW"
  51.     app.SubWindow="WIN"
  52.  
  53.      win.Title="ManualD&D"
  54.      win.ScreenTitle="ManualD&D"
  55.      win.ID="SHOW"
  56.      win.Contents="mgroup"
  57.  
  58.       mgroup.0="bg"
  59.        bg.class="group"
  60.        bg.horiz=1
  61.        bg.0 = Button("remove","_Remove")
  62.        bg.1 = Button("sort","_Sort")
  63.       mgroup.1="g"
  64.        g.class="group"
  65.        g.horiz=1
  66.        g.0="listview1"
  67.         listview1.class="nlistview"
  68.         listview1.list="list1"
  69.          list1.title="Uno|Due"
  70.          list1.titleclick=2
  71.          list1.multiselect="shifted"
  72.          list1.dragsortable=1
  73.          list1.dragtype="immediate"
  74.          list1.Format="BAR W=-1,BAR W=-1"
  75.          list1.mincolsortable=0
  76.          list1.titlemark=0
  77.           list1.0="Uno|1"
  78.           list1.1="Due|2"
  79.           list1.2="Tre|3"
  80.        g.1="listview2"
  81.         listview2.class="nlistview"
  82.         listview2.list="list2"
  83.          list2.dragsortable=1
  84.          list2.dragtype="immediate"
  85.          list2.Format="COL=1 BAR,COL=0 BAR"
  86.          list2.multiselect="DEFAULT"
  87.          list2.dragsortinsert=1
  88.           list2.0="Alfonso|Ranieri"
  89.           list2.1="Franco|Fiocca"
  90.           list2.2="Tiziana|Spognardi"
  91.           list2.3="Angelo|Barone"
  92.  
  93.     res=NewObj("application","app")
  94.     if res~=0 then call err(res)
  95.  
  96.     res=DandD("list2","list1","AUTO")
  97.     if res~=0 then call err(res)
  98.  
  99.     res=DandD("list1","list2","AUTO")
  100.     if res~=0 then call err(res)
  101.  
  102.     res=Notify("sort","pressed",0,"list2","sort")
  103.     if res~=0 then call err(res)
  104.  
  105.     res=Notify("remove","pressed",0,"list1","remove","active")
  106.     if res~=0 then call err(res)
  107.  
  108.     res=Notify("list1","titleclick","everytime","list1","sort2","triggervalue","add2values")
  109.     if res~=0 then call err(res)
  110.  
  111.     res=Notify("list1","sorttype","everytime","list1","set","titlemark","triggervalue")
  112.     if res~=0 then call err(res)
  113.  
  114.     res=Notify("list1","active","everytime","app","returnid")
  115.     if res~=0 then call err(res)
  116.  
  117.     res=Notify("win","closerequest",1,"app","returnid","quit")
  118.     if res~=0 then call err(res)
  119.  
  120.     return
  121. /***********************************************************************/
  122. halt:
  123. break_c:
  124.     exit
  125. /**************************************************************************/
  126.