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

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