18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
-
+
-
+
|
# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
#
#----------------------------------------------------------------------
# $Revision$
#----------------------------------------------------------------------
proc createMap {top} {
proc createMap {top bg} {
set w $top.c_map
if {$::Pref(wideMap)} {
set width 20
} else {
set width 6
}
canvas $w -width $width -borderwidth 0 -selectborderwidth 0 \
-highlightthickness 0 -height 10
-highlightthickness 0 -height 10 -background $bg
set map [image create photo map$top]
$w create image 0 0 -anchor nw -image $map
bind $w <Destroy> [list image delete $map]
bind $w <Configure> [list drawMap $top %h]
bind $w <Button-2> [list ThumbMap $top %y]
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
|
}
incr ::eskil($top,mapMax) $n
}
proc addMapLines {top n} {
incr ::eskil($top,mapMax) $n
}
# Use the assembled information for the map to draw edit buttons
proc drawEditButtons {top} {
$::widgets($top,wTb) delete 1.0 end
set l 0
foreach change $::eskil($top,changes) {
lassign $change start length type line1 n1 line2 n2
set pre [expr {($length - 1) / 2}]
while {$l < ($start + $pre)} {
incr l
$::widgets($top,wTb) insert end \n
}
incr l
$::widgets($top,wTb) image create end -image $::img(left) \
-pady -2 -padx 1 -name li$l
$::widgets($top,wTb) image create end -image $::img(right) \
-pady -2 -name ri$l
$::widgets($top,wTb) tag add lt$l li$l
$::widgets($top,wTb) tag add rt$l ri$l
# Make visible for now
$::widgets($top,wTb) tag configure lt$l -background pink
$::widgets($top,wTb) tag configure rt$l -background lightgreen
$::widgets($top,wTb) insert end \n
while {$l < ($start+ $length)} {
incr l
$::widgets($top,wTb) insert end \n
}
}
while {$l < $::eskil($top,mapMax)} {
incr l
$::widgets($top,wTb) insert end \n
}
}
proc drawMap {top newh} {
set oldh [map$top cget -height]
if {$oldh == $newh} return
map$top blank
if {![info exists ::eskil($top,changes)] || \
|