home *** CD-ROM | disk | FTP | other *** search
- /* Shows how to handle gadget help */
-
- signal on halt
- signal on break_c
-
- l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
- if AddLibrary("rexxsupport.library","rxwiz.library")~=0 then exit
-
- prg=ProgramName("NOEXT")
- path=PathPart(ProgramName("FULL"))
-
- parm.0.value=""
- if ~RMH_ReadArgs("PUBSCREEN") then do
- call PrintFault(IoErr(),prg)
- exit
- end
-
- s.PubScreen=parm.0.value
- s.fallback=1
- s.Snapshot=1
- s.cat=prg".catalog"
- s.AppName=prg
- s.AppIconName=prg
- s.CxTitle=prg
- s.CxDescr="Shows how to handle gadget help"
- s.MasterWin="GHWIN"
- s.AutoClose=1
- s.catalog=prg".catalog"
- res=OpenSurface(AddPart(path,prg".wizard"),"S")
- if res~=0 then call error(res)
- ss=SurfaceSignal("S")
-
- GHWIN.Gads=16
- res=OpenWindow("S","GHWIN")
- if res~=0 then call error(res)
-
- global.help=0
- ctrl_c=2**12
- stop=0
- do while ~stop
- srec=Wait(or(ss,ctrl_c))
- if and(srec,ctrl_c)>0 then call break_c
- if and(srec,ss)>0 then stop=handle("GHWIN")
- end
- call CloseSurface("S")
- exit
-
- /**************************************************************************/
- error:
- parse arg code
- if RXWIZERR~="RXWIZERR" then string = GetRxWizString(1001)":" RXWIZERR || d2c(10)
- else string=""
- string= string || GetRxWizString(code) || d2c(10) || GetRxWizString(1002)":" SIGL-1
- call easyrequest(string,"RXWiz")
- exit
- /**************************************************************************/
- handle: procedure expose global.
- parse arg o
- handle.wait=0
- res=HandleSurface("S","HANDLE")
- if res~=0 then call error(res)
- do i=0 to handle.imsg-1
- select
- when handle.i.class="CLOSEWINDOW" then return 1
- when handle.i.class="VANILLAKEY" then call GadgetKey("S",handle.i.window,handle.i.code,handle.i.qualifier)
- when handle.i.class="MENUPICK" then
- select
- when handle.i.objectid="MABOUT" then call WizEasyRequest("S","GHWIN",1)
- when handle.i.objectid="MHIDE" then call IconifySurface("S",1)
- when handle.i.objectid="MQUIT" then return 1
- when handle.i.objectid="MHELP" then do
- global.help=~global.help
- call HelpControl("S",handle.i.window,global.help)
- end
- otherwise nop
- end
- when handle.i.class="IDCMPUPDATE" then
- select
- when handle.i.objectid="CHECK" then do
- call LockWindow("S","GHWIN")
- call info "Now I should check our mail box..."
- call delay(50)
- call info "But I am just a demo :-)"
- call delay(50)
- call UnLockWindow("S","GHWIN")
- end
- when handle.i.objectid="CANCEL" then return 1
- otherwise nop
- end
- when handle.i.class="GADGETHELP" then
- if handle.i.help~="" then call info handle.i.help
- else if handle.i.objectid~="" then call info handle.i.objectid
- else call info ""
- otherwise say handle.i.class
- end
- end
- return 0
- /**************************************************************************/
- info: procedure
- parse arg msg
- set.text=msg
- call SetWizAttrs("S","GHWIN","INFO","SET")
- return
- /**************************************************************************/
- halt:
- exit
- break_c:
- exit
- /**************************************************************************/
-