home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / dragndrop.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  4.1 KB  |  148 lines

  1. /**/
  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.  
  9. call rxmuiopt("showerr debugmode")
  10.  
  11. call CreateApp
  12. call handleApp
  13.  
  14. /***********************************************************************/
  15. CreateApp: procedure
  16.  
  17.     strip.0="mproject"
  18.      mproject.Title="Project"
  19.      mproject.class="menu"
  20.       mproject.0=menuitem("mabout","About...","?")
  21.       mproject.1=menuitem("maboutrxmui","About RxMUI...")
  22.       mproject.2=menuitem("maboutmui","About MUI...")
  23.       mproject.3=menuitem("","BAR")
  24.       mproject.4=menuitem("mhide","Hide","H")
  25.       mproject.5=menuitem("","BAR")
  26.       mproject.6=menuitem("mquit","Quit","Q")
  27.     res=NewObj("menustrip","strip")
  28.     if res~=0 then exit
  29.  
  30.     app.Title="DragnDrop"
  31.     app.Version="$VER: DragnDrop 1.0 (17.12.00)"
  32.     app.Copyright="©1999, alfie"
  33.     app.Author="alfie"
  34.     app.Description="DragnDrop example"
  35.     app.Base="EXAMPLE"
  36.     app.menustrip="strip"
  37.     app.SubWindow="win"
  38.      win.ID="MAIN"
  39.      win.Title="DragnDrop"
  40.      win.contents="mgroup"
  41.  
  42.       mgroup.0="cg0"
  43.        cg0.class="group"
  44.        cg0.columns=2
  45.  
  46.         cg0.0=Text(,ParseText("%cAvailable Fields\n(alpha sorted)"),"none","none")
  47.  
  48.         cg0.1=Text(,ParseText("%cVisible Fields\n(sortable)"),"none","none")
  49.  
  50.         cg0.2="lv1"
  51.          lv1.Class="Listview"
  52.          lv1.DragType="Immediate"
  53.          lv1.ControlChar="1"
  54.          lv1.list="list1"
  55.           list1.Frame="InputList"
  56.           list1.ShowDropMark=0
  57.           list1.DragSortable=1
  58.            list1.0="Age"
  59.            list1.1="Birthday"
  60.            list1.2="c/o"
  61.            list1.3="City"
  62.            list1.4="Comment"
  63.            list1.5="Country"
  64.            list1.6="EMail"
  65.            list1.7="Fax"
  66.            list1.8="First name"
  67.            list1.9="Job"
  68.            list1.10="Name"
  69.            list1.11="Phone"
  70.            list1.12="Projects"
  71.            list1.13="Salutation"
  72.            list1.14="ZIP"
  73.            list1.15="State"
  74.            list1.16="Street"
  75.  
  76.         cg0.3="lv2"
  77.          lv2.Class="Listview"
  78.          lv2.DragType="Immediate"
  79.          lv2.list="list2"
  80.           list2.Frame="InputList"
  81.           list2.DragSortable=1
  82.  
  83.         cg0.4=Text(,ParseText("%cListview without\nmultiple selection."))
  84.  
  85.         cg0.5=Text(,ParseText("%cListview with\nmultiple selection."))
  86.  
  87.         cg0.6="lv3"
  88.          lv3.Class="Listview"
  89.          lv3.DragType="Immediate"
  90.          lv3.Dropable=0
  91.          lv3.ControlChar=1
  92.          lv3.list="list3"
  93.           list3.Frame="InputList"
  94.           list3.DragSortable=1
  95.           list3.list="ll"
  96.            do i=0 to 49
  97.                ll.i="Line "i
  98.            end
  99.  
  100.         cg0.7="lv4"
  101.          lv4.Class="Listview"
  102.          lv4.DragType="Immediate"
  103.          lv4.list="list4"
  104.          lv4.MultiSelect="Default"
  105.           list4.Frame="InputList"
  106.           list4.DragSortable=1
  107.           list4.list="ll"
  108.  
  109.     res=NewObj("application","app")
  110.     if res~=0 then exit
  111.  
  112.     call DandD("list1","list1","noself")
  113.  
  114.     call DandD("list1","list2","auto remove both")
  115.  
  116.     call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  117.     call Notify("mabout","menutrigger","everytime","app","about","win")
  118.     call Notify("maboutrxmui","menutrigger","everytime","app","aboutrxmui","win")
  119.     call Notify("maboutmui","menutrigger","everytime","app","aboutmui","win")
  120.     call Notify("mhide","menutrigger","everytime","app","set","iconified",1)
  121.     call Notify("mquit","menutrigger","everytime","app","returnid","quit")
  122.  
  123.     call set("win","open",1)
  124.     if ~xget("win","open") then do
  125.         say "can't open window"
  126.         exit
  127.     end
  128.  
  129.     return
  130. /**************************************************************************/
  131. handleApp: procedure
  132.     hggg=1
  133.     ctrl_c=2**12
  134.     do forever
  135.         call newhandle("APP","H",ctrl_c)
  136.         if and(h.signals,ctrl_c)>0 then exit
  137.         select
  138.             when h.event="QUIT" then exit
  139.             when h.event="DROPEVENT" then call dropFun(h.from,h.to)
  140.             otherwise say h.event
  141.         end
  142.     end
  143. /***********************************************************************/
  144. halt:
  145. break_c:
  146.     exit
  147. /**************************************************************************/
  148.