tixmkpref
9.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
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
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
#!/usr/local/bin/tclsh
# Undocumented program. Don't use it.
#
# Usage:
#
# tixmkpref option name.src > name.tcl
#
proc tixDefOption {classes specs {level \$tixOption(prioLevel)}} {
global isFont tixOption
foreach class $classes {
foreach spec $specs {
if [regexp (Font)|(font) $spec] {
if {$isFont} {
puts "option add *$class$spec $level"
}
} else {
if {!$isFont} {
set aspec [subst $spec]
puts "option add *$class$spec $level"
}
}
}
}
}
proc option {classes specs {level \$tixOption(prioLevel)}} {
tixDefOption $classes $specs $level
}
proc tixInitOptionDatabase {strictTK} {
global tixOption isFont
# general stuff, everything gets these defaults unless otherwise specified
#-------------------------------------------------------------------------
tixDefOption {""} {{Font $tixOption(font)}}
tixDefOption {""} {{font $tixOption(font)}}
tixDefOption {""} {{background $tixOption(bg)}} 10
tixDefOption {""} {{Background $tixOption(bg)}}
tixDefOption {""} {{background $tixOption(bg)}}
tixDefOption {""} {{Foreground $tixOption(fg)}}
tixDefOption {""} {{foreground $tixOption(fg)}}
tixDefOption {""} {{activeBackground $tixOption(active_bg)}}
tixDefOption {""} {{activeForeground $tixOption(active_fg)}}
tixDefOption {""} {{HighlightBackground $tixOption(bg)}}
tixDefOption {""} {{selectBackground $tixOption(select_bg)}}
tixDefOption {""} {{selectForeground $tixOption(select_fg)}}
tixDefOption {""} {{selectBorderWidth 0}}
#----------------------------------------
# Standard TK Widget Options
#
# We set up the options for the TK widgets only if
# the strictTK option is not selected.
#----------------------------------------
tixDefOption {Menu TixMenu} {
{.font $tixOption(menu_font)}
{.selectColor $tixOption(selector)}
}
tixDefOption {Menubutton} {
{.font $tixOption(menu_font)}
{.padY 5}
}
tixDefOption {Button} {
{.borderWidth 2}
{.anchor c}
}
tixDefOption {Checkbutton Radiobutton} {
{.selectColor $tixOption(selector)}
}
tixDefOption {Entry} {
{.relief sunken}
{.highlightBackground $tixOption(bg)}
{.background $tixOption(input1_bg)}
{.foreground black}
{.insertBackground black}
}
tixDefOption {Label} {
{.anchor w}
{.borderWidth 0}
{.font $tixOption(bold_font)}
}
tixDefOption {Listbox} {
{.background $tixOption(light1_bg)}
{.relief sunken}
}
tixDefOption {Scale} {
{.foreground $tixOption(fg)}
{.activeForeground $tixOption(bg)}
{.background $tixOption(bg)}
{.sliderForeground $tixOption(bg)}
{.sliderBackground $tixOption(light1_bg)}
{.font $tixOption(italic_font)}
}
tixDefOption {Scrollbar} {
{.background $tixOption(bg)}
{.troughColor $tixOption(light1_bg)}
{.relief sunken}
{.borderWidth 1}
{.width 15}
}
tixDefOption {Text} {
{.background $tixOption(input1_bg)}
{.relief sunken}
}
#----------------------------------------------------------------------
# TIX WIDGETS
#----------------------------------------------------------------------
tixDefOption {TixBalloon} {
{*background #ffff60}
{*foreground black}
{.background black}
{*Label.font $tixOption(font)}
{*Label.anchor w}
}
tixDefOption {TixBitmapButton} {
{*label.font $tixOption(font)}
}
tixDefOption {TixControl} {
{*entry.highlightBackground $tixOption(bg)}
{*entry.background $tixOption(input1_bg)}
{*entry.foreground black}
{*entry.insertBackground black}
{*label.font $tixOption(bold_font)}
}
# DLG_BTNS
#
tixDefOption {TixStdButtonBox} {
}
# DIR_LIST
#
tixDefOption {TixDirTree TixDirList TixScrolledHList TixTree} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*hlist.highlightBackground $tixOption(bg)}
{*hlist.background $tixOption(light1_bg)}
{*hlist.activeBackground $tixOption(light1_bg)}
{*hlist.disabledBackground $tixOption(light1_bg)}
{*f1.borderWidth 1}
{*f1.relief sunken}
}
tixDefOption {TixFileEntry} {
{*Entry.background $tixOption(input1_bg)}
}
tixDefOption {TixHList} {
{.background $tixOption(light1_bg)}
{.activeBackground $tixOption(light1_bg)}
{.disabledBackground $tixOption(light1_bg)}
}
tixDefOption {TixLabelEntry} {
{*entry.highlightBackground $tixOption(bg)}
{*entry.background $tixOption(input1_bg)}
{*entry.foreground black}
{*entry.insertBackground black}
{*label.font $tixOption(bold_font)}
}
tixDefOption {TixLabelFrame} {
{*label.font $tixOption(bold_font)}
}
tixDefOption {TixMultiList} {
{*Listbox.borderWidth 0}
{*Listbox.highlightThickness 0}
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*Scrollbar.relief sunken}
{*Scrollbar.width 15}
{*f1.borderWidth 2}
{*f1.relief sunken}
{*f1.highlightThickness 2}
}
# MwmClient
#
tixDefOption {TixMwmClient} {
{*title.font $tixOption(menu_font)}
}
tixDefOption {TixMDIMenuBar} {
{*menubar.relief raised}
{*menubar.borderWidth 2}
{*Menubutton.padY 2}
}
# NoteBook
#
tixDefOption {TixNoteBook} {
{.Background $tixOption(bg)}
{.nbframe.Background $tixOption(bg)}
{.nbframe.font $tixOption(menu_font)}
{.nbframe.backPageColor $tixOption(bg)}
{.nbframe.inactiveBackground $tixOption(inactive_bg)}
}
# OPTION_MENU
#
tixDefOption {TixOptionMenu} {
{*menubutton.font $tixOption(font)}
}
# PANED_WINDOW
#
tixDefOption {TixPanedWindow} {
{.handleActiveBg $tixOption(active_bg)}
{.seperatorBg $tixOption(bg)}
{.handleBg $tixOption(dark1_bg)}
}
# POPUP MENU
#
tixDefOption {TixPopupMenu} {
{*menubutton.background $tixOption(dark1_bg)}
}
# SCROLLED_HLIST
#
tixDefOption {TixScrolledHList} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*hlist.highlightBackground $tixOption(bg)}
{*hlist.background $tixOption(light1_bg)}
}
tixDefOption {TixScrolledTList} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*tlist.highlightBackground $tixOption(bg)}
{*tlist.background $tixOption(light1_bg)}
}
# SCROLLED_LISTBOX, .. ETC
#
tixDefOption {TixScrolledListBox} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*listbox.highlightBackground $tixOption(bg)}
{*listbox.background $tixOption(light1_bg)}
}
tixDefOption {TixScrolledText} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
}
# SCROLLED_WINDOW
#
tixDefOption {TixScrolledWindow} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{.frame.background $tixOption(light1_bg)}
}
# SELECT
#
tixDefOption {TixSelect} {
}
tixDefOption {TixTree} {
{*Scrollbar.background $tixOption(bg)}
{*Scrollbar.troughColor $tixOption(light1_bg)}
{*hlist.highlightBackground $tixOption(bg)}
{*hlist.background $tixOption(light1_bg)}
{*hlist.borderWidth 1}
}
# NON ALPHABETICAL ORDER WIDGETS
# Since TK's option database follows the order-of-declaration rule, not
# specific-vs-general rule, the options of the widgets below depends on
# the options of the widget above, so their options must be defined here
# COMBOBOX
tixDefOption {TixComboBox} {
{*Entry.font $tixOption(font)}
{*Entry.highlightBackground $tixOption(bg)}
{*Entry.background $tixOption(input1_bg)}
{*Entry.foreground black}
{*Entry.insertBackground black}
}
# FILE_SELECT_BOX
#
tixDefOption {TixFileSelectBox} {
{*Label.font $tixOption(bold_font)}
}
tixDefOption {TixExFileSelectBox} {
}
}
#----------------------------------------------------------------------
# The default fontset and schemes
#
#----------------------------------------------------------------------
source ../DefSchm.tcl
rename tixSetDefaultFontset tixSetFontset
rename tixSetDefaultScheme-Color tixSetScheme-Color
rename tixSetDefaultScheme-Mono tixSetScheme-Mono
#----------------------------------------------------------------------
# Action:
#----------------------------------------------------------------------
if [string match TK* [lindex $argv 1]] {
set isTK 1
} else {
set isTK 0
}
set schemeName [lindex [split [lindex $argv 1] "."] 0]
source [lindex $argv 1]
tixSetFontset
if {[lindex $argv 0] == "-font"} {
set isFont 1
# FontSets will be set in two steps.
# (1) init fontsets
# ... tix checks the validity of the fonts ...
# (2) add the fontsets into the option database.
#
puts "proc tixPref:InitFontSet:$schemeName {} { "
puts [info body tixSetFontset]
puts "}"
puts "proc tixPref:SetFontSet:$schemeName {} { "
puts "global tixOption"
if {! $isTK} {
tixInitOptionDatabase 0
}
puts "}"
} else {
set isFont 0
# Do the Color First
#
puts "proc tixPref:SetScheme-Color:$schemeName {} {"
puts [info body tixSetScheme-Color]
if {! $isTK} {
tixSetScheme-Color
tixInitOptionDatabase 0
}
puts "}"
# Now Do the Mono
#
puts "proc tixPref:SetScheme-Mono:$schemeName {} {"
puts [info body tixSetScheme-Mono]
if {! $isTK} {
tixSetScheme-Mono
tixInitOptionDatabase 0
}
puts "}"
}