Skip to content

Commit

Permalink
Fixed GUI resize and build wrapFixed GUI resize and build wrap.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasferry committed Sep 15, 2011
1 parent bb42d5a commit c4630c4
Show file tree
Hide file tree
Showing 15 changed files with 73 additions and 50 deletions.
10 changes: 3 additions & 7 deletions Makefile
Expand Up @@ -19,9 +19,7 @@ build-linux:
(cd $(TEMP); $(SDX) qwrap tclrobots.tcl)
(cd $(TEMP); $(SDX) unwrap tclrobots.kit)
cp -rf $(TEMP)/src/ $(TEMP)/samples $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
cp -rf $(TEMP)/src/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
mkdir $(TEMP)/tclrobots.vfs/lib/lib
cp -rf $(TEMP)/lib/ $(TEMP)/tclrobots.vfs/lib/lib/
cp -rf $(TEMP)/src/ $(TEMP)/lib/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
# Wrap Linux version
cp build/tclkit-8.6 $(TEMP)/
(cd $(TEMP); $(SDX) wrap tclrobots.kit -runtime tclkit-8.6)
Expand All @@ -35,14 +33,12 @@ build-windows:
(cd $(TEMP); $(SDX) qwrap tclrobots.tcl)
(cd $(TEMP); $(SDX) unwrap tclrobots.kit)
cp -rf $(TEMP)/src/ $(TEMP)/samples $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
cp -rf $(TEMP)/src/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
mkdir $(TEMP)/tclrobots.vfs/lib/lib
cp -rf $(TEMP)/lib/ $(TEMP)/tclrobots.vfs/lib/lib/
cp -rf $(TEMP)/src/ $(TEMP)/lib/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
# Wrap Windows version
cp build/tclkit-8.6.exe $(TEMP)/
(cd $(TEMP); $(SDX) wrap tclrobots.kit -runtime tclkit-8.6.exe)
cp $(TEMP)/tclrobots.kit build/tclrobots.exe
rm -rf $(TEMP)
# rm -rf $(TEMP)

check: header.syntax
nagelfar header.syntax $(SRC)
Expand Down
Binary file modified build/tclrobots
Binary file not shown.
Binary file modified build/tclrobots.exe
Binary file not shown.
13 changes: 7 additions & 6 deletions doc/battle_doc.html
Expand Up @@ -81,14 +81,15 @@ <h2>2.1. init_battle/grid_battle_gui [ procedure ] </h2>

# The single battle mode shows the arena, the health box and the
# message box
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -rowspan 2 -sticky nsew
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew
grid columnconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew

grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
}
</pre>
<a name="robo3"></a>
Expand Down
3 changes: 3 additions & 0 deletions doc/gui_doc.html
Expand Up @@ -85,6 +85,9 @@ <h1>2. gui/init_gui [ procedure ] </h1>
set libpath [file join $thisDir ../lib/tkpath]
lappend auto_path $libpath

puts "thisDir: $thisDir"
puts "libpath: $libpath"

if {[catch {package require tkpath}]} {
# Check current operating system
if {$os eq "windows"} {
Expand Down
10 changes: 8 additions & 2 deletions doc/main_doc.html
Expand Up @@ -1733,9 +1733,15 @@ <h1>17. main/display [ procedure ] </h1>
</p>
<p class="item_name">SOURCE</p>
<pre class="source">proc display {msg} {
global display_t os
global display_t gui os

if {$os eq "windows"} {
if {!$gui &amp;&amp; [eq $os "windows"]} { rm -rf $(TEMP)
mkdir $(TEMP)
(cd $(TEMP); cp -rf ../src .; cp -rf ../lib/ .; cp -rf ../samples/ .; cp ../README .; cp ../LICENSE .; cp -rf ../tclrobots.tcl .)
(cd $(TEMP); $(SDX) qwrap tclrobots.tcl)
(cd $(TEMP); $(SDX) unwrap tclrobots.kit)
cp -rf $(TEMP)/src/ $(TEMP)/samples $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
cp -rf $(TEMP)/src/ $(TEMP)/lib/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
$display_t insert end "$msg\n"
$display_t see end
update
Expand Down
13 changes: 7 additions & 6 deletions doc/simulator_doc.html
Expand Up @@ -385,14 +385,15 @@ <h1>3. init_battle/grid_sim_gui [ procedure ] </h1>

# The simulator shows the arena, the message box and the simulator
# controls. Simulator controls are defined later.
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -rowspan 2 -sticky nsew
grid $sim_f -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew
grid columnconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $sim_f -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew

grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
}
</pre>
<a name="robo8"></a>
Expand Down
2 changes: 1 addition & 1 deletion doc/tclrobots_doc.html
Expand Up @@ -9,7 +9,7 @@ <h1>1. tclrobots/file_header [ file ] </h1>
<p> tclrobots.tcl
</p>
<p class="item_name">DESCRIPTION</p>
<p> This is the top-level file of TclRobots. It sources ./src/main.tcl
<p> This is the top-level file of TclRobots. It sources src/main.tcl
which includes the main game logic.
</p>

Expand Down
12 changes: 6 additions & 6 deletions doc/tournament_doc.html
Expand Up @@ -188,8 +188,8 @@ <h3>2.2.1. init_gui_tourn/create_tourn_gui [ procedure ] </h3>
-foreground white \
-listvariable tournMatches]
}
grid $tournScore_lb -column 0 -row 1 -sticky nsew
grid $tournMatches_lb -column 0 -row 2 -sticky nsew
grid $tournScore_lb -column 0 -row 0 -sticky nsew
grid $tournMatches_lb -column 0 -row 1 -sticky nsew
}
</pre>
<a name="robo5"></a>
Expand All @@ -215,17 +215,17 @@ <h3>2.2.2. init_gui_tourn/grid_tourn_gui [ procedure ] </h3>
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $tourn_f -column 1 -row 1 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew -rowspan 3
grid $robotMsg_lb -column 2 -row 0 -sticky nsew -rowspan 2

# Fix resizing of widgets
grid columnconfigure $game_f 0 -weight 1
grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 1 -weight 1
grid columnconfigure $tourn_f 0 -weight 1
grid columnconfigure $tourn_f 1 -weight 1
grid rowconfigure $tourn_f 0 -weight 1
grid rowconfigure $tourn_f 1 -weight 1
grid rowconfigure $tourn_f 2 -weight 1
}
</pre>
<a name="robo6"></a>
Expand Down
13 changes: 7 additions & 6 deletions src/battle.tcl
Expand Up @@ -78,14 +78,15 @@ proc grid_battle_gui {} {

# The single battle mode shows the arena, the health box and the
# message box
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -rowspan 2 -sticky nsew
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew
grid columnconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew

grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
}
#******

Expand Down
3 changes: 3 additions & 0 deletions src/gui.tcl
Expand Up @@ -40,6 +40,9 @@ proc init_gui {} {
set libpath [file join $thisDir ../lib/tkpath]
lappend auto_path $libpath

puts "thisDir: $thisDir"
puts "libpath: $libpath"

if {[catch {package require tkpath}]} {
# Check current operating system
if {$os eq "windows"} {
Expand Down
10 changes: 8 additions & 2 deletions src/main.tcl
Expand Up @@ -1872,9 +1872,15 @@ proc mrand {max} {
# SOURCE
#
proc display {msg} {
global display_t os
global display_t gui os

if {$os eq "windows"} {
if {!$gui && [eq $os "windows"]} { rm -rf $(TEMP)
mkdir $(TEMP)
(cd $(TEMP); cp -rf ../src .; cp -rf ../lib/ .; cp -rf ../samples/ .; cp ../README .; cp ../LICENSE .; cp -rf ../tclrobots.tcl .)
(cd $(TEMP); $(SDX) qwrap tclrobots.tcl)
(cd $(TEMP); $(SDX) unwrap tclrobots.kit)
cp -rf $(TEMP)/src/ $(TEMP)/samples $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
cp -rf $(TEMP)/src/ $(TEMP)/lib/ $(TEMP)/README $(TEMP)/LICENSE $(TEMP)/tclrobots.vfs/lib/app-tclrobots/
$display_t insert end "$msg\n"
$display_t see end
update
Expand Down
13 changes: 7 additions & 6 deletions src/simulator.tcl
Expand Up @@ -102,14 +102,15 @@ proc grid_sim_gui {} {

# The simulator shows the arena, the message box and the simulator
# controls. Simulator controls are defined later.
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -rowspan 2 -sticky nsew
grid $sim_f -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew
grid columnconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid $game_f -column 0 -row 2 -sticky nsew
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $sim_f -column 1 -row 0 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew

grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
}
#******

Expand Down
12 changes: 6 additions & 6 deletions src/tournament.tcl
Expand Up @@ -174,8 +174,8 @@ proc create_tourn_gui {} {
-foreground white \
-listvariable tournMatches]
}
grid $tournScore_lb -column 0 -row 1 -sticky nsew
grid $tournMatches_lb -column 0 -row 2 -sticky nsew
grid $tournScore_lb -column 0 -row 0 -sticky nsew
grid $tournMatches_lb -column 0 -row 1 -sticky nsew
}
#******

Expand Down Expand Up @@ -204,17 +204,17 @@ proc grid_tourn_gui {} {
grid $arena_c -column 0 -row 0 -sticky nsew -rowspan 2
grid $robotHealth_lb -column 1 -row 0 -sticky nsew
grid $tourn_f -column 1 -row 1 -sticky nsew
grid $robotMsg_lb -column 2 -row 0 -sticky nsew -rowspan 3
grid $robotMsg_lb -column 2 -row 0 -sticky nsew -rowspan 2

# Fix resizing of widgets
grid columnconfigure $game_f 0 -weight 1
grid columnconfigure $game_f 0 -weight 2
grid columnconfigure $game_f 1 -weight 1
grid columnconfigure $game_f 2 -weight 1
grid rowconfigure $game_f 0 -weight 1
grid rowconfigure $game_f 1 -weight 1
grid columnconfigure $tourn_f 0 -weight 1
grid columnconfigure $tourn_f 1 -weight 1
grid rowconfigure $tourn_f 0 -weight 1
grid rowconfigure $tourn_f 1 -weight 1
grid rowconfigure $tourn_f 2 -weight 1
}
#******

Expand Down
9 changes: 7 additions & 2 deletions tclrobots.tcl
Expand Up @@ -6,7 +6,7 @@
#
# DESCRIPTION
#
# This is the top-level file of TclRobots. It sources ./src/main.tcl
# This is the top-level file of TclRobots. It sources src/main.tcl
# which includes the main game logic.
#
# The authors are Jonas Ferry, Peter Spjuth and Martin Lindskog, based
Expand All @@ -24,4 +24,9 @@
# Provide package name for starpack build, see Makefile
package provide app-tclrobots 1.0

source ./src/main.tcl
set thisScript2 [file join [pwd] [info script]]
set thisDir2 [file dirname $thisScript2]

puts $thisDir2

source $thisDir2/src/main.tcl

0 comments on commit c4630c4

Please sign in to comment.