/
tksqlite.tcl
15265 lines (13632 loc) · 454 KB
/
tksqlite.tcl
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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/bin/sh
# vim: set ts=4 fdm=marker fmr=<<<,>>> cms=;#%s noexpandtab:
# the next line restarts using wish \
exec wish "$0" ${1+"$@"}
#######################################################################
#
# TkSQLite
#
# TkSQLite is a database manager for SQLite implemented by Tcl/Tk.
# It can manage SQLite2 and SQLite3 database. And it can treat many
# encodings like Shift-JIS, EUC-JP and Windows native milti-byte
# encodings not only UTF-8. And it can run on Windows and Linux
# and MacOSX as native Look & Feel. And it's Freeware.
#
#######################################################################
# ;#<<<
#
# Requirement
# ---------------------------------------------------------------------
# Tcl/Tk 8.4+
# tclsqlite or|and tclsqlite3
# Tktable
# Tile 0.7+
# Treectrl 2.1+
# Dict 8.5.1+
#
# optionnal packages:
# Trf
# Tcllib
# tkImg
#
# License
# ---------------------------------------------------------------------
set COPYRIGHT {
Copyright (c) 2004 - 2015 OHTSUKA, Yoshio
This program is free to use, modify, extend at will. The author(s)
provides no warranties, guarantees or any responsibility for usage.
Redistributions in any form must retain this copyright notice.
ohtsuka.yoshio@gmail.com
}
#
# How to use
# ---------------------------------------------------------------------
# see
# http://reddog.s35.xrea.com/wiki/TkSQLite.html
#
# ChangeLog
# ---------------------------------------------------------------------
# 2004-01-14 First Release.
# 2004-03-17 Sort table tree.
# 2004-08-12 Add encoding menu.
# 2005-05-13 Support sqlite3 and not sqlite2
# 2005-11-04 Version 0.2
# * Support both SQLite2 and SQLite3.
# * Support reading/writing data as any encoding that Tcl can use.
# * Support attach database and temp table.
# * Use Tk Theme Engine instead of BWidget.
# * Improve TkTable behabior.
# * Highlighting SQL command syntax.
# * Release English version.
# * Fix many bugs & Refactored.
# 2005-12-04 Version 0.3
# * Create Table Dialog, Create Index Dialog and Preference Dialog.
# * Improve Look & Feel.
# * Sort Grid Table command.
# * Search Dialog for Grid Table.
# * Add Option of Vi like keybind for Grid Table.
# * Attack/Detach db menu.
# * Import/Export SQL and CSV(or Tab)
# * Add many db functions(regexp, regsub, md5 etc).
# 2006-08-04 Version 0.4
# * Require dict, Trf, tablelist and tkImg packages.
# * Improve Keyword Highlight.
# * Improve Preference, CreateTable and CreateIndex Dialogs.
# * Add 3.x compatible format option.
# * Add Cache size Dialog.
# * Add DataEditor Dialog.
# * Enable to change table schema.
# * Enable to view images in column.(the format is depended on tkImg)
# * Speed up base64 encode/decode.
# * New user function compress, decompress, read_file, write_file
# * Add binary mode on crypt user function (md5, base64_encode, etc)
# 2007-07-04 Version 0.5
# * Require tktreectrl2.1+.
# * Not Require tablelist.
# * Add CreateTrigger Dialog.
# * New message dialog (avoided to use ttk::dialog).
# * Add new file selection dialog (http://wiki.tcl.tk/15897).
# * Improved widgets L&F on WindowsXP at tile0.8.
# * Enable to load loadable extension and user tcl script.
# * Enable to create UTF-16le, UTF-16be database.
#
# Known Probrem
# ---------------------------------------------------------------------
# - If alter table command was used to view, we would lost the view.
# But don't worry. The view was not dropped. Please re-open or use
# vacuum command. Then we would be able to find the view again.
# This is sqlite probrem.
#
# - If there were same named tables in attached or temp database,
# a column infomation of the table was not got correctly. This
# probrem would be occured on attached/temp table on sqlite2 and
# temp table on sqlite3.
# We get column infomation from 'pragma table_info' command,
# but the command of sqlite2 doesn't have a way to distinguish
# between a table and an attached same named another table.
# TODO:we must parse create statement ourself..?
# See also:
# http://www.sqlite.org/cvstrac/tktview?tn=1308
#
# - If database had a trigger, grid table edit does not update the updated
# rows by the trigger. Grid Table editor update only one row. So if
# the trigger updated some rows in the editing table, we must update
# the table by hand.(Press F5 or Press u in vi mode)
#
# - On Linux all tk widgets disallow keyboard input, if encoding system
# is unicode.
#;#>>>
set VERSION 0.9.25
package require Tk 8.4
package require Tktable
if {[info tclversion] < 8.5} {
package require dict
}
package require treectrl 2.1
set tile_version [package require tile 0.7]
if {[join [lrange [split $tile_version .] 0 1] .] >= 0.8} {
set tile_ns ttk
# In tk8.5a6, style command is not imported yet.
# But the cmd is already imported tile0.8(tk8.4).
# so we need catch it.
catch {namespace import ttk::style}
} else {
set tile_ns tile
}
if {$tcl_platform(platform) ne "windows"} {
${tile_ns}::setTheme clam
}
# here is for debug
;#${tile_ns}::setTheme clam
;#${tile_ns}::setTheme default
set tile_currentTheme [set ${tile_ns}::currentTheme]
#
# Base64
#
if {[catch {package require Trf}]} {
# base64.tcl --
#
# Encode/Decode base64 for a string
# Stephen Uhler / Brent Welch (c) 1997 Sun Microsystems
# The decoder was done for exmh by Chris Garrigues
#
# Copyright (c) 1998-2000 by Ajuba Solutions.
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
# RCS: @(#) $Id: base64.tcl 182 2006-07-24 09:20:41Z ir004961 $
#package provide base64 2.3.2
package require Tcl 8.4
namespace eval ::base64 {
namespace export encode decode
}
namespace eval base64 {
variable base64 {}
variable base64_en {}
set i 0
foreach char {A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \
a b c d e f g h i j k l m n o p q r s t u v w x y z \
0 1 2 3 4 5 6 7 8 9 + /} {
set base64_tmp($char) $i
lappend base64_en $char
incr i
}
scan z %c len
for {set i 0} {$i <= $len} {incr i} {
set char [format %c $i]
set val {}
if {[info exists base64_tmp($char)]} {
set val $base64_tmp($char)
} else {
set val {}
}
lappend base64 $val
}
scan = %c i
set base64 [lreplace $base64 $i $i -1]
unset base64_tmp i char len val
namespace export encode decode
}
proc ::base64::encode {args} {
set base64_en $::base64::base64_en
set wrapchar "\n"
set maxlen 60
if { [llength $args] == 0 } {
error "wrong # args: should be \"[lindex [info level 0] 0]\
?-maxlen maxlen? ?-wrapchar wrapchar? string\""
}
set optionStrings [list "-maxlen" "-wrapchar"]
for {set i 0} {$i < [llength $args] - 1} {incr i} {
set arg [lindex $args $i]
set index [lsearch -glob $optionStrings "${arg}*"]
if { $index == -1 } {
error "unknown option \"$arg\": must be -maxlen or -wrapchar"
}
incr i
if { $i >= [llength $args] - 1 } {
error "value for \"$arg\" missing"
}
set val [lindex $args $i]
set [string range [lindex $optionStrings $index] 1 end] $val
}
if {[catch {expr {$maxlen % 2}}]} {
error "expected integer but got \"$maxlen\""
}
set string [lindex $args end]
set result {}
set state 0
set length 0
binary scan $string c* X
foreach {x y z} $X {
if {$maxlen && $length >= $maxlen} {
append result $wrapchar
set length 0
}
append result [lindex $base64_en [expr {($x >>2) & 0x3F}]]
if {$y != {}} {
append result [lindex $base64_en [expr {(($x << 4) & 0x30) | (($y >> 4) & 0xF)}]]
if {$z != {}} {
append result \
[lindex $base64_en [expr {(($y << 2) & 0x3C) | (($z >> 6) & 0x3)}]]
append result [lindex $base64_en [expr {($z & 0x3F)}]]
} else {
set state 2
break
}
} else {
set state 1
break
}
incr length 4
}
if {$state == 1} {
append result [lindex $base64_en [expr {(($x << 4) & 0x30)}]]==
} elseif {$state == 2} {
append result [lindex $base64_en [expr {(($y << 2) & 0x3C)}]]=
}
return $result
}
proc ::base64::decode {string} {
if {[string length $string] == 0} {return ""}
set base64 $::base64::base64
set output "" ; # Fix for [Bug 821126]
binary scan $string c* X
foreach x $X {
set bits [lindex $base64 $x]
if {$bits >= 0} {
if {[llength [lappend nums $bits]] == 4} {
foreach {v w z y} $nums break
set a [expr {($v << 2) | ($w >> 4)}]
set b [expr {(($w & 0xF) << 4) | ($z >> 2)}]
set c [expr {(($z & 0x3) << 6) | $y}]
append output [binary format ccc $a $b $c]
set nums {}
}
} elseif {$bits == -1} {
foreach {v w z} $nums break
set a [expr {($v << 2) | (($w & 0x30) >> 4)}]
if {$z == {}} {
append output [binary format c $a ]
} else {
set b [expr {(($w & 0xF) << 4) | (($z & 0x3C) >> 2)}]
append output [binary format cc $a $b]
}
break
} else {
continue
}
}
return $output
}
proc ::base64 {args} {
set len [llength $args]
for {set i 0} {$i < $len} {incr i} {
switch -exact -- [lindex $args $i] {
-mode {
incr i
switch -exact -- [lindex $args $i] {
encode {set mode encode}
decode {set mode decode}
}
}
-- {
incr i
set data [lindex $args $i]
}
}
}
switch -exact -- $mode {
encode { return [::base64::encode $data] }
decode { return [::base64::decode $data] }
default {error}
}
}
}
#
# Locale Strings
#
package require msgcat
::msgcat::mcmset ja {
{OK} "OK"
{Cancel} "\u30ad\u30e3\u30f3\u30bb\u30eb"
{Yes} "\u306f\u3044"
{No} "\u3044\u3044\u3048"
{Retry} "\u518d\u8a66\u884c"
{Add} "\u8ffd\u52a0"
{Remove} "\u524a\u9664"
{Config} "\u8a2d\u5b9a"
{Configure} "\u8a2d\u5b9a"
{Table} "\u30c6\u30fc\u30d6\u30eb"
{View} "\u30d3\u30e5\u30fc"
{Index} "\u30a4\u30f3\u30c7\u30c3\u30af\u30b9"
{Trigger} "\u30c8\u30ea\u30ac\u30fc"
{Event} "\u30a4\u30d9\u30f3\u30c8"
{Result} "\u5b9f\u884c\u7d50\u679c"
{Edit} "\u7de8\u96c6"
{Editable} "\u7de8\u96c6\u53ef"
{Not Editable} "\u7de8\u96c6\u4e0d\u53ef"
{File} "\u30d5\u30a1\u30a4\u30eb"
{Database} "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9"
{Tool} "\u30c4\u30fc\u30eb"
{Help} "\u30d8\u30eb\u30d7"
{New SQLite2 DB} "SQLite2DB\u3092\u65b0\u898f\u4f5c\u6210"
{New SQLite3 DB} "SQLite3DB\u3092\u65b0\u898f\u4f5c\u6210"
{Open} "\u958b\u304f"
{Recent Files} "\u6700\u8fd1\u958b\u3044\u305f\u30d5\u30a1\u30a4\u30eb"
{Change Current Dir} "\u73fe\u5728\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u5909\u66f4"
{Close} "\u9589\u3058\u308b"
{Attach} "\u30a2\u30bf\u30c3\u30c1"
{Detach} "\u30c7\u30bf\u30c3\u30c1"
{Import} "\u8aad\u307f\u8fbc\u307f"
{Export} "\u66f8\u304d\u51fa\u3057"
{SQL} "SQL"
{Text File} "\u30c6\u30ad\u30b9\u30c8\u30d5\u30a1\u30a4\u30eb"
{Exit} "\u7d42\u4e86"
{Run SQL} "SQL\u5b9f\u884c"
{Text} "\u30c6\u30ad\u30b9\u30c8"
{Image} "\u753b\u50cf"
{Save} "\u4fdd\u5b58"
{Load} "\u8aad\u307f\u8fbc\u307f"
{Show Create Table Statement} "\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u306eSQL\u6587\u8868\u793a"
{Show Create Index Statement} "\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210\u306eSQL\u6587\u8868\u793a"
{Show Create Trigger Statement} "\u30c8\u30ea\u30ac\u30fc\u4f5c\u6210\u306eSQL\u6587\u8868\u793a"
{Create Table} "\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210"
{Crete View} "\u30d3\u30e5\u30fc\u4f5c\u6210"
{Create Index} "\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u4f5c\u6210"
{Create Trigger} "\u30c8\u30ea\u30ac\u30fc\u4f5c\u6210"
{Drop Table/View} "\u30c6\u30fc\u30d6\u30eb/\u30d3\u30e5\u30fc\u524a\u9664"
{Drop Index} "\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u524a\u9664"
{Drop Trigger} "\u30c8\u30ea\u30ac\u30fc\u524a\u9664"
{Modify Table Schema} "\u30c6\u30fc\u30d6\u30eb\u30b9\u30ad\u30fc\u30de\u306e\u5909\u66f4"
{Set Cache Size} "\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30a4\u30ba\u8a2d\u5b9a"
{VACUUM} "VACUUM"
{Check Integrity} "\u6574\u5408\u6027\u30c1\u30a7\u30c3\u30af"
{Encoding} "\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0"
{Propery} "\u30d7\u30ed\u30d1\u30c6\u30a3"
{SQL Command} "SQL\u30b3\u30de\u30f3\u30c9"
{Command History} "\u30b3\u30de\u30f3\u30c9\u5c65\u6b74"
{Preference} "\u521d\u671f\u8a2d\u5b9a"
{Undo} "\u5143\u306b\u623b\u3059"
{Redo} "\u3084\u308a\u76f4\u3057"
{Cut} "\u5207\u308a\u53d6\u308a"
{Copy} "\u30b3\u30d4\u30fc"
{Paste} "\u8cbc\u308a\u4ed8\u3051"
{Delete} "\u524a\u9664"
{Select All} "\u5168\u3066\u9078\u629e"
{Delete All} "\u5168\u3066\u524a\u9664"
{Update} "\u66f4\u65b0"
{Freeze Pane} "\u67a0\u3092\u56fa\u5b9a"
{Unfreeze Pane} "\u67a0\u56fa\u5b9a\u3092\u89e3\u9664"
{Sort Asc as Number} "\u6607\u9806\u3067\u30bd\u30fc\u30c8(\u6570\u5024)"
{Sort Desc as Number} "\u964d\u9806\u3067\u30bd\u30fc\u30c8(\u6570\u5024)"
{Sort Asc as String} "\u6607\u9806\u3067\u30bd\u30fc\u30c8(\u8f9e\u66f8\u9806)"
{Sort Desc as String} "\u964d\u9806\u3067\u30bd\u30fc\u30c8(\u8f9e\u66f8\u9806)"
{Reset Row Size} "\u884c\u306e\u9ad8\u3055\u3092\u30ea\u30bb\u30c3\u30c8"
{Reset Column Size} "\u5217\u306e\u5e45\u3092\u30ea\u30bb\u30c3\u30c8"
{Insert New Row} "\u65b0\u3057\u3044\u884c\u306e\u633f\u5165"
{Delete Row} "\u884c\u306e\u524a\u9664"
{Default Value} "\u30c7\u30d5\u30a9\u30eb\u30c8\u5024"
{Modify Column} "\u30ab\u30e9\u30e0\u5909\u66f4"
{Add Column} "\u30ab\u30e9\u30e0\u8ffd\u52a0"
{Delete Column} "\u30ab\u30e9\u30e0\u524a\u9664"
{Up} "\u4e0a"
{Down} "\u4e0b"
{Show Only} "\u8868\u793a\u306e\u307f"
{Name} "\u540d\u524d"
{Data Type} "\u30c7\u30fc\u30bf\u578b"
{Preview} "\u30d7\u30ec\u30d3\u30e5\u30fc"
{Table-Constraints} "\u30c6\u30fc\u30d6\u30eb\u5236\u7d04"
{Constraints} "\u5236\u7d04"
{Columns for 'UPDATE OF'} "'UPDATE OF'\u306e\u5217"
{Confirm Query} "\u30af\u30a8\u30ea\u78ba\u8a8d"
{Search} "\u691c\u7d22"
{Replace} "\u7f6e\u63db\u3048"
{Search Up} "\u4e0a\u691c\u7d22\u2191"
{Search Down} "\u4e0b\u691c\u7d22\u2193"
{Pattern Match} "\u30d1\u30bf\u30fc\u30f3\u30de\u30c3\u30c1"
{None} "\u7121\u3057"
{RegExp} "\u6b63\u898f\u8868\u73fe"
{NoCase} "\u5927\u6587\u5b57\u5c0f\u6587\u5b57\u3092\u533a\u5225\u3057\u306a\u3044"
{Data Editor} "\u30c7\u30fc\u30bf\u7de8\u96c6"
{Unknown Image Format} "\u753b\u50cf\u5f62\u5f0f\u304c\u4e0d\u660e\u3067\u3059"
{General} "\u4e00\u822c"
{SQL Editor} "SQL\u30a8\u30c7\u30a3\u30bf"
{Font Name} "\u30d5\u30a9\u30f3\u30c8\u540d"
{Font} "\u30d5\u30a9\u30f3\u30c8"
{Size} "\u30b5\u30a4\u30ba"
{String Style} "\u6587\u5b57\u30b9\u30bf\u30a4\u30eb"
{Bold} "\u592a\u5b57"
{Underline} "\u4e0b\u7dda"
{Italic} "\u659c\u4f53"
{Uppercase} "\u5927\u6587\u5b57\u306b\u5909\u63db\u3059\u308b"
{Encoding} "\u6587\u5b57\u30b3\u30fc\u30c9"
{Grid Table} "\u30b0\u30ea\u30c3\u30c9\u30c6\u30fc\u30d6\u30eb"
{Use Vi like cursor move} "Vi\u98a8\u30ab\u30fc\u30bd\u30eb\u79fb\u52d5"
{Max History} "\u5c65\u6b74\u4fdd\u5b58\u6570"
{Create/Vacuum 3.x File as 3.x Compatibility Format} "\u5168\u3066\u306e3.x\u3067\u4f7f\u3048\u308b\u5f62\u5f0f\u3067DB\u3092\u4f5c\u6210/Vacuum\u3059\u308b\u3002"
{Version 3.x File Creation} "3.x\u5f62\u5f0f\u306eDB\u4f5c\u6210"
{Page Size} "\u30da\u30fc\u30b8\u30b5\u30a4\u30ba"
{Tcl Script / Shared Library} "Tcl\u30b9\u30af\u30ea\u30d7\u30c8/\u5171\u6709\u30e9\u30a4\u30d6\u30e9\u30ea"
{NOTE:They'll be loaded when db is opened.} "\u6ce8\u610f:\u3053\u308c\u3089\u306fDB\u3092\u958b\u304f\u6642\u306b\u8aad\u307f\u8fbc\u307f\u307e\u3059\u3002"
{Configure entry point of sqlite extension} "SQLite\u62e1\u5f35\u306e\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u306e\u8a2d\u5b9a"
{Enter a entry point name.} "\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{If the value is empty, default entry point is used for shared library. And if the library is a Tcl script, the value is ignored.} "\u5024\u304c\u7a7a\u306e\u5834\u5408\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30a8\u30f3\u30c8\u30ea\u30dd\u30a4\u30f3\u30c8\u3092\u4f7f\u3044\u307e\u3059\u3002\u307e\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\u304cTcl\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u5834\u5408\u3001\u3053\u306e\u5024\u306f\u4f7f\u7528\u3055\u308c\u307e\u305b\u3093\u3002"
{Export Text Format} "\u30c6\u30ad\u30b9\u30c8\u66f8\u304d\u51fa\u3057"
{Import Text Format} "\u30c6\u30ad\u30b9\u30c8\u8aad\u307f\u8fbc\u307f"
{Source} "\u51fa\u529b\u5143"
{Import to} "\u5165\u529b\u5148"
{New Table} "\u65b0\u898f\u30c6\u30fc\u30d6\u30eb"
{Result Table} "\u7d50\u679c\u30c6\u30fc\u30d6\u30eb"
{Separator} "\u533a\u5207\u308a\u6587\u5b57"
{Comma} "\u30b3\u30f3\u30de"
{Tab} "\u30bf\u30d6"
{Record Type} "\u6539\u884c\u65b9\u5f0f"
{Quote char} "\u30af\u30a9\u30fc\u30c8\u6587\u5b57"
{Double Quote} "\u30c0\u30d6\u30eb\u30af\u30a9\u30fc\u30c8"
{Single Quote} "\u30b7\u30f3\u30b0\u30eb\u30af\u30a9\u30fc\u30c8"
{Auto} "\u81ea\u52d5"
{Output Encoding} "\u51fa\u529b\u5148\u6587\u5b57\u30b3\u30fc\u30c9"
{Input Encoding} "\u5165\u529b\u5143\u6587\u5b57\u30b3\u30fc\u30c9"
{Output Field Names} "\u5217\u540d\u3092\u51fa\u529b\u3059\u308b"
{First Line is Field Names} "\u4e00\u884c\u76ee\u3092\u5217\u540d\u3068\u3057\u3066\u6271\u3046"
{Cache size} "\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30a4\u30ba"
{Default cache size} "\u30c7\u30d5\u30a9\u30eb\u30c8\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30a4\u30ba"
{Please open a Database file.} "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u958b\u3044\u3066\u304f\u3060\u3055\u3044"
{The file doesn't exist.} "\u30d5\u30a1\u30a4\u30eb\u304c\u3042\u308a\u307e\u305b\u3093\u3002"
{Failed to open the file.} "\u30d5\u30a1\u30a4\u30eb\u3092\u958b\u3051\u307e\u305b\u3093\u3067\u3057\u305f\u3002"
{The file is not a SQLite file.} "SQLite\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002"
{Faied to open the file. The file has zero size.} "\u7a7a\u30d5\u30a1\u30a4\u30eb\u306a\u306e\u3067\u958b\u3051\u307e\u305b\u3093\u3002"
{Failed to attach the db. The db version is not same as current db.} "main\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u30d0\u30fc\u30b8\u30e7\u30f3\u304c\u9055\u3046\u306e\u3067\u30a2\u30bf\u30c3\u30c1\u3067\u304d\u307e\u305b\u3093"
{Enter database name.} "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u540d\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044"
{May I detach the database?} "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u30c7\u30bf\u30c3\u30c1\u3057\u3066\u3044\u3044\u3067\u3059\u304b\uff1f"
{"Please install tclsqlite, if you want to open SQLite2 file."} "SQLite2\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002tclsqlite\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044"
{"Please install tclsqlite3, if you want to open SQLite3 file."} "SQLite3\u306b\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u305b\u3093\u3002tclsqlite3\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3066\u304f\u3060\u3055\u3044"
{Unsupported tclsqlite. I require a tclsqlite compiled for ISO8859 encoding.} "tclsqlite\u304cISO8859\u5bfe\u5fdc\u3067\u30b3\u30f3\u30d1\u30a4\u30eb\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002"
{Please select a database.} "\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{Please select a table.} "\u30c6\u30fc\u30d6\u30eb\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{Please select tables or views.} "\u30c6\u30fc\u30d6\u30eb\u304b\u30d3\u30e5\u30fc\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{Please select an index.} "\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{Please select a trigger.} "\u30c8\u30ea\u30ac\u30fc\u3092\u9078\u629e\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{May I really drop the tables or views?} "\u672c\u5f53\u306b\u30c6\u30fc\u30d6\u30eb/\u30d3\u30e5\u30fc\u3092\u524a\u9664\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f"
{May I really drop the index?} "\u672c\u5f53\u306b\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u524a\u9664\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f"
{May I really drop the trigger?} "\u672c\u5f53\u306b\u30c8\u30ea\u30ac\u30fc\u3092\u524a\u9664\u3057\u3066\u3082\u3044\u3044\u3067\u3059\u304b\uff1f "
{Failed to drop the tables/views. A table/view with tha same name already exists on other database.} "\u540c\u540d\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u30d3\u30e5\u30fc\u304c\u4ed6\u306e\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u4e0a\u306b\u5b58\u5728\u3057\u3066\u3044\u308b\u306e\u3067\u524a\u9664\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"
{Failed to create the table. A table with the same name already exists.} "\u540c\u540d\u306e\u30c6\u30fc\u30d6\u30eb\u304b\u30d3\u30e5\u30fc\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u306e\u3067\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002"
{More than one rows were updated by trigger. Data of table may not be synchronized. Please re-open this table for synchronizing.} "\u8907\u6570\u306e\u884c\u304c\u30c8\u30ea\u30ac\u30fc\u306b\u3088\u3063\u3066\u66f4\u65b0\u3055\u308c\u307e\u3057\u305f\u3002 \u30c6\u30fc\u30d6\u30eb\u306e\u30c7\u30fc\u30bf\u304c\u540c\u671f\u3055\u308c\u3066\u3044\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 \u30c7\u30fc\u30bf\u3092\u540c\u671f\u3059\u308b\u305f\u3081\u306b\u30c6\u30fc\u30d6\u30eb\u3092\u958b\u304d\u76f4\u3057\u3066\u304f\u3060\u3055\u3044\u3002"
{You can't modify the table in view mode.} "\u95b2\u89a7\u5c02\u7528\u30e2\u30fc\u30c9\u306a\u306e\u3067\u30c6\u30fc\u30d6\u30eb\u3092\u7de8\u96c6\u3067\u304d\u307e\u305b\u3093\u3002 "
{Failed to import SQL.} "SQL\u306e\u8aad\u307f\u8fbc\u307f\u306b\u5931\u6557\u3057\u307e\u3057\u305f\u3002"
{Note:If import file size was big, we would preview top 50KB of the file.} "\u6ce8\u610f:\u30c7\u30fc\u30bf\u304c\u5927\u304d\u3044\u5834\u5408\u3001\u5148\u982d\u306e50KB\u306e\u307f\u8aad\u307f\u8fbc\u3093\u3067\u30d7\u30ec\u30d3\u30e5\u30fc\u8868\u793a\u3059\u308b\u306e\u3067\u672b\u5c3e\u306e\u30c7\u30fc\u30bf\u304c\u3061\u3087\u3093\u5207\u308c\u3066\u898b\u3048\u308b\u5834\u5408\u304c\u3042\u308a\u307e\u3059\u3002"
{Run vacuum?} "vacuum\u3057\u307e\u3059\u304b\uff1f"
{If this DB was big, vacuum will take a long time.} "\u3082\u3057\u3053\u306eDB\u304c\u5927\u304d\u3051\u308c\u3070vacuum\u306f\u6642\u9593\u304c\u304b\u304b\u308a\u307e\u3059\u3002"
{Cache size reverts to the default value when this DB is closed. But Default cache size value is stored in DB. Temp DB's cache size and default cache size aren't stored in DB.} "\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30a4\u30ba\u306e\u5024\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u9589\u3058\u308b\u3068\u521d\u671f\u5316\u3055\u308c\u307e\u3059\u304c\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u30ad\u30e3\u30c3\u30b7\u30e5\u30b5\u30a4\u30ba\u306e\u5024\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306b\u683c\u7d0d\u3055\u308c\u6c38\u7d9a\u3057\u307e\u3059\u3002Temp\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u5834\u5408\u306f\u3069\u3061\u3089\u306e\u5024\u3082\u6c38\u7d9a\u3057\u307e\u305b\u3093\u3002"
}
#
# Icon Images
#
set img(arrowDown) [image create photo ::image::arrowDown -data {
R0lGODlhEAAQALMAAGB0wZOgzMzMzHuJvaSu04SRw5unz46byamy1ZejzomW
xqCr0f///wAAAAAAAAAAACH5BAUUAAwALAAAAAAQABAAAARFkMlJq70Y6K3F
BUgoAp4FEGhKfkvrrqYhz7C0JXiObx4Q/MDgDwY4GI/IGgOgaDqbSlthSo1O
AIPswErBbksYG/cCpkQAADs=
}]
set img(arrowLeft) [image create photo ::image::arrowLeft -data {
R0lGODlhEAAQALMAAF5zwZejzomWxszMzHuJvaSu05OgzJunz46byaCr0WB0
wamy1f///wAAAAAAAAAAACH5BAUUAAwALAAAAAAQABAAAAROkMlJq5VAXauW
GtukFMUXMkqiJkrbVsAhz7OJBXiu24Dh/0ADD0EsGhG2geJ4tDGUgqhU6nwq
CFiCSwEAUQYA7GdAJlvAWu8J3D191ZMIADs=
}]
set img(arrowRight) [image create photo ::image::arrowRight -data {
R0lGODlhEAAQALMAAF5zwZOgzImWxszMzHuJvZunz6Su046byZejzqCr0WB0
wamy1f///wAAAAAAAAAAACH5BAUUAAwALAAAAAAQABAAAARMkMlJq5UK3KuW
2pViGJ+lnGeiJiWlFHAcay5i3ziNBXzvBzrFYUgsHhQDjNGInCgE0Gi0OQGg
FIQsgToZeL3YbRLEwHJBAMCYzPBeIgA7
}]
set img(arrowUp) [image create photo ::image::arrowUp -data {
R0lGODlhEAAQALMAAGB0wZOgzMzMzHuJvaCr0YSRw5ejzqSu046byZunz4mW
xqmy1f///wAAAAAAAAAAACH5BAUUAAwALAAAAAAQABAAAARJkMlJq5UAXAvW
0ht2jAd4AUSqmhSQvPDLMoBh37gJBHzv86AMAEEsEoUCiUAAUDifgOWyVaha
o6eBdovlbLlJjnAcvkiloTQjAgA7
}]
set img(checkAutoincr) [image create photo ::image::checkAutoincr -data {
R0lGODlhEAAQAMQAAPjH3PfA2czMzPa71fS10fS10PW00fOwzPKxzPOuzfKp
yvKnx++mx/CjxPCjxe+ixPChxO+Yv+6XvO2WveyRuOyPtuuMtOuIsumEr+h7
qed2pv///wAAAAAAAAAAAAAAACH5BAUUABsALAAAAAAQABAAAAVI4CaOZGme
aKqWwDoOQeESBMII6nE0jYCjh4VE4iNFSAqFhFIcXSLHjQJSqTRHmmfE4bhg
riNBFnrJgEniy0VzLonZv1XbdQoBADs=
}]
set img(checkNNull) [image create photo ::image::checkNNull -data {
R0lGODlhEAAQAMQAAMzMzLzG7bTA66676am046i15aWz5qOv4KKv4Z6t4pqp
3pmn2Jem3pOj2pOh2pSi1o+f2oeY1oaW0YWV04CQz3yNz3mKzHWHzHCCx2h7
xGB0wQAAAAAAAAAAAAAAAAAAACH5BAUUABsALAAAAAAQABAAAAVI4CaOZGme
aKqWwToOAuEWxbEAKoI4DoCjCMZk4iNFSArFhFIcXSLHjQJSsTRHmmekAblg
riNAFnrJgEniy0VzLonZv1XbdQoBADs=
}]
set img(checkPkey) [image create photo ::image::checkPkey -data {
R0lGODlhEAAQAMQAAMzMzP2+xP24v/yzuvyrs/ypsfyjrPyhqvucpfuao/uW
oPuUnvqRmvuQmvuIk/qFkPp/ivp7h/p3g/pzgPlue/lkcvlca////wAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUABcALAAAAAAQABAAAAVI4CWOZGme
aKqWwToOQuEShKEAqmEsDICjhsTj4SM5SAjEA1IcTRzHC6IRkTRHlqdj0ZhQ
riNAFjqpgEniycRyLonZv1XbdQoBADs=
}]
set img(checkUnique) [image create photo ::image::checkUnique -data {
R0lGODlhEAAQAJEAAGLgRczMzP///wAAACH5BAUUAAIALAAAAAAQABAAAAIm
lI+py+0J3gFUUhrcBSGz3SHRdIXkCHrnxqlHwLYMXLoKbT655BQAOw==
}]
set img(columnEdit) [image create photo ::image::columnEdit -data {
R0lGODlhEAAQANUAAEdhMszMzDdt+yZLrY+l/////3XYFpzWca2trdHX/37V
M3OiVMvycWyZT015/3uEsLK//531V3jwAHqzUG+uPNTU1KbyQrTwfXfnCH3x
DW6kRYbAY3mqWKbgeXntBXjmDnbfD6zne4bCZQAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUACMALAAAAAAQABAAAAZ2
wJFwSCwSCY6kMkkwLp8CCoXoKFivVoqFMRlWsVlJJrLwJiBoNEUiwXCoYErG
A3rDrxoJnRMoOs4QeR8GHAN9dw0SHwoLCAKHXgUiFx8bjRWPfgkXIQcNDxAJ
mXAAHQ0IV6ORCKxYqkIQArKzshCQQwG5urtCQQA7
}]
set img(columnNew) [image create photo ::image::columnNew -data {
R0lGODlhEAAQAMQAAM50DDdt+////8zMzI+l//HXA/z3AdJ/C/Pckua6R9HX
/015/+i9BrK//9ybCdmUCfXjAtB7C9WICtaTFt6jCPnvAf//ANKBC9SMEwAA
AAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUABkALAAAAAAQABAAAAVlYCaOZAaU
IrGsqwC8KNsI7kHB5EIjr1RUjgguo9s9KpYkI5JTNGYYRtLgKBVpAAqEATnl
aLTEJUIeEp2zF3jiFV3BtIDACocHBlb086m40+txeF+AAn4kDQGJiokNgiQD
kJGSIiEAOw==
}]
set img(columnNormal) [image create photo ::image::columnNormal -data {
R0lGODlhEAAQAKIAADdt+////8zMzLK//015/4+l/9HX/wAAACH5BAUUAAcA
LAAAAAAQABAAAAM+eLrcXCTKWNy8QDQSuu/Z9n0hQxhDqhrlwo2gZsLxhqop
K7t00Cov2O9wwuWGwRGyNxwAntDnYLcQWK9YRQIAOw==
}]
set img(db) [image create photo ::image::db -data {
R0lGODlhEAAQANUAAJuWGczMzIvVBLTyU9n+gKqnIpfZHoWzDZPYFsb8Y+v9
va37IIrGCeD8mZfzCKTqN8j+SZTvCIu3GYvnAKOcE5LKGtP7bZetF5vkJ7r4
V4rfApz1DqKdIeL8oa2nKZryDqTsNqSdGp2aHLb3U465Hp+rHP///wAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUACYALAAAAAAQABAAAAZ1
QJNwSCwOKaGkchkaehQNQmI0AoEwhgqJEzB5OhbIwuGYTDQCxkHU/YbHHzNa
DegW7vj8/VI3FaBSGQNWGAgVEn0FYGIbEXJpB4mLC42PdHZ6mSWJgAmChIaI
dpOVZ5Aho2+lcweoQgVMsQFdJrO2t7dGukRBADs=
}]
set img(dummy16x16) [image create photo ::image::dummy16x16 -data {
R0lGODlhEAAQAIAAAAAAAP///yH5BAUUAAEALAAAAAAQABAAAAIOjI+py+0P
o5y02ouzPgUAOw==
}]
set img(folder) [image create photo ::image::folder -data {
R0lGODlhEAAQAMQAALOBG//MZszMzOSxTP/////mgf/ge+68V//0ju+9Uv/U
b///mfbDXue3UfbGYLWEIf/rhf/3kf///wAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAACH5BAUUABIALAAAAAAQABAAAAVVoCSOZGme
J6AC6AgQMMGi72Iv8qq6EeL7sRhAIAFACsiksjAsGp7Q6LMJUFivWCs1wO16
uVSGeCx2mB3Ug3rNVlMH8EFjTp83i7q8SkCU8P+AgC0oIQA7
}]
set img(key) [image create photo ::image::key -data {
R0lGODlhBwAKALMAAKR1EdqqDP/iZbacYbuLA//zg+fCTP//zPPIPqx8Dv3o
dcOSAP///wAAAAAAAAAAACH5BAUUAAwALAAAAAAHAAoAAAQjcKxFSJKnFCHS
KgGwIB5nICSTJMbKvEv7wu1EK+GNAHAC/BEAOw==
}]
set img(lock) [image create photo ::image::lock -data {
R0lGODlhCQAJAMQAALSDCNqqDPfidbacYfDXZufCTKR1Ef//zPPIPrKKK7uL
A9ejCf3ZW/PNS6x8Dv/zg//iZfPZa/HQVPzVUsOSAP/laP3odffaZfzRSf//
/wAAAAAAAAAAAAAAAAAAAAAAACH5BAUUABkALAAAAAAJAAkAAAU0YJY5JCmO
wzk4InuOGaXMCgCQSnUcEcQEDgXkIEhIJgGD8EEwYpIKhuVSaCAWStvNYeiG
AAA7
}]
set img(nullValue) [image create photo ::image::nullValue -data {
R0lGODlhEAAQALMAAP///8zMzMLJ6bjB5K+54Jqn3JGf14eW036Oz3SGymt+
xmJ2wgAAAAAAAAAAAAAAACH5BAUUAAwALAAAAAAQABAAAARBkMlJq70467y6
/yCzFGRplkuwAAbrtgacrgJw2PhxHzPgIwCgUNhLAIw+5MBHUCme0Ch0Bqp6
AoyAdsvtbr7gbwQAOw==
}]
set img(primary_key) [image create photo ::image::primary_key -data {
R0lGODlhBwAKALMAAKR1EdqqDP/iZbacYbuLA//zg+fCTP//zPPIPqx8Dv3o
dcOSAP///wAAAAAAAAAAACH5BAUUAAwALAAAAAAHAAoAAAQjcKxFSJKnFCHS
KgGwIB5nICSTJMbKvEv7wu1EK+GNAHAC/BEAOw==
}]
set img(table) [image create photo ::image::table -data {
R0lGODlhEAAQAKIAADdt+9HX/7K//////8zMzE15/4+l/////yH5BAUUAAcA
LAAAAAAQABAAAANMeLrcaiXKGY2iOAJyyvjBB4pbJwrigH5lEQjCC8dw0J7p
OtyfrpIcV21Gi/F+OFYw2QN2ZLKhcdlkHkMi7I4jAHi/YK+AcyCYz2h0AgA7
}]
set img(view) [image create photo ::image::view -data {
R0lGODlhEAAQAMQAAC6Tk5SUlADBwWZmZv///wDl5SioqHvT04e5uUeMjADT
0wC1tQD//7S0tCO1tVF/fxu9vZ7JySienhm0tJmZmQDe3iutrUeUlADFxS65
uQDv7y6dnTqUlC6lpf///wAAACH5BAUUAB4ALAAAAAAQABAAAAVWoCeOZGme
qDek5UCtJiwOjRq/c22TtN2fv1UgcEkMBsOiTtQgEBiFRPNZ6JAQVMUkkjWQ
MtBCQQLRVCoCCamjwCwsnoMDI1gASpsN4CHi5O8sgYKDJiEAOw==
}]
set img(writable) [image create photo ::image::writable -data {
R0lGODlhCQAJALMAAARao1y9eGZmZp/w/DeExpCQkFvTphFzo3Ttl3nPuG3g
j2XbsHn3nv///wAAAAAAACH5BAUUAA0ALAAAAAAJAAkAAAQesMl5zqSDWAw0
14V0DN0RNmN5Jos6MYhhXoISnFMEADs=
}]
#
# Some fix of theme look&feel
#
#improving look and feel of ttk and tk.
#just source this
namespace eval improvettk {}
proc improvettk::improve_themes {} {
set tile_version [package require tile]
if {[string match 0.7.* $tile_version]} {
set tile_ns tile
set style style
} else {
set tile_ns ttk
set style ttk::style
}
foreach theme [$style theme names] {
switch -exact -- $theme {
"winnative" {
$style theme settings $theme {
$style map TButton \
-foreground [list !disabled SystemButtonText disabled SystemDisabledText] \
;
$style map TCheckbutton \
-foreground [list !disabled SystemWindowText disabled SystemDisabledText] \
;
$style map TRadiobutton \
-foreground [list !disabled SystemWindowText disabled SystemDisabledText] \
;
$style configure TEntry \
-foreground SystemWindowText \
-fieldforeground SystemWindowText \
-fieldbackground SystemWindow \
;
$style map TCombobox \
-fieldbackground [list !disabled SystemWindow disabled SystemButtonFace] \
-foreground [list {readonly focus} SystemHighlightText disabled SystemDisabledText] \
;
$style map TMenubutton \
-foreground [list !disabled systemButtonText disabled SystemDisabledText] \
-arrowcolor [list !disabled systemButtonText disabled SystemDisabledText] \
-embossed [list disabled 1] \
;
$style map TNotebook.Tab \
-foreground [list !disabled systemButtonText disabled SystemDisabledText] \
;
}
}
"xpnative" {
$style map TCombobox \
-foreground [list {readonly focus} SystemHighlightText disabled SystemGrayText] \
;
}
"clam" {
upvar ${tile_ns}::theme::${theme}::colors colors
$style theme settings $theme {
$style map TCheckbutton \
-indicatorforeground [list disabled $colors(-disabledfg)] \
;
$style map TRadiobutton \
-indicatorforeground [list disabled $colors(-disabledfg)] \
;
$style map TEntry \
-fieldbackground [list readonly $colors(-frame) disabled $colors(-frame)] \
;
$style map TCombobox \
-fieldbackground [list readonly white disabled $colors(-frame)] \
-foreground [list disabled $colors(-disabledfg)] \
-background [list disabled $colors(-frame) active $colors(-lighter) pressed $colors(-lighter)] \
-arrowcolor [list disabled $colors(-disabledfg)] \
;
$style map TMenubutton \
-arrowcolor [list disabled $colors(-disabledfg)] \
;
$style map TScrollbar \
-arrowcolor [list disabled $colors(-disabledfg)] \
;
}
}
}
}
return
}
improvettk::improve_themes
proc improvettk::get_ttk_options {theme class option {state ""}} {
set tile_version [package require tile]
if {[string match 0.7.* $tile_version]} {
set tile_ns tile
set style style
} else {
set tile_ns ttk
set style ttk::style
}
set val [$style theme settings $theme {$style lookup $class $option $state}]
if {$val ne ""} {return $val}
set val [$style theme settings $theme {$style lookup . $option $state}]
if {$val ne ""} {return $val}
set val [$style theme settings default {$style lookup $class $option $state}]
if {$val ne ""} {return $val}
set val [$style theme settings default {$style lookup . $option $state}]
if {$val ne ""} {return $val}
return ""
}
proc improvettk::set_tk_color_as_tile {} {
set tile_version [package require tile]
if {[string match 0.7.* $tile_version]} {
set tile_ns tile
set style style
} else {
set tile_ns ttk
set style ttk::style
}
set theme [set ${tile_ns}::currentTheme]
set bg [get_ttk_options $theme . -background]
set fg [get_ttk_options $theme . -foreground]
# set activebg [get_ttk_options $theme . -background active]
# set activefg [get_ttk_options $theme . -foreground active]
set selectbg [get_ttk_options $theme . -selectbackground focus]
set selectfg [get_ttk_options $theme . -selectforeground focus]
set disabled [get_ttk_options $theme . -foreground disabled]
set buttonfg_normal [get_ttk_options $theme TButton -foreground]
set buttonbg_normal [get_ttk_options $theme TButton -background]
set buttonfg_disabled [get_ttk_options $theme TButton -foreground disabled]
set buttonbg_disabled [get_ttk_options $theme TButton -background disabled]
set buttonfg_readonly [get_ttk_options $theme TButton -foreground readonly]
set buttonbg_readonly [get_ttk_options $theme TButton -background readonly]
set buttonfg_active [get_ttk_options $theme TButton -foreground pressed]
set buttonbg_active [get_ttk_options $theme TButton -background pressed]
set fieldfg_normal [get_ttk_options $theme TEntry -foreground]
set fieldbg_normal [get_ttk_options $theme TEntry -fieldbackground]
set fieldfg_disabled [get_ttk_options $theme TEntry -foreground disabled]
set fieldbg_disabled [get_ttk_options $theme TEntry -fieldbackground disabled]
set fieldfg_readonly [get_ttk_options $theme TEntry -foreground readonly]
set fieldbg_readonly [get_ttk_options $theme TEntry -fieldbackground readonly]
set comboffg_normal [get_ttk_options $theme TCombobox -foreground]
set combofbg_normal [get_ttk_options $theme TEntry -fieldbackground]
set comboffg_disabled [get_ttk_options $theme TCombobox -foreground disabled]
set combofbg_disabled [get_ttk_options $theme TCombobox -fieldbackground disabled]
set comboffg_readonly [get_ttk_options $theme TCombobox -foreground readonly]
set combofbg_readonly [get_ttk_options $theme TCombobox -fieldbackground readonly]
option add *Button.background $buttonbg_normal
option add *Button.foreground $buttonfg_normal
option add *Button.activeBackground $buttonbg_active
option add *Button.activeForeground $buttonfg_active
option add *Button.disabledForeground $buttonfg_disabled
option add *Frame.background $bg
option add *Frame.foreground $fg
option add *Listbox.background $fieldbg_normal
option add *Listbox.foreground $fieldfg_normal
option add *Listbox.selectBackground $selectbg
option add *Listbox.selectForeground $selectfg
option add *Listbox.activeStyle none
option add *Text.background $fieldbg_normal
option add *Text.foreground $fieldfg_normal
option add *Text.selectBackground $selectbg
option add *Text.selectForeground $selectfg
option add *Entry.background $fieldbg_normal
option add *Entry.foreground $fieldfg_normal
option add *Entry.selectBackground $selectbg
option add *Entry.selectForeground $selectfg
option add *Entry.disabledBackground $fieldbg_disabled