arexxtlacitka.png (1250 bytes) Arexx RxMUI Docs Examples Back to Ghh home page
/* RxMUI by Alfonso Ranieri */
/* ghh RxMUI TextInputScroll */

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 TextInputScroll"                        /* název programu (v Exchange) */
    app.Version="$VER: RxMUI TextInputScroll 0.1 (01.11.2016)" /* verze programu */
    app.Copyright="Donotpanicware ghh 2016"
    app.Author="ghh"
    app.Description="RxMUI TextInputScroll"                  /* popis programu (v Exchange) */
    app.Base="RXMUIAPP"                                      /* název Arexx portu */
    app.SubWindow="win"                                      /* název hlavního okna "win" */
     win.ID="MWIN"                                           /* id hlavního okna */
     win.ScreenTitle="RxMUI TextInputScroll"                 /* titulek na liště Workbenche */
     win.Title="TextInputScroll"                             /* titulek na okně */
     win.Contents="mgroup"                                   /* okno obsahuje hlavní skupinu s názvem "mgroup" */
      mgroup.0="txg"                                         /* TextInputScroll se umístí do Virtgroup */
       txg.Class="Virtgroup"                                 /* třída Virtgroup */
       txg.Frame="Virtual"                                   /* typ rámečku */
        txg.0="txi"                                          /* název obsahu Virtgroup */
         txi.Class="TextInputScroll"                         /* třída TextInputScroll */
         txi.Styles="MUI"                                    /* typ stylu none, MUI, IRC, EMail, HTML */
         txi.Multiline=1                                     /* vice řádků 1 = ano, 0 = jen jeden */
         txi.UseWinBorder=0
         txi.VertScrollerOnly=0                              /* pouze vertikální posuvník 1 = ano, 0 = ne */
      mgroup.1="bgr"
       bgr.Class="Group"                                     /* třída Group */
       bgr.Horiz=1                                           /* horizontální */
        bgr.0=Button("clearbutton","Clear")                  /* tlačítko Clear - vymaže text */
        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("clearbutton","Pressed",0,"txi","DoMarkAll","Contents")   /* jedno tlačítko */
    call Notify("clearbutton","Pressed",0,"txi","DoCut","Contents")       /* plní dvě funkce */
    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
ghh don'tpanic