This is the mail archive of the
xconq7@sources.redhat.com
mailing list for the Xconq project.
Re: Civ game
- From: MA Dunzi <tadalunch at s5 dot xrea dot com>
- To: xconq7 at sources dot redhat dot com
- Date: Thu, 19 Sep 2002 08:58:30 +0900 (JST)
- Subject: Re: Civ game
It is a awful patch, but this patch will make some strings clickable.
--- tkconq.tcl.orig Thu Sep 19 08:26:24 2002
+++ tkconq.tcl Thu Sep 19 08:26:34 2002
@@ -11,6 +11,9 @@
wm title . "Xconq Main Window"
wm withdraw .
+#lappend auto_path BWidget-1.4.1
+#package require BWidget
+
# Asking for a specific color sometimes loses...
#set progress_bar_color black
@@ -3502,6 +3505,7 @@
label .research.current -width 25 -height 2 -font $textfont
pack .research.current -side top
+ frame .research.t
listbox .research.topics -selectmode browse -width 25 \
-yscrollcommand ".research.yscroll set" -relief sunken -borderwidth 2
# Whether this scrollbar is actually needed depends on how many
@@ -3510,8 +3514,9 @@
# is a user preference.
scrollbar .research.yscroll -orient vert \
-command ".research.topics yview"
- pack .research.yscroll -side right -fill y
- pack .research.topics -side top
+ pack .research.yscroll -side right -fill y -in .research.t
+ pack .research.topics -side top -in .research.t
+ pack .research.t
button .research.ok -text "Research" -command ok_research
pack .research.ok -side left -padx 5 -pady 5
@@ -4140,11 +4145,17 @@
bind .help.bot.topics.list <ButtonRelease-1> { select_help_topic }
frame .help.bot.t
- text .help.bot.t.txt -width 60 -height 30 -font $textfont -wrap word \
+ text .help.bot.t.txt -width 60 -height 20 -font $textfont -wrap word \
-yscrollcommand { .help.bot.t.scroll set }
scrollbar .help.bot.t.scroll -command { .help.bot.t.txt yview }
+
+ #Tree .help.bot.t.tree -padx 2 -height 10
+
pack .help.bot.t.txt -side left -fill both -expand true
pack .help.bot.t.scroll -side right -fill y
+
+ #pack .help.bot.t.tree -before .help.bot.t.txt -side bottom -fill x
+
pack .help.bot.t -side right -fill both -expand true
set bgcolor [ .help.bot.t.txt cget -background ]
@@ -4197,8 +4208,63 @@
}
.help.bot.t.txt delete body.first body.last
.help.bot.t.txt insert end "$contents" body
+ if { $nclass == "u" } {
+ set rxp "Required advances to build: "
+ set len [string length $rxp]
+ set xy [.help.bot.t.txt search $rxp 0.0 end]+28chars
+
+ set le [.help.bot.t.txt search . $xy]
+ set te ""
+ set cnt 0
+
+ while { $te != $le } {
+ set te [.help.bot.t.txt search , $xy $le]
+ if { $te == "" } { set te $le }
+ .help.bot.t.txt tag add tag$cnt $xy $te
+ .help.bot.t.txt tag configure tag$cnt -relief raised -borderwidth 1
+ set moji [.help.bot.t.txt get $xy $te]
+ .help.bot.t.txt tag bind tag$cnt <Button-1> "help_goto $moji"
+ set cnt $cnt+1
+ set xy $te+1chars
+ }
+ }
+ if { $nclass == "a" } {
+ set cnt 0
+ foreach rxp { "Prerequisite advances: " "Enables: " } {
+ set tmp [.help.bot.t.txt search $rxp 0.0 end]
+ if { $tmp != "" } {
+ set len [string length $rxp]
+ set tmp $tmp+${len}chars
+ set xy [.help.bot.t.txt search " vs " $tmp]+4chars
+ set le [.help.bot.t.txt search . $xy]
+ set te ""
+
+ while { $te != $le } {
+ set te [.help.bot.t.txt search , $xy $le]
+ if { $te == "" } { set te $le }
+ .help.bot.t.txt tag add tagg$cnt $xy $te
+ .help.bot.t.txt tag configure tagg$cnt -relief raised -borderwidth 1
+ set moji [.help.bot.t.txt get $xy $te]
+ .help.bot.t.txt tag bind tagg$cnt <Button-1> "help_goto $moji"
+ set cnt $cnt+1
+ set xy $te+2chars
+ }
+ }
+ }
+ }
.help.bot.t.txt yview moveto 0
.help.bot.t.txt configure -state disabled
+
+ #.help.bot.t.tree delete [.help.bot.t.tree nodes root]
+ #if { $nclass == "a"} {
+ # .help.bot.t.tree bindText <ButtonPress-1> "help_goto [.help.bot.t.tree selection get]"
+
+# .help.bot.t.tree insert end root Steel -text Steel -open 1
+# .help.bot.t.tree insert end Steel Metallurgy -text Metallurgy -open 1
+# .help.bot.t.tree insert end Metallurgy Gunpowder -text Gunpowder
+# .help.bot.t.tree insert end Metallurgy "The University" -text "The University"
+# .help.bot.t.tree insert end Steel Industrialization -text Industrialization
+# }
}
proc scrolled_listbox { f args } {
--
MA Dunzi <tadalunch@s5.xrea.com> http://tadalunch.s5.xrea.com/xconq/index.html