G4C  - ConView 

;(nicked from lister.g by D.Keletsekis (c))
;Butchered by Kevin Anderson  andersok@mail.bogo.co.uk  {using Gui4Cli by D.Keletsekis}

WinBig 0 11 0 -13 'Reading file....'	; you may want to change the position
WinSmall 0 -1 150 21
WinType 11110001

;------> On Loading, we open the Gui's window..
;	 and load the file stated in the variable 'SfileVar'
;        This has been set by an other Gui, since we get called from there.

xOnLoad
Guiopen ConView
GoSub ConView filechange


;-------> Upon closing, we quit so as not to use-up memory

xOnClose
GuiQuit ConView


;-------> This is also an AppWindow - drop files into it & read them

xAppWindow SfileVar
GoSub ConView filechange


;------> Routine to load & show file

xRoutine filechange             ; routine to load & show file
Guiscreen ConView front
SetWinTitle ConView 'Loading....'
LVChange ConView 1 $SfileVar
SetWinTitle ConView '$SfileVar                                '

;------------> the listview. - Use 'L' for scrolling the list up/down

xListview 0 0 0 0 '' '' '' 20 NUM
GadID  1
GadKey l
GadFont times.font 13 000

;------------> Herebelow are our menus, which do various things to the file

xMenu Project Open.. '' O		; load a new file
extract SfileVar PATH dglv_path
SetVar dglv_getfile ''
ReqFile -1 -1 250 200 'Choose file' LOAD dglv_getfile $dglv_path
If $dglv_getfile != ''
   SetVar SfileVar $dglv_getfile
   GoSub ConView filechange
EndIf
DelVar dglv_getfile
DelVar dglv_path

xMenu Project Quit '' Q
Guiquit ConView

xMenu Tools 'Helpers' '' ''

xMenu Tools 'Helpers' 'Arj file' ''
IfExists FILE c:unarj
  CD $.A.NetBar
       CLI 'unarj e $rtn_var'
Else
  EZreq 'Cannot find C:unarj see docs' OK NoFind
EndIf

xMenu Tools 'Helpers' 'Mime/Base64' ''
IfExists FILE c:base64decode
  CLI 'c:Base64Decode $SfileVar autoname $.A.NetBar'
Else
  EZreq 'Cannot find C:Base64Decode see docs' OK NoFind
EndIf

xMenu Tools 'Helpers' '.tar.gz/.tgz/.gzip' ''
IfExists FILE c:untgz
  CLI 'c:untgz $SfileVar $.A.NetBar'
Else
  EZreq 'Cannot find C:Untgz see docs' OK NoFind
EndIf

xMenu Tools 'Helpers' 'Uuencoded' ''
IfExists FILE c:uuxt
  CLI 'c:uuhx x $SfileVar'
Else
  EZreq 'Cannot find C:UUxt see docs' OK NoFind
EndIf

xMenu Tools 'Helpers' 'Zip file' ''
IfExists FILE c:unzip
  CLI 'c:unzip $SfileVar -d $.A.NetBar'
Else
  EZreq 'Cannot find C:Unzip see docs' OK NoFind
EndIf


xMenu Tools 'Viewers' 'avi/mov/fli/flc' ''
IfExists FILE c:xanim
CLI 'C:Xanim.scr $SfileVar'
Else
  EZreq 'Cannot find C:xAnim see docs' OK NoFind
EndIf

xMenu Tools 'Viewers' 'mpeg/mpg' ''
IfExists FILE c:mp
  CLI 'c:mp -dither gray8 $SfileVar'
Else
  EZreq 'Cannot find C:mp see docs' OK NoFind
EndIf

xMenu Tools 'Viewers' 'MultiView (OS3.x)' ''
IfExists FILE sys:utilities/multiview
  CLI 'Sys:Utilities/MultiView $SfileVar' 
Else
  EZreq 'Cannot find Sys:Utilities/MultiView see docs' OK NoFind
EndIf

xOnFail
EZreq 'FileType unknown/corrupted or wrong Helper \n Nobodys Perect' OK NoFind

