set depth [winfo screendepth $win]
set screenwidth [winfo screenwidth $win]
set screenheight [winfo screenheight $win]
-#set screenwidth 1200
-#set screenheight 900
+set initialwidth 1200
+set initialheight 900
+
+if {$screenwidth < $initialwidth} {
+ set initialwidth $screenwidth
+}
+
+if {$screenheight < $initialheight} {
+ set initialheight $screenheight
+}
+
if {!(("$visual" == "pseudocolor") ||
("$visual" == "truecolor") ||
tk_bindForTraversal $win
bind $win <F10> {tk_firstMenu %W}
-bind $win <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win <Alt-Key> {tk_traverseToMenu %W %A}
wm title $win "Micropolis Controls"
wm iconname $win {Micropolis Controls}
-wm geometry $win 1200x900+0+0
+wm geometry $win ${initialwidth}x${initialheight}+0+0
#wm positionfrom $win user
wm withdraw $win
wm maxsize $win $screenwidth $screenheight
-relief raised
tk_bindForTraversal $win.col1.w1.f1
bind $win.col1.w1.f1 <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1 <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1 <Alt-Key> {tk_traverseToMenu %W %A}
SetHelp $win.col1.w1.f1.micropolis Head.MicropolisMenu
-variable $win.postedMenu
tk_bindForTraversal $win.col1.w1.f1.micropolis
bind $win.col1.w1.f1.micropolis <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.micropolis <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.micropolis <Alt-Key> {tk_traverseToMenu %W %A}
tk_menus $win $win.col1.w1.f1.micropolis
-font [Font $win Medium]
tk_bindForTraversal $win.col1.w1.f1.micropolis.m
bind $win.col1.w1.f1.micropolis.m <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.micropolis.m <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.micropolis.m <Alt-Key> {tk_traverseToMenu %W %A}
$win.col1.w1.f1.micropolis.m add command\
-label {About...}\
-command "UIShowPicture 300"
-variable $win.postedMenu
tk_bindForTraversal $win.col1.w1.f1.options
bind $win.col1.w1.f1.options <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.options <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.options <Alt-Key> {tk_traverseToMenu %W %A}
tk_menus $win $win.col1.w1.f1.options
-font [Font $win Medium]
tk_bindForTraversal $win.col1.w1.f1.options.m
bind $win.col1.w1.f1.options.m <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.options.m <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.options.m <Alt-Key> {tk_traverseToMenu %W %A}
$win.col1.w1.f1.options.m add checkbutton\
-label {Auto Budget}\
-variable AutoBudget\
-variable $win.postedMenu
tk_bindForTraversal $win.col1.w1.f1.disasters
bind $win.col1.w1.f1.disasters <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.disasters <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.disasters <Alt-Key> {tk_traverseToMenu %W %A}
tk_menus $win $win.col1.w1.f1.disasters
-font [Font $win Medium]
tk_bindForTraversal $win.col1.w1.f1.disasters.m
bind $win.col1.w1.f1.disasters.m <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.disasters.m <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.disasters.m <Alt-Key> {tk_traverseToMenu %W %A}
$win.col1.w1.f1.disasters.m add command\
-label {Monster}\
-command "UIDisaster $win \"UIMakeMonster\" \"release a monster?\""
$win.col1.w1.f1.disasters.m add command\
-label {Meltdown}\
-command "UIDisaster $win \"sim MakeMeltdown\" \"have a nuclear meltdown?\""
+ if {[sim HasAirCrash]} {
+ $win.col1.w1.f1.disasters.m add command\
+ -label {Air Crash}\
+ -command "UIDisaster $win \"sim MakeAirCrash\" \"crash an airplane?\""
+ }
$win.col1.w1.f1.disasters.m add command\
-label {Tornado}\
-command "UIDisaster $win \"sim MakeTornado\" \"spin up a tornado?\""
-variable $win.postedMenu
tk_bindForTraversal $win.col1.w1.f1.priority
bind $win.col1.w1.f1.priority <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.priority <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.priority <Alt-Key> {tk_traverseToMenu %W %A}
tk_menus $win $win.col1.w1.f1.priority
-font [Font $win Medium]
tk_bindForTraversal $win.col1.w1.f1.priority.m
bind $win.col1.w1.f1.priority.m <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.priority.m <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.priority.m <Alt-Key> {tk_traverseToMenu %W %A}
$win.col1.w1.f1.priority.m add radiobutton\
-label {Super Fast}\
-command {SetPriority 4}\
-command {SetPriority 0}\
-value {0}\
-variable Priority
+ $win.col1.w1.f1.priority.m add checkbutton\
+ -label {Pause}\
+ -command {TogglePause}\
+ -variable Pause
SetHelp $win.col1.w1.f1.windows Head.WindowsMenu
-variable $win.postedMenu
tk_bindForTraversal $win.col1.w1.f1.windows
bind $win.col1.w1.f1.windows <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.windows <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.windows <Alt-Key> {tk_traverseToMenu %W %A}
tk_menus $win $win.col1.w1.f1.windows
-font [Font $win Medium]
tk_bindForTraversal $win.col1.w1.f1.windows.m
bind $win.col1.w1.f1.windows.m <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f1.windows.m <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f1.windows.m <Alt-Key> {tk_traverseToMenu %W %A}
$win.col1.w1.f1.windows.m add command\
-label {Budget}\
-command "UIShowBudgetAndWait"
-relief flat
tk_bindForTraversal $win.col1.w1.f2.f2
bind $win.col1.w1.f2.f2 <F10> {tk_firstMenu %W}
-bind $win.col1.w1.f2.f2 <Mod2-Key> {tk_traverseToMenu %W %A}
+bind $win.col1.w1.f2.f2 <Alt-Key> {tk_traverseToMenu %W %A}
SetHelp $win.col1.w1.f2.f2 Head.Log
SetHelp $win.col1.w1.f2.f2.scroll Head.Scrollbar
+global EventLines
+
text $win.col1.w1.f2.f2.text \
-yscroll "$win.col1.w1.f2.f2.scroll set" \
-borderwidth 1 \
-relief sunken \
-wrap word \
-state disabled \
- -height 5 \
+ -height $EventLines \
-font [Font $win Text]
LinkWindow $win.text $win.col1.w1.f2.f2.text
-relief flat
tk_bindForTraversal $win.col1.w1.f2.f3
bind $win.col1.w1.f2.f3 <F10> {tk_firstMenu %W}
- bind $win.col1.w1.f2.f3 <Mod2-Key> {tk_traverseToMenu %W %A}
+ bind $win.col1.w1.f2.f3 <Alt-Key> {tk_traverseToMenu %W %A}
button $win.col1.w1.f2.f3.chat \
-font [Font $win Large] \
set $win.col1.w1.f2.f3.entry.value ""
tk_bindForTraversal $win.col1.w1.f2.f3.entry
bind $win.col1.w1.f2.f3.entry <F10> {tk_firstMenu %W}
- bind $win.col1.w1.f2.f3.entry <Mod2-Key> {tk_traverseToMenu %W %A}
+ bind $win.col1.w1.f2.f3.entry <Alt-Key> {tk_traverseToMenu %W %A}
bind $win.col1.w1.f2.f3.entry <Return> "DoEnterMessage %W %W.value"
bind $win.col1.w1.f2.f3.entry <Escape> "DoEvalMessage %W %W.value"
bind $win.col1.w1.f2.f3.entry <Any-Enter> {focus %W}
-x 0\
-y 0\
-width $HeadPanelWidth\
- -height $screenheight
+ -relheight 1.0
pack append $win.col1\
$win.col1.w1 {top frame nw fillx} \
-x [expr "$HeadPanelWidth + 5"]\
-y 0\
-relheight 1.0\
- -relwidth 1.0
+ -width [expr "($screenwidth - $HeadPanelWidth) - 5"]
+
+proc resizeeditor {win width} {
+ global HeadPanelWidth
+
+ place configure $win.col2\
+ -width [expr "($width - $HeadPanelWidth) - 5"]
+}
+
+bind $win <Configure> "resizeeditor $win %w"
#pack append $win.col2\
# $win.col2.x1 {top frame nw fillx} \