/* RxMUI by Alfonso Ranieri */
/* ghh RxMUI Empty with menu */
signal on halt
signal on break_c
call Init /* volá funkci Init */
call CreateApp /* volá funkci CreateApp (hlavní program) */
call HandleApp /* volá funkci HandleApp (hlavní event) */
/**************************************** přítomnost knihoven Alfie ****/
Init: procedure expose global.
l="rmh.library";if ~show("L",l) then;if ~AddLib(l,0,-30) then exit
if RMH_AddLibrary("rexxsupport.library","rxmui.library")~=0 then exit
call Pragma("W","N")
call RxMUIOpt("DebugMode ShowErr")
return
/******************************************************** start gui ****/
CreateApp: procedure expose global. /* hlavní program */
app.Title="RxMUI Empty with menu" /* název programu (v Exchange) */
app.Version="$VER: RxMUI template 0.1 (01.11.2016)" /* verze programu */
app.Copyright="Donotpanicware ghh 2016"
app.Author="ghh"
app.Description="RxMUI Empty with menu" /* popis programu (v Exchange) */
app.Base="RXMUIAPP" /* název Arexx portu */
app.MenuStrip="strip" /* hlavní pruh (lišta) */
strip.Class="Menustrip"
strip.0="mproject" /* první menu (Project) */
mproject.Class="Menu"
mproject.Title="Project"
mproject.0=MenuItem("mabout","?\About...") /* položka v menu */
mproject.1=MenuItem("maboutrxmui","X\About RxMUI...")
mproject.2=MenuItem("maboutmui","!\About MUI...")
mproject.3=MenuItem("","BAR")
mproject.4=MenuItem("mhide","H\Hide")
mproject.5=MenuItem("","BAR")
mproject.6=MenuItem("mquit","Q\Quit")
strip.1="msett" /* druhé menu (MUI) */
msett.Class="Menu"
msett.Title="MUI"
msett.0=MenuItem("msettings","MUI Settings...") /* položka v menu */ /* konec menu strip */
app.SubWindow="win" /* název hlavního okna "win" */
win.ID="MWIN" /* id hlavního okna */
win.ScreenTitle="RxMUI Empty with menu" /* titulek na liště Workbenche */
win.Title="Empty with menu" /* titulek na okně */
win.Contents="mgroup" /* okno obsahuje hlavní skupinu s názvem "mgroup" */
mgroup.0="bgr"
bgr.Class="Group" /* třída Group */
bgr.Horiz=1 /* horizontální */
bgr.0=Button("okbutton","Ok") /* tlačítko Ok */
bgr.1=Button("quitbutton","Quit") /* tlačítko Quit */ /* konec popisu gui */
/*********************************************************** notify ****/
if NewObj("Application","App")>0 then exit /* nový objekt - aplikace "App" */
call Notify("win","CloseRequest",1,"App","ReturnID","QUIT") /* opuštění programu zavřením okna */
call Notify("mabout" ,"MenuTrigger","Everytime","App","About","win") /* notify menu strip */
call Notify("maboutrxmui","MenuTrigger","EveryTime","App","AboutRxMUI","win")
call Notify("maboutmui" ,"MenuTrigger","EveryTime","App","AboutMUI","win")
call Notify("mhide" ,"MenuTrigger","EveryTime","App","Set","Iconified",1)
call Notify("mquit" ,"MenuTrigger","EveryTime","App","ReturnID","QUIT")
call Notify("msettings" ,"MenuTrigger","EveryTime","App","OpenConfigWindow") /* konec menu strip */
call Notify("okbutton" ,"Pressed",0,"App","Return","Say 'Ok'") /* tlačítka v okně */
call Notify("quitbutton" ,"Pressed",0,"App","ReturnID","QUIT")
call Set("win","Open",1)
return
/*********************************************** hlavní event Alfie ****/
HandleApp: procedure expose global.
ctrl_c=2**12
do forever
call NewHandle("App","h",ctrl_c)
if and(h.signals,ctrl_c)>0 then exit
select
when h.event="QUIT" then exit
otherwise interpret h.event
end
end
/****************************************************** exit signal ****/
halt:
break_c:
exit
|