home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / software / sviluppo / rxmui / examples / amirc.rexx next >
OS/2 REXX Batch file  |  1999-12-21  |  7KB  |  239 lines

  1. /* */
  2.  
  3. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  4. if AddLibrary("rxmui.library")~=0 then exit
  5.  
  6. call rxmuiopt("DEBUGMODE SHOWERR")
  7.  
  8. call child("STRIP","MPROJECT","MENU")
  9. mproject.Title="Project"
  10.  call child("MPROJECT",menuitem("MSERVERS","Server...","S"))
  11.  call child("MPROJECT",menuitem("","BAR"))
  12.  call child("MPROJECT",menuitem("MLOG","Active Log","","CHEKIT TOGGLE"))
  13.  call child("MPROJECT",menuitem("","BAR"))
  14.  call child("MPROJECT",menuitem("MHIDE","Hide","H"))
  15.  call child("MPROJECT",menuitem("","BAR"))
  16.  call child("MPROJECT",menuitem("MHELP","Help..."))
  17.  call child("MPROJECT",menuitem("","BAR"))
  18.  call child("MPROJECT",menuitem("MABOUTAMIRC","About Amirc...","?"))
  19.  call child("MPROJECT",menuitem("MABOUTMUI","About MUI..."))
  20.  call child("MPROJECT",menuitem("","BAR"))
  21.  call child("MPROJECT",menuitem("MQUIT","Quit","Q"))
  22. res=NewObj("MENUSTRIP","STRIP")
  23. if res~=0 then call err(res)
  24.  
  25. app.Title="Amirc"
  26. app.Version="$VER: Amirc 1.0 (22.11.99)"
  27. app.Copyright="©1999, alfie"
  28. app.Author="alfie"
  29. app.Description="Amirc gui clone"
  30. app.Base="AIRC"
  31. app.SubWindow="WIN"
  32.  win.Title="Amirc"
  33.  win.ID="AIRC"
  34.  win.MenuStrip="STRIP"
  35.  win.Contents="MGROUP"
  36.  
  37.   call child("MGROUP","G1","GROUP")
  38.    g1.horiz=1
  39.    g1.horizspacing=0
  40.     channels.weight=0;call child("G1",Button("CHANNELS","#amiga"))
  41.     call child("G1","TP","GROUP")
  42.      tp.weight=100;
  43.      tp.pagemode=1
  44.       call child("TP",String("TOPIC"))
  45.       call child("TP",Status("STOPIC","a"))
  46.     call child("G1",makeTinyToggle("T","T",1))
  47.     call child("G1",makeTinyToggle("N","N",1))
  48.     call child("G1",makeTinyToggle("S","S",0))
  49.     call child("G1",makeTinyToggle("I","I",0))
  50.     call child("G1",makeTinyToggle("M","M",0))
  51.     call child("G1",makeTinyToggle("L","L",0))
  52.     maxusers.disabled=1;maxusers.weight=0;call child("G1",String("MAXUSERS"))
  53.     call child("G1",makeTinyToggle("K","K",0))
  54.     key.disabled=1;key.weight=0;call child("G1",String("KEY"))
  55.     call child("G1",makeTinyToggle("B","B",0))
  56.  
  57.   call child("MGROUP","G2","GROUP")
  58.    g2.horiz=1
  59.     call child("G2","TALK","GROUP")
  60.      call child("TALK","MSG","NLISTVIEW")
  61.      msg.list="LIST"
  62.      msg.frame="NONE"
  63.       list.class="NLIST"
  64.       list.input=0
  65.       list.autocopytoclip=1
  66.       list.Format="PREPARSE" d2c(27)"r COL=0 BAR, COL=1 BAR"
  67.       list.wrapcol=x2d(62)
  68.       list.autovisible=0
  69.       list.list="LIST"
  70.       list.0="poing|CA rulezza, MUI suka"
  71.       list.1="«Kick»|poing è stato cacciato da #amigaita da alfie : poing suka"
  72.       list.2="alfie|rxmui.library rulez! :)"
  73.      call child("TALK","ME","GROUP")
  74.       me.horiz=1
  75.       call child("ME","LAMP","LAMP")
  76.        lamp.weight=1;lamp.type="MEDIUM";lamp.color="OK"
  77.       call child("ME",label("alfie","DOUBLE"))
  78.       call child("ME","DUMMY1","GROUP")
  79.        dummy1.horiz=1
  80.        dummy1.horizspacing=0
  81.         call child("DUMMY1",String("MYMSG"))
  82.         e.weight=0;call child("DUMMY1",Button("E","L"))
  83.  
  84.     call child("G2",balance())
  85.  
  86.     call child("G2","UTILS","GROUP")
  87.      utils.weight=10
  88.      call child("UTILS","USERS","NLISTVIEW")
  89.      users.list="ULIST"
  90.       ulist.0="alfie"
  91.       ulist.1="jhon"
  92.      hbar.weight=0;call child("UTILS",MakeObj("hbar","HBAR",0))
  93.  
  94. res=NewObj("APPLICATION","APP")
  95. if res~=0 then call err(res)
  96.  
  97. call createChannelsWin
  98. global.ub=0
  99.  
  100. call createUserButtons
  101.  
  102. call Notify("WIN","CLOSEREQUEST",1,"APP","RETURNID","QUIT")
  103.  
  104. call Notify("CHANNELS","PRESSED",0,"CWIN","SET","OPEN",1)
  105.  
  106. call Notify("MSG","ENTRIES","EVERYTIME","MSG","SET","FIRST","BOTTOM")
  107. call Notify("CHANNELS","PRESSED",0,"APP","RETURNID")
  108.  
  109. call Notify("TOPIC","NEWCONTENTS","EVERYTIME","STOPIC","SET","CONTENTS","TRIGGERVALUE")
  110. call Notify("T","SELECTED",0,"MSG","INSERT","«mode»|not protected","BOTTOM")
  111. call Notify("T","SELECTED",1,"MSG","INSERT","«mode»|protected","BOTTOM")
  112. call Notify("T","SELECTED",0,"MSG","INSERT","«mode»|not protected","BOTTOM")
  113. call Notify("T","SELECTED","EVERYTIME","TP","SET","ACTIVEPAGE","TRIGGERVALUE")
  114. call Notify("S","SELECTED",1,"MSG","INSERT","«mode»|secret","BOTTOM")
  115. call Notify("S","SELECTED",0,"MSG","INSERT","«mode»|not secret","BOTTOM")
  116. call Notify("I","SELECTED",1,"MSG","INSERT","«mode»|invite only","BOTTOM")
  117. call Notify("I","SELECTED",0,"MSG","INSERT","«mode»|not invite","BOTTOM")
  118. call Notify("M","SELECTED",1,"MSG","INSERT","«mode»|moderated","BOTTOM")
  119. call Notify("M","SELECTED",0,"MSG","INSERT","«mode»|not moderated","BOTTOM")
  120. call Notify("L","SELECTED","EVERYTIME","MAXUSERS","SET","DISABLED","NOTTRIGGERVALUE")
  121. call Notify("K","SELECTED","EVERYTIME","KEY","SET","DISABLED","NOTTRIGGERVALUE")
  122.  
  123. call Notify("B","SELECTED","EVERYTIME","APP","RETURNID")
  124.  
  125. call Notify("MABOUTAMIRC","MENUTRIGGER","EVERYTIME","APP","ABOUT","WIN")
  126. call Notify("MABOUTMUI","MENUTRIGGER","EVERYTIME","APP","ABOUTMUI","WIN")
  127. call Notify("MQUIT","MENUTRIGGER","EVERYTIME","APP","RETURNID","QUIT")
  128. call Notify("MHIDE","MENUTRIGGER","EVERYTIME","APP","SET","ICONIFIED",1)
  129.  
  130. call set("TOPIC","CONTENTS","rxmui.library is out !!!")
  131. call set("STOPIC","CONTENTS","rxmui.library is out !!!")
  132.  
  133. noti=StartNotify("buttons")
  134. ns=NotifySignal(noti)
  135.  
  136. call set("WIN","OPEN",1)
  137.  
  138. s=0
  139. do forever
  140.     call handle("APP","H",s)
  141.     do i=0 to h.num-1
  142.         if h.i="QUIT" then exit
  143.         say h.num-1 h.i
  144.     end
  145.     s=Wait(or(h.signals,2**12,ns))
  146.     if and(s,2**12)~=0 then exit
  147.     if and(s,ns)~=0 then call createUserButtons
  148. end
  149. exit
  150.  
  151. err: procedure expose sigl rxmuierror
  152. parse arg res
  153. say signl "["res"]"
  154.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  155.     exit
  156.  
  157. createUserButtons: procedure expose global.
  158.     if ~open("IN","BUTTONS","R") then do
  159.         say "can't open buttons file"
  160.         return
  161.     end
  162.     call getattr("WIN","OPEN","O")
  163.     call set("WIN","OPEN",0)
  164.     if global.ub then do
  165.         call Dispose("USERBUTTONS")
  166.         call Dispose("UBMENU")
  167.     end
  168.  
  169.     ubmenu.0="MACTIONS"
  170.      mactions.class="MENU"
  171.      mactions.Title="Actions"
  172.  
  173.     userbuttons.columns=2
  174.     userbuttons.spacing=0
  175.     userbuttons.weight=0
  176.  
  177.     i=0
  178.     do while ~eof("IN")
  179.         line=readln("IN")
  180.         if line="" then iterate
  181.         USERBUTTONS.i=button("UB"i,line)
  182.         mactions.i=menuitem("UM"i,line)
  183.         i=i+1
  184.     end
  185.  
  186.     call close("IN")
  187.  
  188.     res=NewObj("GROUP","USERBUTTONS")
  189.     if res~=0 then call err(res)
  190.     res=Add("UTILS","USERBUTTONS")
  191.     if res~=0 then call err(res)
  192.  
  193.     res=NewObj("MENUSTRIP","UBMENU")
  194.     if res~=0 then call err(res)
  195.     res=set("USERS","CONTEXTMENU","UBMENU")
  196.     if res~=0 then call err(res)
  197.  
  198.     if o then call set("WIN","OPEN",1)
  199.     global.ub=1
  200.     return
  201.  
  202. makeTinyToggle: procedure
  203. parse arg name,text,state
  204.     b.Contents=text
  205.     b.inputmode="TOGGLE"
  206.     b.showselstate=1
  207.     b.selected=state
  208.     b.font="BUTTON"
  209.     b.frame="BUTTON"
  210.     b.background="BUTTONBACK"
  211.     b.weight=0;
  212.     res=newobj("TEXT",name,"B")
  213.     if res then call esci(res)
  214.     return name
  215.  
  216. createChannelsWin: procedure expose global.
  217.     cwin.Title="Preferred channels"
  218.     cwin.ID="CWIN"
  219.     cwin.Contents="CWMGROUP"
  220.     cwmgroup.frametitle="(doubleclick on a channel to join it)"
  221.      call child("CWMGROUP","CLISTVIEW","NLISTVIEW")
  222.       clistview.list="CLIST"
  223.        clist.class="NLIST"
  224.        clist.list="CLIST"
  225.        clist.0="#amiga"
  226.        clist.1="#amigaita"
  227.      call child("CWMGROUP","CWG","GROUP")
  228.       cwg.horiz=1
  229.        call child("CWG",label("Add:"))
  230.        call child("CWG",string("AC"))
  231.        call child("CWG",button("RC","Remove"))
  232.     res=NewObj("WINDOW","CWIN")
  233.     if res~=0 then call err(res)
  234.     res=add("APP","CWIN")
  235.     if res~=0 then call err(res)
  236.     call Notify("CWIN","CLOSEREQUEST",1,"CWIN","SET","OPEN",0)
  237.     return
  238.  
  239.