︙ | | | ︙ | |
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set debug 0
set diffver "Version 2.0.6+ 2004-10-26"
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
# Follow any link
set tmplink $thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
|
|
|
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
namespace import -force psballoon::addBalloon
}
set debug 0
set diffver "Version 2.0.6+ 2004-10-28"
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
# Follow any link
set tmplink $thisScript
while {[file type $tmplink] eq "link"} {
set tmplink [file readlink $tmplink]
|
︙ | | | ︙ | |
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
|
$top.mf.m add command -label "Quit" -underline 0 \
-command {cleanupAndExit all}
menubutton $top.mo -text "Options" -underline 0 -menu $top.mo.m
menu $top.mo.m
$top.mo.m add cascade -label "Font" -underline 0 -menu $top.mo.mf
$top.mo.m add cascade -label "Ignore" -underline 0 -menu $top.mo.mi
$top.mo.m add cascade -label "Parse" -underline 0 -menu $top.mo.mp
$top.mo.m add command -label "Colours..." -underline 0 -command makePrefWin
$top.mo.m add cascade -label "Context" -underline 1 -menu $top.mo.mc
$top.mo.m add separator
$top.mo.m add command -label "Save default" \
-command [list saveOptions $top]
menu $top.mo.mf
|
>
>
|
|
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
|
$top.mf.m add command -label "Quit" -underline 0 \
-command {cleanupAndExit all}
menubutton $top.mo -text "Options" -underline 0 -menu $top.mo.m
menu $top.mo.m
$top.mo.m add cascade -label "Font" -underline 0 -menu $top.mo.mf
$top.mo.m add cascade -label "Ignore" -underline 0 -menu $top.mo.mi
$top.mo.m add command -label "Preprocess..." -underline 0 \
-command [list EditPrefRegsub $top]
$top.mo.m add cascade -label "Parse" -underline 1 -menu $top.mo.mp
$top.mo.m add command -label "Colours..." -underline 0 -command makePrefWin
$top.mo.m add cascade -label "Context" -underline 1 -menu $top.mo.mc
$top.mo.m add separator
$top.mo.m add command -label "Save default" \
-command [list saveOptions $top]
menu $top.mo.mf
|
︙ | | | ︙ | |
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
|
$top.mo.mi add radiobutton -label "All spaces (-w)" \
-variable Pref(ignore) -value "-w"
$top.mo.mi add separator
$top.mo.mi add checkbutton -label "Case (-i)" \
-variable Pref(nocase)
$top.mo.mi add checkbutton -label "Digits" \
-variable Pref(nodigit)
$top.mo.mi add command -label "Regsub..." -underline 0 \
-command [list EditPrefRegsub $top]
menu $top.mo.mp
$top.mo.mp add radiobutton -label "Nothing" -variable Pref(parse) -value 0
$top.mo.mp add radiobutton -label "Lines" -variable Pref(parse) -value 1
$top.mo.mp add radiobutton -label "Blocks (small)" -variable Pref(parse) \
-value 2
$top.mo.mp add radiobutton -label "Blocks" -variable Pref(parse) -value 3
|
<
<
|
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
|
$top.mo.mi add radiobutton -label "All spaces (-w)" \
-variable Pref(ignore) -value "-w"
$top.mo.mi add separator
$top.mo.mi add checkbutton -label "Case (-i)" \
-variable Pref(nocase)
$top.mo.mi add checkbutton -label "Digits" \
-variable Pref(nodigit)
menu $top.mo.mp
$top.mo.mp add radiobutton -label "Nothing" -variable Pref(parse) -value 0
$top.mo.mp add radiobutton -label "Lines" -variable Pref(parse) -value 1
$top.mo.mp add radiobutton -label "Blocks (small)" -variable Pref(parse) \
-value 2
$top.mo.mp add radiobutton -label "Blocks" -variable Pref(parse) -value 3
|
︙ | | | ︙ | |
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
|
if {[winfo exists $w] && [winfo toplevel $w] eq $w} {
wm deiconify $w
raise $w
focus $w
} else {
toplevel $w -padx 3 -pady 3
wm title $w "Preferences: Regsub"
}
button $w.b -text "Add" -padx 15 -command [list AddPrefRegsub $top $w]
# Result example part
if {![info exists ::diff($top,prefregexa)]} {
set ::diff($top,prefregexa) \
"An example TextString FOR_REGSUB /* Comment */"
set ::diff($top,prefregexa2) \
"An example TextString FOR_REGSUB /* Comment */"
}
frame $w.res -bd 2 -relief groove -padx 3 -pady 3
label $w.res.l3 -text "Example 1:" -anchor w
entry $w.res.e3 -textvariable ::diff($top,prefregexa) -width 60
label $w.res.l4 -text "Result 1:" -anchor w
label $w.res.e4 -textvariable ::diff($top,prefregresult) \
-anchor "w" -width 10
label $w.res.l5 -text "Example 2:" -anchor w
entry $w.res.e5 -textvariable ::diff($top,prefregexa2)
|
|
|
|
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
|
if {[winfo exists $w] && [winfo toplevel $w] eq $w} {
wm deiconify $w
raise $w
focus $w
} else {
toplevel $w -padx 3 -pady 3
wm title $w "Preferences: Preprocess"
}
button $w.b -text "Add" -padx 15 -command [list AddPrefRegsub $top $w]
# Result example part
if {![info exists ::diff($top,prefregexa)]} {
set ::diff($top,prefregexa) \
"An example TextString FOR_REGSUB /* Comment */"
set ::diff($top,prefregexa2) \
"An example TextString FOR_REGSUB /* Comment */"
}
labelframe $w.res -text "Preprocessing result" -padx 3 -pady 3
label $w.res.l3 -text "Example 1:" -anchor w
entry $w.res.e3 -textvariable ::diff($top,prefregexa) -width 60
label $w.res.l4 -text "Result 1:" -anchor w
label $w.res.e4 -textvariable ::diff($top,prefregresult) \
-anchor "w" -width 10
label $w.res.l5 -text "Example 2:" -anchor w
entry $w.res.e5 -textvariable ::diff($top,prefregexa2)
|
︙ | | | ︙ | |
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
|
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
} elseif {$nextArg eq "prefix"} {
set RE [string map [list % $arg] {^.*?\m(%\w*).*$}]
if {$Pref(nocase)} {
set RE "(?i)$RE"
}
set ::Pref(regsub) [list $RE {\1}]
}
set nextArg ""
continue
|
|
|
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
|
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
} elseif {$nextArg eq "prefix"} {
set RE [string map [list % $arg] {^.*?\m(%\w+).*$}]
if {$Pref(nocase)} {
set RE "(?i)$RE"
}
set ::Pref(regsub) [list $RE {\1}]
}
set nextArg ""
continue
|
︙ | | | ︙ | |