G4C - NetBar

;NetBar v6.0 Button Console
;Kevin Anderson    andersok@mail.bogo.co.uk  {using Gui4Cli by D.Keletsekis}

WinOut 'CON:0/150/1000/120/  NetBar v6.0    /AUTO/Close'

WinFont Times.font 13 010
WINBIG 100 20 98 166 'NetBar'
WinType 11010000
WinBackground SOLID 1 0
;BOX 0 22 86 124 OUT RIDGE
;BOX 0 0 86 22 OUT RIDGE

xOnload
GuiOpen NetBar
SetVar ConVar 2                 ;set ConVar for FlipFlop below

Extract NetBar GUIPATH PathVar ;get path of NetBar and make assign to it.
Assign NetBar: $PathVar  

IfExists FILE ENV:.W.NetBar     ;see if first time NetBar was launched
  ;All ok lets boogie           ;and get user to set paths etc to apps
Else
GuiLoad :Paths
GuiOpen Paths
EndIf

IfExists PORT REXX              ;see if RexxMast is running for Arexx
  ;Arexx ready                  ;scripts etc if not load it
Else
  CLI 'Sys:System/RexxMast >NIL:'
EndIf

xIcon 0 0 :icons/on
GadID 1
IF $ConVar = 1                         ;FlipFlop routine for xIcon above to change
  ChangeIcon NetBar 1 4 16 :icons/on   ;icon and fuction to LogOn or LogOff script
  SetVar ConVar 2
  CLI $.H.NetBar                       ;using ENV: Variable set by DialEtc gui
ElSE                        
  ChangeIcon NetBar 1 4 16 :icons/off
  SetVar ConVar 1
  CLI $.D.NetBar
ENDIF

xIcon 0 30 :icons/www      ;button/icon to launch Net App using ENV Variable
RUN $.W.NetBar             ;set by Paths gui

xIcon 0 57 :icons/mail
RUN $.M.NetBar

xIcon 0 84 :icons/news
RUN $.N.NetBar

xIcon 0 111 :icons/ftp
RUN $.F.NetBar

xIcon 0 138 :icons/irc
RUN $.I.NetBar

;Menus for NetBar

xMenu 'NetBar ' 'Quit    ' '' Q 
GuiClose NetBar

xMenu Extras Telnet '' T
RUN $.T.NetBar

xMenu Extras Ping '' P
CLI $.P.NetBar

xMenu Settings 'Net Apps ' '' A
GuiLoad :Paths
GuiOpen Paths

xMenu Settings 'Misc   ' '' M
GuiLoad :DialEtc
GuiOpen DialEtc
 
xMenu Tools AutoView '' V
GuiLoad :Rt.g
ReqFile -1 -1 300 -40 'Pick a file:' LOAD rtn_var ''  ;call ASL requester
GoSub  Rt.g ViewFile                                  ;call the routine

xMenu Tools AutoIcon '' I
GuiLoad :AutoIcon
GuiOpen AutoIcon

xMenu Tools Pakit '' K
GuiLoad :Pakit
GuiOpen Pakit

xMenu Help 'About NetBar' '' ''
GuiLoad :AboutNB

xMenu Help 'NetBar Help' '' ''
CLI 'c:amigaguide NetBar:NetBar.guide'

xONCLOSE
GuiQuit AutoIcon
GuiQuit Paths                              ;when NetBar is closed/quited quit all           
GuiQuit Rt.g                               ;loaded guis and helper guis i.e. Rt.g
GuiQuit ConView
GuiQuit DialEtc
GuiQuit Pakit
GuiQuit NetBar
