#! /usr/bin/wish -f
#.------------------------------------------------------------,
#| Compact Flash Builder - IBM Embedded Linux Network Station |
#|                                                            |
#| This code originally developed by:                         |
#| Ryan Harper and Christopher Glendenning                    |
#| March, April 2000                                          |
#|                                                            |
#| Filename: CFBuilder_2.3.tcl                                |
#| Last Modified: April 10, 2000 by Ryan Harper               |
#| Changes: added new var CFBUILD_DIR_NO_SLASH 04.11.00 RAH   |
#|          added background image, 04.10.00 RAH              |
#|          added call, SaveDirInfo, init scripts 4.10.00 RAH |
#|          added in global var for current dir 4.7.00 CMG    |
#| Description: Program control file. Execute this file to    |
#|    run the Compact Flash Builder. This file also performs  |
#|    all source file joining and displaying the main window  |
#`------------------------------------------------------------'

#-----------------------Source File Joins-----------------
global CFBUILD_DIR
global CFBUILD_DIR_NO_SLASH
set CFBUILD_DIR [pwd]
set CFBUILD_DIR_NO_SLASH $CFBUILD_DIR
append CFBUILD_DIR "/"

if {[file type $argv0] == "link"} {
    set CFBUILD_HOME [file dirname [file readlink $argv0]]
} {
    set CFBUILD_HOME [file dirname $argv0]
}

#----------------------Wizard Pages-----------------------
source [file join $CFBUILD_HOME/Source wiz_archive.tcl] ;# backup & restore page
source [file join $CFBUILD_HOME/Source wiz_settings.tcl] ;# configure settings\
  page
source [file join $CFBUILD_HOME/Source wiz_selectpack.tcl] ;# package install\
  page
source [file join $CFBUILD_HOME/Source wiz_partition.tcl] ;# partition page
source [file join $CFBUILD_HOME/Source wiz_buildpack.tcl] ;# build packages page
source [file join $CFBUILD_HOME/Source wiz_intro.tcl] ;# intro page

source [file join $CFBUILD_HOME/Source proginit.tcl] ;# keybinds, init glob vars
source [file join $CFBUILD_HOME/Source menubar.tcl] ;# menu system
source [file join $CFBUILD_HOME/Source genutils.tcl] ;# generic utils\
  (windowing and stuff)

#-----------------------End-------------------------------

wm title . "Compact Flash Builder v2.3 - IBM Network Station"
wm geometry . 550x225+0+0
wm resizable . 0 0
wm iconname . "IBM CF Builder"
wm resizable . 0 0

proc showAbout {} {
    toplevel .about -width 400 -height 200 -takefocus -relief -background black
    centerwin .about ;#call the center function to place about box centered
    wm title .about "Compact Flash Builder"
    wm resizable .about 0 0

    label .about.cfinfo -relief sunken -anchor n -background grey\
      -foreground black -padx 25 -pady 25 -text "Compact Flash\
      Builder\n\nVersion 2.3\n\nDeveloped by: Ryan Harper and Christopher\
      Glendenning\n \nhttp://www.pc.ibm.com/us/networkstation"
    pack .about.cfinfo
}


#-----------------------Main()-----------------------------
set tval [clock seconds]
set logfilename [clock format $tval -format %y.%m.%d.%X.log]
set lh [open Log/$logfilename w]
fconfigure $lh
global lh

initGlobalVars
SaveDirInfo " " "0"
buildMenus
#-----------------------End Main--------------------------- 
