]> git.zerfleddert.de Git - micropolis/blobdiff - res/whead.tcl
re-add (disabled) air crash disaster
[micropolis] / res / whead.tcl
index 3cb3ced612d10e318bf6dcd56dc74eefbff24acf..7e9df1f4f2a3bc15d24439815b13037ff9d59615 100644 (file)
@@ -78,10 +78,19 @@ global NoticePanelHeight
 
 set visual [winfo screenvisual $win]
 set depth [winfo screendepth $win]
-#set screenwidth [winfo screenwidth $win]
-#set screenheight [winfo screenheight $win]
-set screenwidth 1200
-set screenheight 900
+set screenwidth [winfo screenwidth $win]
+set screenheight [winfo screenheight $win]
+set initialwidth 1200
+set initialheight 900
+
+if {$screenwidth < $initialwidth} {
+       set initialwidth $screenwidth
+}
+
+if {$screenheight < $initialheight} {
+       set initialheight $screenheight
+}
+
 
 if {!(("$visual" == "pseudocolor") ||
       ("$visual" == "truecolor") ||
@@ -116,7 +125,7 @@ bind $win <Mod2-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
@@ -260,6 +269,11 @@ bind $win.col1.w1.f1.disasters.m <Mod2-Key> {tk_traverseToMenu %W %A}
   $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?\""
@@ -656,7 +670,7 @@ place configure $win.col1\
   -x 0\
   -y 0\
   -width $HeadPanelWidth\
-  -height $screenheight
+  -relheight 1.0
 
 pack append $win.col1\
     $win.col1.w1               {top frame nw fillx} \
@@ -684,8 +698,17 @@ pack append $win.col1\
 place configure $win.col2\
   -x [expr "$HeadPanelWidth + 5"]\
   -y 0\
-  -width [expr "($screenwidth - $HeadPanelWidth) - 5"]\
-  -height $screenheight
+  -relheight 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} \
Impressum, Datenschutz