1 # vim: foldmarker=<<<,>>>
3 package require TLC-base
6 package require Itk
3.1
8 namespace import
-force ::itcl::*
9 namespace import
-force ::itk::*
11 package require blttable
12 namespace eval ::blt {
14 return [uplevel [list ::blttable::table] $args]
19 namespace eval ::tlc {
20 namespace eval ::blt {}
21 namespace eval ::blttable {namespace export
*}
23 variable version
0.98.0
26 [file normalize
[file join [pwd] [file dirname
[info script
]]]]
28 namespace import
::blt::*
29 if {[info commands
::blttable::table] != ""} {
30 catch {namespace import
::blttable::*}
34 lappend auto_path
[file join $::tlc::guilibrary scripts
]
36 if {[info exists tlc
::custom_theme_object]} {
37 set tlc
::theme $tlc::custom_theme_object ::#auto]
39 if {[info exists
::tlc_UserThemeOverride]} {
40 set tlc
::theme [tlc
::Daftheme ::#auto]
42 set tlc
::theme [tlc
::Theme ::#auto]
46 package provide TLC
$::tlc::version
50 bind Text
<Key-Tab
> {tk_focusNext %W
}
51 bind Text
<Shift-Key-Tab
> {tk_focusPrev %W
}
53 tlc
::Baseconfig tlc
::default_config -configfile ""
54 array set tlc
::config [tlc
::default_config dump_config
]
58 foreach {opt settingkey
} {
59 *activeBackground background
60 *highlightBackground highlightbackground
61 *highlightColor highlightcolor
65 *selectBorderWidth selectborderwidth
66 *selectBackground selectbackground
67 *selectForeground selectforeground
68 *Tabset
*selectBackground background
69 *textBackground textbackground
70 *Listbox.background textbackground
71 *disabledBackground disabledbackground
72 *Entry.disabledForeground disabledforeground
73 *Text.disabledForeground disabledforeground
74 *Text.TextHighlightBackground texthighlightbackground
76 *enabledBackground textbackground
77 *TreeView.background textbackground
78 *TreeView.borderwidth borderwidth
79 *TreeView.highlightThickness borderwidth
80 *Labelframe.
font boldfont
82 *Button.padY button_pady
83 *Form.padding formpadding
85 option add
$opt [$tlc::theme setting
$settingkey] startupFile
88 # Hacks. userdefault priority == 60
89 foreach {opt settingkey
} {
90 *Entry.background textbackground
91 *Entry.highlightBackground background
92 *TreeCtrl.background textbackground
94 option add
$opt [$tlc::theme setting
$settingkey] 61
97 switch -exact $tcl_platform(platform
) {
99 option add
*Scrollbar.width
12 startupFile
100 option add
*Scrollbar.borderWidth
1 startupFile
101 option add
*sbWidth
12 startupFile
102 option add
*scrollMargin
0 startupFile
103 option add
*elementBorderWidth
1 startupFile
104 option add
*textFont
[$tlc::theme setting
font] startupFile
105 option add
*Menu.
font [$tlc::theme setting boldfont
] startupFile
106 option add
*Menu.borderWidth
1 startupFile
109 option add
*Radiobutton.borderWidth
0 startupFile
110 option add
*Checkbutton.borderWidth
0 startupFile
111 option add
*Entry.highlightThickness
0 startupFile
116 namespace eval tlc
::Form {
118 set custom_types
(sql_lookup
) "tlc::form::Datavaultlookup"
122 proc set_theme
{name
} {
125 ttk
::style map TLabel
-foreground {invalid red
}
128 # Try to choose a reasonable default
130 switch -- [tk windowingsystem
] {
132 set try
[list xpnative winnative clam
]
136 set try
[list aqua clam
]
147 ::tlc::set_theme $try
149 #puts "Could not use theme: ($theme): $errmsg\n$::errorInfo"