︙ | | | ︙ | |
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
|
# Which is enough to make it reasonable.
set bg [ttk::style configure . -background]
option add *Menubutton.background $bg
option add *Menu.background $bg
return $w
}
}
::snit::widgetadaptor entry {
delegate method * to hull
delegate option * to hull
constructor {args} {
installhull using ttk::entry
$self configurelist $args
# Make sure textvariable is initialised
set varName [from args -textvariable ""]
if {$varName ne ""} {
upvar \#0 $varName var
if {![info exists var]} {
set var ""
|
>
|
|
|
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# Which is enough to make it reasonable.
set bg [ttk::style configure . -background]
option add *Menubutton.background $bg
option add *Menu.background $bg
return $w
}
}
rename ttk::entry ttk::_entry
::snit::widgetadaptor ttk::entry {
delegate method * to hull
delegate option * to hull
constructor {args} {
installhull using ttk::_entry
$self configurelist $args
# Make sure textvariable is initialised
set varName [from args -textvariable ""]
if {$varName ne ""} {
upvar \#0 $varName var
if {![info exists var]} {
set var ""
|
︙ | | | ︙ | |
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
$hull xview [$hull index $ix]
} else {
eval $hull xview $args
}
}
}
::snit::widgetadaptor frame {
delegate method * to hull
# Fix since stuff that use -bd must work (like bgerror)
delegate option -bd to hull as -borderwidth
# Translate padding options, assuming x and y is always equal.
delegate option -padx to hull as -padding
delegate option -pady to hull as -padding
delegate option * to hull
constructor {args} {
set cl [from args -class ""]
if {$cl ne ""} {
set hullargs [list -class $cl]
} else {
set hullargs {}
}
eval installhull using ttk::frame $hullargs
$self configurelist $args
}
}
::snit::widgetadaptor labelframe {
delegate method * to hull
delegate option -bd to hull as -borderwidth
delegate option -padx to hull as -padding
delegate option -pady to hull as -padding
delegate option * to hull
constructor {args} {
installhull using ttk::labelframe
$self configurelist $args
}
}
::snit::widgetadaptor label {
delegate method * to hull
# Stop bitmap option as a temp workaround
option -bitmap
delegate option * to hull
constructor {args} {
installhull using ttk::label
$self configurelist $args
}
}
#interp alias {} frame {} ttk::frame
interp alias {} toplevel {} ttk::toplevel
#interp alias {} labelframe {} ttk::labelframe
#interp alias {} label {} ttk::label
#interp alias {} entry {} ttk::entry ;# need to support xview end
interp alias {} radiobutton {} ttk::radiobutton
#interp alias {} menubutton {} ttk::menubutton ;# Enough with bg set
interp alias {} checkbutton {} ttk::checkbutton
interp alias {} button {} ttk::button
package require wcb
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
|
$hull xview [$hull index $ix]
} else {
eval $hull xview $args
}
}
}
interp alias {} toplevel {} ttk::toplevel
package require wcb
if {[catch {package require psballoon}]} {
# Add a dummy if it does not exist.
proc addBalloon {args} {}
} else {
|
︙ | | | ︙ | |
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
|
set scrolly 1
}
default {
return -code error "Bad scrolldirection \"$dir\""
}
}
frame $w
eval [list $class $w.s] $args
# Move border properties to frame
set bw [$w.s cget -borderwidth]
set relief [$w.s cget -relief]
$w configure -relief $relief -borderwidth $bw
$w.s configure -borderwidth 0
|
|
|
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
|
set scrolly 1
}
default {
return -code error "Bad scrolldirection \"$dir\""
}
}
ttk::frame $w
eval [list $class $w.s] $args
# Move border properties to frame
set bw [$w.s cget -borderwidth]
set relief [$w.s cget -relief]
$w configure -relief $relief -borderwidth $bw
$w.s configure -borderwidth 0
|
︙ | | | ︙ | |
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
|
proc widgetadaptor {args} {}
}
}
# Emulate a label that:
# 1 : Displays the right part of the text if there isn't enough room
# 2 : Justfify text to the left if there is enough room.
# 3 : Does not try to allocate space according to its contents
::snit::widgetadaptor FileLabel {
delegate method * to hull
delegate option * to hull
constructor {args} {
eval label $self $args
set fg [$self cget -foreground]
set bg [$self cget -background]
set font [$self cget -font]
destroy $self
installhull [entry $self -relief flat -bd 0 -highlightthickness 0 \
-foreground $fg -background $bg -font $font]
$self configurelist $args
$self configure -takefocus 0 -state readonly -readonlybackground $bg
set var [$self cget -textvariable]
if {$var != ""} {
uplevel \#0 "[list trace variable $var w] \
{[list after idle [mymethod xview end]] ;#}"
}
}
}
# Emulate a label that:
# 1 : Displays the right part of the text if there isn't enough room
# 2 : Justfify text to the left if there is enough room.
# 3 : Does not try to allocate space according to its contents
proc fileLabel {w args} {
entry $w -style TLabel
eval $w configure $args
$w configure -takefocus 0 -state readonly ;#-readonlybackground $bg
set i [lsearch $args -textvariable]
if {$i >= 0} {
set var [lindex $args [expr {$i + 1}]]
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
|
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
|
proc widgetadaptor {args} {}
}
}
# Emulate a label that:
# 1 : Displays the right part of the text if there isn't enough room
# 2 : Justfify text to the left if there is enough room.
# 3 : Does not try to allocate space according to its contents
proc fileLabel {w args} {
ttk::entry $w -style TLabel
eval $w configure $args
$w configure -takefocus 0 -state readonly ;#-readonlybackground $bg
set i [lsearch $args -textvariable]
if {$i >= 0} {
set var [lindex $args [expr {$i + 1}]]
|
︙ | | | ︙ | |
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
|
toplevel $top
lappend ::diff(diffWindows) $top
}
wm title $top "Eskil:"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
frame $top.f
grid $top.f -row 0 -columnspan 4 -sticky nws
lappend ::widgets(toolbars) $top.f
if {!$::Pref(toolbar)} {
grid remove $top.f
}
if {$tcl_platform(platform) eq "windows"} {
|
|
|
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
|
toplevel $top
lappend ::diff(diffWindows) $top
}
wm title $top "Eskil:"
wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top]
ttk::frame $top.f
grid $top.f -row 0 -columnspan 4 -sticky nws
lappend ::widgets(toolbars) $top.f
if {!$::Pref(toolbar)} {
grid remove $top.f
}
if {$tcl_platform(platform) eq "windows"} {
|
︙ | | | ︙ | |
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
|
-command [list makeDocWin $file] -underline 0
}
$top.m.help add separator
$top.m.help add command -label "About" -command makeAboutWin -underline 0
ttk::label $top.lr1 -text "Rev 1"
addBalloon $top.lr1 "Revision number for CVS/RCS/ClearCase diff."
entry $top.er1 -width 12 -textvariable diff($top,doptrev1)
set ::widgets($top,rev1) $top.er1
ttk::label $top.lr2 -text "Rev 2"
addBalloon $top.lr2 "Revision number for CVS/RCS/ClearCase diff."
entry $top.er2 -width 12 -textvariable diff($top,doptrev2)
set ::widgets($top,rev2) $top.er2
button $top.bcm -text Commit -command [list revCommit $top] \
-state disabled -underline 0
set ::widgets($top,commit) $top.bcm
button $top.bfp -text "Prev Diff" \
-command [list findDiff $top -1] \
-underline 0
button $top.bfn -text "Next Diff" \
-command [list findDiff $top 1] \
-underline 0
bind $top <Alt-n> [list findDiff $top 1]
bind $top <Alt-p> [list findDiff $top -1]
bind $top <Alt-c> [list revCommit $top]
catch {font delete myfont}
font create myfont -family $Pref(fontfamily) -size $Pref(fontsize)
fileLabel $top.l1 -textvariable diff($top,leftLabel)
fileLabel $top.l2 -textvariable diff($top,rightLabel)
frame $top.ft1 -borderwidth 2 -relief sunken
text $top.ft1.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft1.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx1 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
catch {$top.ft1.tt configure -tabstyle wordprocessor} ;# 8.5
tk::frame $top.ft1.f -width 2 -height 2 -bg lightgray
pack $top.ft1.tl -side left -fill y
pack $top.ft1.f -side left -fill y
pack $top.ft1.tt -side right -fill both -expand 1
scrollbar $top.sby -orient vertical
scrollbar $top.sbx1 -orient horizontal -command [list $top.ft1.tt xview]
set ::widgets($top,wLine1) $top.ft1.tl
set ::widgets($top,wDiff1) $top.ft1.tt
frame $top.ft2 -borderwidth 2 -relief sunken
text $top.ft2.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft2.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx2 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
|
|
|
|
|
|
|
|
|
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
|
-command [list makeDocWin $file] -underline 0
}
$top.m.help add separator
$top.m.help add command -label "About" -command makeAboutWin -underline 0
ttk::label $top.lr1 -text "Rev 1"
addBalloon $top.lr1 "Revision number for CVS/RCS/ClearCase diff."
ttk::entry $top.er1 -width 12 -textvariable diff($top,doptrev1)
set ::widgets($top,rev1) $top.er1
ttk::label $top.lr2 -text "Rev 2"
addBalloon $top.lr2 "Revision number for CVS/RCS/ClearCase diff."
ttk::entry $top.er2 -width 12 -textvariable diff($top,doptrev2)
set ::widgets($top,rev2) $top.er2
ttk::button $top.bcm -text Commit -command [list revCommit $top] \
-state disabled -underline 0
set ::widgets($top,commit) $top.bcm
ttk::button $top.bfp -text "Prev Diff" \
-command [list findDiff $top -1] \
-underline 0
ttk::button $top.bfn -text "Next Diff" \
-command [list findDiff $top 1] \
-underline 0
bind $top <Alt-n> [list findDiff $top 1]
bind $top <Alt-p> [list findDiff $top -1]
bind $top <Alt-c> [list revCommit $top]
catch {font delete myfont}
font create myfont -family $Pref(fontfamily) -size $Pref(fontsize)
fileLabel $top.l1 -textvariable diff($top,leftLabel)
fileLabel $top.l2 -textvariable diff($top,rightLabel)
ttk::frame $top.ft1 -borderwidth 2 -relief sunken
text $top.ft1.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft1.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx1 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
catch {$top.ft1.tt configure -tabstyle wordprocessor} ;# 8.5
tk::frame $top.ft1.f -width 2 -height 2 -bg lightgray
pack $top.ft1.tl -side left -fill y
pack $top.ft1.f -side left -fill y
pack $top.ft1.tt -side right -fill both -expand 1
scrollbar $top.sby -orient vertical
scrollbar $top.sbx1 -orient horizontal -command [list $top.ft1.tt xview]
set ::widgets($top,wLine1) $top.ft1.tl
set ::widgets($top,wDiff1) $top.ft1.tt
ttk::frame $top.ft2 -borderwidth 2 -relief sunken
text $top.ft2.tl -height $Pref(lines) -width 5 -wrap none \
-font myfont -borderwidth 0 -padx 0 -highlightthickness 0 \
-takefocus 0
text $top.ft2.tt -height $Pref(lines) -width $Pref(linewidth) -wrap none \
-xscrollcommand [list $top.sbx2 set] \
-font myfont -borderwidth 0 -padx 1 \
-highlightthickness 0
|
︙ | | | ︙ | |
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
|
array set TmpPref [array get Pref]
destroy .pr
toplevel .pr
wm title .pr "Eskil Preferences"
frame .pr.fc -borderwidth 1 -relief solid
ttk::label .pr.fc.l1 -text "Colours" -anchor w
ttk::label .pr.fc.l2 -text "Text" -anchor w
ttk::label .pr.fc.l3 -text "Background" -anchor w
entry .pr.fc.e1 -textvariable "TmpPref(colorchange)" -width 10
entry .pr.fc.e2 -textvariable "TmpPref(colornew1)" -width 10
entry .pr.fc.e3 -textvariable "TmpPref(colornew2)" -width 10
button .pr.fc.b1 -text "Sel" -command "selColor colorchange"
button .pr.fc.b2 -text "Sel" -command "selColor colornew1"
button .pr.fc.b3 -text "Sel" -command "selColor colornew2"
entry .pr.fc.e4 -textvariable "TmpPref(bgchange)" -width 10
entry .pr.fc.e5 -textvariable "TmpPref(bgnew1)" -width 10
entry .pr.fc.e6 -textvariable "TmpPref(bgnew2)" -width 10
button .pr.fc.b4 -text "Sel" -command "selColor bgchange"
button .pr.fc.b5 -text "Sel" -command "selColor bgnew1"
button .pr.fc.b6 -text "Sel" -command "selColor bgnew2"
text .pr.fc.t1 -width 12 -height 1 -font myfont -takefocus 0
text .pr.fc.t2 -width 12 -height 1 -font myfont -takefocus 0
text .pr.fc.t3 -width 12 -height 1 -font myfont -takefocus 0
.pr.fc.t1 tag configure change -foreground $TmpPref(colorchange) \
-background $TmpPref(bgchange)
.pr.fc.t2 tag configure new1 -foreground $TmpPref(colornew1) \
-background $TmpPref(bgnew1)
.pr.fc.t3 tag configure new2 -foreground $TmpPref(colornew2) \
-background $TmpPref(bgnew2)
.pr.fc.t1 insert end "Changed text" change
.pr.fc.t2 insert end "Deleted text" new1
.pr.fc.t3 insert end "Added text" new2
.pr.fc.t1 configure -state disabled
.pr.fc.t2 configure -state disabled
.pr.fc.t3 configure -state disabled
button .pr.b1 -text "Apply" -command applyPref
button .pr.b2 -text "Test" -command testColor
button .pr.b3 -text "Close" -command {destroy .pr}
grid .pr.fc.l1 .pr.fc.l2 x .pr.fc.l3 x -row 0 -sticky ew -padx 1 -pady 1
grid .pr.fc.t1 .pr.fc.e1 .pr.fc.b1 .pr.fc.e4 .pr.fc.b4 -row 1 \
-sticky nsew -padx 1 -pady 1
grid .pr.fc.t2 .pr.fc.e2 .pr.fc.b2 .pr.fc.e5 .pr.fc.b5 -row 2 \
-sticky nsew -padx 1 -pady 1
grid .pr.fc.t3 .pr.fc.e3 .pr.fc.b3 .pr.fc.e6 .pr.fc.b6 -row 3 \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
|
array set TmpPref [array get Pref]
destroy .pr
toplevel .pr
wm title .pr "Eskil Preferences"
ttk::frame .pr.fc -borderwidth 1 -relief solid
ttk::label .pr.fc.l1 -text "Colours" -anchor w
ttk::label .pr.fc.l2 -text "Text" -anchor w
ttk::label .pr.fc.l3 -text "Background" -anchor w
ttk::entry .pr.fc.e1 -textvariable "TmpPref(colorchange)" -width 10
ttk::entry .pr.fc.e2 -textvariable "TmpPref(colornew1)" -width 10
ttk::entry .pr.fc.e3 -textvariable "TmpPref(colornew2)" -width 10
ttk::button .pr.fc.b1 -text "Sel" -command "selColor colorchange"
ttk::button .pr.fc.b2 -text "Sel" -command "selColor colornew1"
ttk::button .pr.fc.b3 -text "Sel" -command "selColor colornew2"
ttk::entry .pr.fc.e4 -textvariable "TmpPref(bgchange)" -width 10
ttk::entry .pr.fc.e5 -textvariable "TmpPref(bgnew1)" -width 10
ttk::entry .pr.fc.e6 -textvariable "TmpPref(bgnew2)" -width 10
ttk::button .pr.fc.b4 -text "Sel" -command "selColor bgchange"
ttk::button .pr.fc.b5 -text "Sel" -command "selColor bgnew1"
ttk::button .pr.fc.b6 -text "Sel" -command "selColor bgnew2"
text .pr.fc.t1 -width 12 -height 1 -font myfont -takefocus 0
text .pr.fc.t2 -width 12 -height 1 -font myfont -takefocus 0
text .pr.fc.t3 -width 12 -height 1 -font myfont -takefocus 0
.pr.fc.t1 tag configure change -foreground $TmpPref(colorchange) \
-background $TmpPref(bgchange)
.pr.fc.t2 tag configure new1 -foreground $TmpPref(colornew1) \
-background $TmpPref(bgnew1)
.pr.fc.t3 tag configure new2 -foreground $TmpPref(colornew2) \
-background $TmpPref(bgnew2)
.pr.fc.t1 insert end "Changed text" change
.pr.fc.t2 insert end "Deleted text" new1
.pr.fc.t3 insert end "Added text" new2
.pr.fc.t1 configure -state disabled
.pr.fc.t2 configure -state disabled
.pr.fc.t3 configure -state disabled
ttk::button .pr.b1 -text "Apply" -command applyPref
ttk::button .pr.b2 -text "Test" -command testColor
ttk::button .pr.b3 -text "Close" -command {destroy .pr}
grid .pr.fc.l1 .pr.fc.l2 x .pr.fc.l3 x -row 0 -sticky ew -padx 1 -pady 1
grid .pr.fc.t1 .pr.fc.e1 .pr.fc.b1 .pr.fc.e4 .pr.fc.b4 -row 1 \
-sticky nsew -padx 1 -pady 1
grid .pr.fc.t2 .pr.fc.e2 .pr.fc.b2 .pr.fc.e5 .pr.fc.b5 -row 2 \
-sticky nsew -padx 1 -pady 1
grid .pr.fc.t3 .pr.fc.e3 .pr.fc.b3 .pr.fc.e6 .pr.fc.b6 -row 3 \
|
︙ | | | ︙ | |
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
|
pack .fo.ltmp -padx {10 50} -pady {10 50}
update
catch {font delete tmpfont}
font create tmpfont
array set TmpPref [array get Pref]
labelframe .fo.lf -text "Family" -padx 3 -pady 3
set lb [Scroll y listbox .fo.lf.lb -width 15 -height 10 \
-exportselection no -selectmode single]
bind $lb <<ListboxSelect>> [list exampleFont $lb]
pack .fo.lf.lb -fill both -expand 1
labelframe .fo.ls -text "Size" -padx 3 -pady 3
spinbox .fo.ls.sp -from 1 -to 30 -increment 1 -width 3 -state readonly \
-textvariable TmpPref(fontsize) -command [list exampleFont $lb]
pack .fo.ls.sp -fill both -expand 1
ttk::label .fo.le -text "Example\n0Ooi1Il" -anchor w -font tmpfont \
-width 1 -justify left
if {![info exists ::diff(fixedfont)]} {set ::diff(fixedfont) 1}
checkbutton .fo.cb -text "Fixed" -variable ::diff(fixedfont) \
-command [list UpdateFontBox $lb]
button .fo.bo -text "Ok" -command "applyFont $lb ; destroy .fo"
button .fo.ba -text "Apply" -command "applyFont $lb"
button .fo.bc -text "Close" -command "destroy .fo"
if {![info exists FontCache]} {
set fam [lsort -dictionary [font families]]
font create testfont
foreach f $fam {
if {![string equal $f ""]} {
font configure testfont -family $f
|
|
|
|
|
|
|
|
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
|
pack .fo.ltmp -padx {10 50} -pady {10 50}
update
catch {font delete tmpfont}
font create tmpfont
array set TmpPref [array get Pref]
ttk::labelframe .fo.lf -text "Family" -padding 3
set lb [Scroll y listbox .fo.lf.lb -width 15 -height 10 \
-exportselection no -selectmode single]
bind $lb <<ListboxSelect>> [list exampleFont $lb]
pack .fo.lf.lb -fill both -expand 1
ttk::labelframe .fo.ls -text "Size" -padding 3
spinbox .fo.ls.sp -from 1 -to 30 -increment 1 -width 3 -state readonly \
-textvariable TmpPref(fontsize) -command [list exampleFont $lb]
pack .fo.ls.sp -fill both -expand 1
ttk::label .fo.le -text "Example\n0Ooi1Il" -anchor w -font tmpfont \
-width 1 -justify left
if {![info exists ::diff(fixedfont)]} {set ::diff(fixedfont) 1}
ttk::checkbutton .fo.cb -text "Fixed" -variable ::diff(fixedfont) \
-command [list UpdateFontBox $lb]
ttk::button .fo.bo -text "Ok" -command "applyFont $lb ; destroy .fo"
ttk::button .fo.ba -text "Apply" -command "applyFont $lb"
ttk::button .fo.bc -text "Close" -command "destroy .fo"
if {![info exists FontCache]} {
set fam [lsort -dictionary [font families]]
font create testfont
foreach f $fam {
if {![string equal $f ""]} {
font configure testfont -family $f
|
︙ | | | ︙ | |
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
|
$ok configure -state normal
}
proc AddPrefRegsub {top parent} {
for {set t 1} {[winfo exists $parent.fr$t]} {incr t} {
#Empty
}
set w [frame $parent.fr$t -bd 2 -relief groove -padx 3 -pady 3]
ttk::label $w.l1 -text "Regexp:" -anchor "w"
entry $w.e1 -textvariable ::diff($top,prefregexp$t) -width 60
ttk::label $w.l2 -text "Subst:" -anchor "w"
entry $w.e2 -textvariable ::diff($top,prefregsub$t)
grid $w.l1 $w.e1 -sticky we -padx 3 -pady 3
grid $w.l2 $w.e2 -sticky we -padx 3 -pady 3
grid columnconfigure $w 1 -weight 1
pack $w -side "top" -fill x -padx 3 -pady 3
|
|
|
|
|
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
|
$ok configure -state normal
}
proc AddPrefRegsub {top parent} {
for {set t 1} {[winfo exists $parent.fr$t]} {incr t} {
#Empty
}
set w [ttk::frame $parent.fr$t -borderwidth 2 -relief groove -padding 3]
ttk::label $w.l1 -text "Regexp:" -anchor "w"
ttk::entry $w.e1 -textvariable ::diff($top,prefregexp$t) -width 60
ttk::label $w.l2 -text "Subst:" -anchor "w"
ttk::entry $w.e2 -textvariable ::diff($top,prefregsub$t)
grid $w.l1 $w.e1 -sticky we -padx 3 -pady 3
grid $w.l2 $w.e2 -sticky we -padx 3 -pady 3
grid columnconfigure $w 1 -weight 1
pack $w -side "top" -fill x -padx 3 -pady 3
|
︙ | | | ︙ | |
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
|
raise $w
focus $w
} else {
toplevel $w -padx 3 -pady 3
wm title $w "Preferences: Preprocess"
}
button $w.b -text "Add" -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
ttk::label $w.res.l3 -text "Example 1:" -anchor "w"
entry $w.res.e3 -textvariable ::diff($top,prefregexa) -width 60
ttk::label $w.res.l4 -text "Result 1:" -anchor "w"
ttk::label $w.res.e4 -textvariable ::diff($top,prefregresult) \
-anchor "w" -width 10
ttk::label $w.res.l5 -text "Example 2:" -anchor "w"
entry $w.res.e5 -textvariable ::diff($top,prefregexa2)
ttk::label $w.res.l6 -text "Result 2:" -anchor "w"
ttk::label $w.res.e6 -textvariable ::diff($top,prefregresult2) \
-anchor "w" -width 10
grid $w.res.l3 $w.res.e3 -sticky we -padx 3 -pady 3
grid $w.res.l4 $w.res.e4 -sticky we -padx 3 -pady 3
grid $w.res.l5 $w.res.e5 -sticky we -padx 3 -pady 3
grid $w.res.l6 $w.res.e6 -sticky we -padx 3 -pady 3
grid columnconfigure $w.res 1 -weight 1
# Buttons
frame $w.fb -padx 3 -pady 3
button $w.fb.b1 -text "Ok" -command [list EditPrefRegsubOk $top $w]
button $w.fb.b2 -text "Cancel" -command [list destroy $w]
set ::widgets($top,prefRegsubOk) $w.fb.b1
grid $w.fb.b1 x $w.fb.b2 -sticky we
grid columnconfigure $w.fb {0 2} -uniform a
grid columnconfigure $w.fb 1 -weight 1
# Top layout
|
|
|
|
|
|
|
|
|
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
|
raise $w
focus $w
} else {
toplevel $w -padx 3 -pady 3
wm title $w "Preferences: Preprocess"
}
ttk::button $w.b -text "Add" -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 */"
}
ttk::labelframe $w.res -text "Preprocessing result" -padding 3
ttk::label $w.res.l3 -text "Example 1:" -anchor "w"
ttk::entry $w.res.e3 -textvariable ::diff($top,prefregexa) -width 60
ttk::label $w.res.l4 -text "Result 1:" -anchor "w"
ttk::label $w.res.e4 -textvariable ::diff($top,prefregresult) \
-anchor "w" -width 10
ttk::label $w.res.l5 -text "Example 2:" -anchor "w"
ttk::entry $w.res.e5 -textvariable ::diff($top,prefregexa2)
ttk::label $w.res.l6 -text "Result 2:" -anchor "w"
ttk::label $w.res.e6 -textvariable ::diff($top,prefregresult2) \
-anchor "w" -width 10
grid $w.res.l3 $w.res.e3 -sticky we -padx 3 -pady 3
grid $w.res.l4 $w.res.e4 -sticky we -padx 3 -pady 3
grid $w.res.l5 $w.res.e5 -sticky we -padx 3 -pady 3
grid $w.res.l6 $w.res.e6 -sticky we -padx 3 -pady 3
grid columnconfigure $w.res 1 -weight 1
# Buttons
ttk::frame $w.fb -padding 3
ttk::button $w.fb.b1 -text "Ok" -command [list EditPrefRegsubOk $top $w]
ttk::button $w.fb.b2 -text "Cancel" -command [list destroy $w]
set ::widgets($top,prefRegsubOk) $w.fb.b1
grid $w.fb.b1 x $w.fb.b2 -sticky we
grid columnconfigure $w.fb {0 2} -uniform a
grid columnconfigure $w.fb 1 -weight 1
# Top layout
|
︙ | | | ︙ | |
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
|
# Directory diff options
set Pref(dir,comparelevel) 1
set Pref(dir,ignorekey) 0
set Pref(dir,incfiles) ""
set Pref(dir,exfiles) "*.o"
set Pref(dir,incdirs) ""
set Pref(dir,exdirs) "RCS CVS .git .svn"
set Pref(dir,onlyrev) 0
# Backward compatibilty option
set Pref(onlydiffs) -1
set ::diff(filter) ""
|
|
|
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
|
# Directory diff options
set Pref(dir,comparelevel) 1
set Pref(dir,ignorekey) 0
set Pref(dir,incfiles) ""
set Pref(dir,exfiles) "*.o"
set Pref(dir,incdirs) ""
set Pref(dir,exdirs) "RCS CVS .git .svn .hg"
set Pref(dir,onlyrev) 0
# Backward compatibilty option
set Pref(onlydiffs) -1
set ::diff(filter) ""
|
︙ | | | ︙ | |