#!/usr/bin/env wish
wm title . {Getting Started with Windows 2000}
image create photo icon -file [file dirname [file normalize [info script] ] ]/program.png
wm iconphoto . icon
wm attributes . -topmost yes -type dialog
wm resizable . 0 0
set fontfamily {Tahoma}
set fontsize {8}
set fontfamilyheader {Tahoma}
set fontsizeheader {12}
font create mainfont -family $fontfamily -size $fontsize
font create smallfont -family $fontfamily -size 7
font create boldfont -family $fontfamily -size $fontsize -weight bold
font create headerfont -family $fontfamilyheader -size $fontsizeheader -weight bold
set left_register_name {Register Now}
set left_discover_name {Discover Windows}
set left_connect_name {Connect to the Internet}
set right_main_title {Getting Started}
set right_main_text {You can access all your documents, programs, and settings from the start button.}
set right_discover_title {Discover Windows 2000}
set right_discover_text {Windows 2000 Professional is easier to use, easier to manage, more compatible, and more powerful. The Discover Windows 2000 Professional tour highlights all the newest and coolest features.}
set right_register_title {Register Windows 2000}
set right_register_text {Register your copy of Windows 2000 Professional and help Microsoft give you:
• The best possible product support
• The right software upgrades
• The most relevant new product information}
set right_connect_title {Connect to the Internet}
set right_connect_text {• Read the latest news and financial information
• Visit Web sites around the world
• Get e-mail
We make it quick and simple for you to connect to the internet.
}
set startup_checkbox_name {Show this screen at startup.}
set exit_button_name {Exit}
proc getVariable {variable} {
        upvar $variable variableCont
        return $variableCont
}
set leftbg {#a6caf0}
set leftseparator {#336699}
set headerbg {#336699}
global backgroundColor
global lightShadowColor
global shadowColor
global lightColor
global foregroundColor
global windowColor
set backgroundColor {#d4d0c8}
set lightShadowColor {#808080}
set shadowColor {#404040}
set lightColor {#FFFFFF}
set foregroundColor {#000000}
set windowColor {#FFFFFF}
set x_1 [ expr {([ winfo vrootwidth  . ] - 478 ) / 2 }]
set y_1 [ expr {([ winfo vrootheight . ] - 322 ) / 2 }]
wm geometry . 478x322+$x_1+$y_1
image create photo logo -file [file dirname [file normalize [info script] ] ]/logo.png
frame .logo -width 478 -height 93
pack .logo -expand no -fill none
pack propagate .logo 0
canvas .logo.canvas -width 478 -height 93 -highlightthickness 0
.logo.canvas create image 0 0 -image logo -anchor nw
pack .logo.canvas
frame .left -width 179 -height 229
pack .left -side left
frame .right -width 478 -height 229 -background white
pack .right -side right
canvas .left.canvas -width 179 -height 229 -highlightthickness 0 -background $leftbg
pack .left.canvas
.left.canvas create line 0 24 179 24 -fill $leftseparator
.left.canvas create rectangle 0 0 179 24 -tags hovereffect-register -outline {}
.left.canvas create line 0 49 179 49 -fill $leftseparator
.left.canvas create rectangle 0 25 179 49 -tags hovereffect-discover -outline {}
.left.canvas create line 0 74 179 74 -fill $leftseparator
.left.canvas create rectangle 0 50 179 74 -tags hovereffect-connect -outline {}
.left.canvas create text 10 12  -anchor w -font boldfont -underline 0 -text $left_register_name
.left.canvas create text 10 37 -anchor w -font boldfont -underline 0 -text $left_discover_name
.left.canvas create text 10 62 -anchor w -font boldfont -underline 0 -text $left_connect_name
canvas .right.canvas -width 478 -height 229 -highlightthickness 0 -background white
pack .right.canvas
image create photo welcome -file [file dirname [file normalize [info script] ] ]/welcome.png
.right.canvas create image 17 71 -tags image -image welcome -anchor nw
image create photo connect -file [file dirname [file normalize [info script] ] ]/connect.png
image create photo discover -file [file dirname [file normalize [info script] ] ]/discover.png
image create photo register -file [file dirname [file normalize [info script] ] ]/register.png
.right.canvas create image 299 229 -tags cornerimage -anchor se -state hidden
.right.canvas create text 16 11  -anchor nw -fill $headerbg -font headerfont -tags header -text $right_main_title
.right.canvas create text 16 37  -anchor nw -font mainfont -width 260 -tags text -text $right_main_text
.right.canvas create rectangle 248 200 290 220 -outline {#808080} -fill white
.right.canvas create text 270 211 -fill {#808080} -underline 0 -text $exit_button_name -font boldfont
.right.canvas create bitmap 251 203 -tags stipple -foreground {#2b2f37} -state hidden -anchor nw -bitmap @[file dirname [file normalize [info script] ] ]/stipple.xbm
.right.canvas create rectangle 248 200 290 220 -tags exit-action -outline {} -fill {}
.right.canvas bind exit-action <Enter> {
	%W configure -cursor hand1
	%W itemconfig stipple -state normal
}
.right.canvas bind exit-action <Leave> {
	%W configure -cursor left_ptr
	%W itemconfig stipple -state hidden
}
.right.canvas bind exit-action <ButtonRelease-1> {
	exit
}
.left.canvas create rectangle 0 0 179 24 -tags register -outline {}
.left.canvas bind register <Enter> {
	%W configure -cursor hand1
	%W itemconfig hovereffect-register -fill white
	.right.canvas itemconfig image -state hidden
	.right.canvas itemconfig header -text [getVariable right_register_title]
	.right.canvas itemconfig text -text [getVariable right_register_text]
	.right.canvas itemconfig cornerimage -image register -state normal
}
.left.canvas bind register <Leave> {
	%W configure -cursor left_ptr
	%W itemconfig hovereffect-register -fill {}
	.right.canvas itemconfig image -state normal
	.right.canvas itemconfig header -text [getVariable right_main_title]
	.right.canvas itemconfig text -text [getVariable right_main_text]
	.right.canvas itemconfig cornerimage -state hidden
}
.left.canvas bind register <Button-1> {
	exec xmessage -nearmouse "This is a test." &
}
.left.canvas create rectangle 0 25 179 49 -tags discover -outline {}
.left.canvas bind discover <Enter> {
	%W configure -cursor hand1
	%W itemconfig hovereffect-discover -fill white
	.right.canvas itemconfig image -state hidden
	.right.canvas itemconfig header -text [getVariable right_discover_title]
	.right.canvas itemconfig text -text [getVariable right_discover_text]
	.right.canvas itemconfig cornerimage -image discover -state normal
}
.left.canvas bind discover <Leave> {
	%W configure -cursor left_ptr
	%W itemconfig hovereffect-discover -fill {}
	.right.canvas itemconfig image -state normal
	.right.canvas itemconfig header -text [getVariable right_main_title]
	.right.canvas itemconfig text -text [getVariable right_main_text]
	.right.canvas itemconfig cornerimage -state hidden
}
.left.canvas bind discover <Button-1> {
	exec xmessage -nearmouse "This is a test." &
}
.left.canvas create rectangle 0 50 179 74 -tags connect -outline {}
.left.canvas bind connect <Enter> {
	%W configure -cursor hand1
	%W itemconfig hovereffect-connect -fill white
	.right.canvas itemconfig image -state hidden
	.right.canvas itemconfig header -text [getVariable right_connect_title]
	.right.canvas itemconfig text -text [getVariable right_connect_text]
	.right.canvas itemconfig cornerimage -image connect -state normal
}
.left.canvas bind connect <Leave> {
	%W configure -cursor left_ptr
	%W itemconfig hovereffect-connect -fill {}
	.right.canvas itemconfig image -state normal
	.right.canvas itemconfig header -text [getVariable right_main_title]
	.right.canvas itemconfig text -text [getVariable right_main_text]
	.right.canvas itemconfig cornerimage -state hidden
}
.left.canvas bind connect <Button-1> {
	exec xmessage -nearmouse "This is a test." &
}
set x_checkbox {8}
set y_checkbox {210}
.left.canvas create rectangle $x_checkbox $y_checkbox [expr {$x_checkbox + 13}] [expr {$y_checkbox + 13}] -fill $backgroundColor -outline {}
.left.canvas create line $x_checkbox $y_checkbox [expr {$x_checkbox + 12}] $y_checkbox -fill $lightShadowColor
.left.canvas create line $x_checkbox $y_checkbox $x_checkbox [expr {$y_checkbox + 12}] -fill $lightShadowColor
.left.canvas create line [expr {$x_checkbox + 1}] [expr {$y_checkbox + 1}] [expr {$x_checkbox + 1}] [expr {$y_checkbox + 11}] -fill $shadowColor
.left.canvas create line [expr {$x_checkbox + 1}] [expr {$y_checkbox + 1}] [expr {$x_checkbox + 11}] [expr {$y_checkbox + 1}] -fill $shadowColor
.left.canvas create line [expr {$x_checkbox + 12}] $y_checkbox [expr {$x_checkbox + 12}] [expr {$y_checkbox + 13}] -fill $lightColor
.left.canvas create line $x_checkbox [expr {$y_checkbox + 12}] [expr {$x_checkbox + 12}] [expr {$y_checkbox + 12}] -fill $lightColor
.left.canvas create rectangle [expr {$x_checkbox + 2}] [expr {$y_checkbox + 2}] [expr {$x_checkbox + 10}] [expr {$y_checkbox + 10}] -fill $windowColor -outline $windowColor -tags cbBox
.left.canvas create text [expr {$x_checkbox + 17}] [expr {$y_checkbox + 5}] -anchor w -underline 0 -font smallfont -text $startup_checkbox_name
.left.canvas create rectangle [expr {$x_checkbox + 0}] [expr {$y_checkbox + 0}] [expr {$x_checkbox + 171}] [expr {$y_checkbox + 13}] -outline {} -tags "cbAction"
global Startup
set Startup {True}
.left.canvas create bitmap [expr {$x_checkbox + 3}] [expr {$y_checkbox + 3}] -anchor nw -tags checkbox -foreground $foregroundColor -bitmap @[file dirname [file normalize [info script] ] ]/checkbox.xbm
.left.canvas bind cbAction <ButtonPress-1> {
	#%W itemconfig cbBox -outline $backgroundColor -fill $backgroundColor
	%W itemconfig cbBox -outline [getVariable backgroundColor] -fill [getVariable backgroundColor]
}
.left.canvas bind cbAction <ButtonRelease-1> {
	#%W itemconfig cbBox -outline $backgroundColor -fill $backgroundColor
	%W itemconfig cbBox -outline [getVariable windowColor] -fill [getVariable windowColor]
	if {$Startup == {True}} {
		%W itemconfig checkbox -state hidden
		set Startup {False}
	} else {
		%W itemconfig checkbox -state normal
		set Startup {True}
	}
}
