Eskil

Diff
Login

Differences From Artifact [29dd387a41]:

To Artifact [cd985127a3]:


33
34
35
36
37
38
39
40

41
42
43
44
45
46
47
33
34
35
36
37
38
39

40
41
42
43
44
45
46
47







-
+







# Stop Tk from meddling with the command line by copying it first.
set ::eskil(argv) $::argv
set ::eskil(argc) $::argc
set ::argv {}
set ::argc 0

set ::eskil(debug) 0
set ::eskil(diffver) "Version 2.7 2015-03-09"
set ::eskil(diffver) "Version 2.7+ 2015-03-13"
set ::eskil(thisScript) [file join [pwd] [info script]]

namespace import tcl::mathop::+
namespace import tcl::mathop::-
namespace import tcl::mathop::*
namespace import tcl::mathop::/

129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
129
130
131
132
133
134
135







136
137
138
139
140
141
142







-
-
-
-
-
-
-







        }
    }
    # Provide a ttk-friendly toplevel, fixing background and menubar
    if {[info commands ttk::toplevel] eq ""} {
        proc ttk::toplevel {w args} {
            tk::toplevel $w {*}$args
            place [ttk::frame $w.tilebg] -x 0 -y 0 -relwidth 1 -relheight 1
            # Menubar looks out of place on linux. This adjusts the background
            # Which is enough to make it reasonable.
            if {[tk windowingsystem] eq "x11"} {
                set bg [ttk::style configure . -background]
                option add *Menubutton.background $bg
                option add *Menu.background $bg
            }
            return $w
        }
    }

    ::snit::widgetadaptor ttk::entryX {
        delegate method * to hull
        delegate option * to hull
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740

3741
3742

3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772

3773
3774
3775

3776
3777
3778
3779
3780
3781
3782

3783
3784
3785
3786
3787
3788
3789
3790


3791
3792
3793
3794
3795
3796
3797

3798
3799
3800
3801
3802

3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821

3822
3823

3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854

3855
3856
3857
3858
3859

3860
3861
3862
3863
3864
3865
3866
3867
3868

3869
3870
3871

3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3717
3718
3719
3720
3721
3722
3723










3724


3725












3726

















3727



3728







3729








3730
3731







3732





3733
3734


















3735


3736































3737





3738

3739







3740



3741















3742
3743
3744
3745
3746
3747
3748







-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
-
+
-
-
-
-
-
+

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
-
-
-
+
-

-
-
-
-
-
-
-
+
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-







            [list EditPrefRegsubUpdate $top]
    trace add variable ::eskil($top,prefregexa2) write \
            [list EditPrefRegsubUpdate $top]
    EditPrefRegsubUpdate $top
}

proc defaultGuiOptions {} {
    option add *Menu.tearOff 0
    option add *Button.padX 5
    if {[tk windowingsystem] eq "x11"} {
        option add *Button.padY 1
        option add *Listbox.selectBorderWidth 0
        option add *Entry.selectBorderWidth 0
        option add *Text.selectBorderWidth 0
        option add *highlightThickness 0
        option add *Scrollbar.borderWidth 1

    # Turn off tearoff on all systems
        option add *Menu.activeBorderWidth 1
        option add *Menu.borderWidth 1
    option add *Menu.tearOff 0
        option add *Menubutton.highlightThickness 0

        option add *Listbox.exportSelection 0
        option add *Listbox.borderWidth 1
        #option add *Listbox.highlightThickness 1
        option add *Font "Helvetica -12"
        option add *Scrollbar.highlightThickness 0
        option add *Scrollbar.takeFocus 0
        option add *Panedwindow.showHandle 0
    }

    # other Win2K like color changes
    if {[tk windowingsystem]=="x11"} {
        set SystemButtonFace #D4D0C8
        set SystemButtonText #000000
        set SystemHighlight #0A226A
        set SystemHighlightText #ffffff
        set SystemWindow #ffffff
        set SystemWindowText #000000
        set SystemWindowFrame #000000
        set NORMAL_BG $SystemButtonFace
        set NORMAL_FG $SystemButtonText
        set SELECT_BG $SystemHighlight
        set SELECT_FG $SystemHighlightText
        set MENU_BG $NORMAL_BG
        set MENU_FG $NORMAL_FG
        set HIGHLIGHT $SystemWindowFrame
        set TEXT_FG $SystemWindowText
        set TROUGH $NORMAL_BG

        # Menubar looks out of place on linux. This adjusts the background
        # need to set this explicitly, since its already been created
        . configure -bg $NORMAL_BG

        # Which is enough to make it reasonable.
        option add *Button.activeBackground $NORMAL_BG
        option add *Button.activeForeground $NORMAL_FG
        option add *Button.background $NORMAL_BG
        option add *Button.foreground $NORMAL_FG
        option add *Button.highlightBackground $NORMAL_BG
        option add *Button.highlightForeground $NORMAL_FG

        set bg [ttk::style configure . -background]
        option add *Label.activeBackground $NORMAL_BG
        option add *Label.activeForeground $NORMAL_FG
        option add *Label.background $NORMAL_BG
        option add *Label.foreground $NORMAL_FG
        option add *Label.highlightBackground $NORMAL_BG
        option add *Label.highlightForeground $NORMAL_FG

        option add *Checkbutton.background $NORMAL_BG
        set sbg [ttk::style configure . -selectbackground]
        option add *Menubutton.background $bg
        option add *Checkbutton.foreground $NORMAL_FG
        option add *Checkbutton.highlightBackground $NORMAL_BG
        option add *Checkbutton.highlightForeground $NORMAL_FG
        option add *Checkbutton.activeForeground $NORMAL_FG
        option add *Checkbutton.activeBackground $NORMAL_BG

        option add *Radiobutton.background $NORMAL_BG
        option add *Menu.background $bg
        option add *Radiobutton.foreground $NORMAL_FG
        option add *Radiobutton.highlightBackground $NORMAL_BG
        option add *Radiobutton.highlightForeground $NORMAL_FG
        option add *Radiobutton.activeForeground $NORMAL_FG
        option add *Radiobutton.activeBackground $NORMAL_BG
        option add *Menu.activeBackground $sbg

        option add *Canvas.background $NORMAL_BG

        option add *Entry.background $SystemWindow
        option add *Entry.foreground $SystemWindowText
        option add *Entry.highlightBackground $NORMAL_BG
        option add *Entry.insertBackground $SystemWindowText
        option add *Entry.selectBackground $SELECT_BG
        option add *Entry.selectForeground $SELECT_FG

        option add *Frame.background $NORMAL_BG
        option add *Frame.highlightBackground $NORMAL_BG
        option add *Frame.highlightForeground $SystemWindowFrame

        option add *Labelframe.foreground $NORMAL_FG
        option add *Labelframe.background $NORMAL_BG

        option add *Listbox.background $SystemWindow
        option add *Listbox.foreground $NORMAL_FG
        option add *Listbox.background $bg
        option add *Listbox.selectForeground $SELECT_FG
        option add *Listbox.selectBackground $SELECT_BG
        option add *Listbox.selectBackground $sbg
        option add *Listbox.highlightBackground $NORMAL_BG
        option add *Listbox.highlightForeground $HIGHLIGHT

        option add *Menu.activeBackground $SELECT_BG
        option add *Menu.activeForeground $SELECT_FG
        option add *Menu.background $MENU_BG
        option add *Menu.foreground $MENU_FG
        option add *Menu.selectForeground $MENU_FG

        option add *Menubutton.activeBackground $NORMAL_BG
        option add *Menubutton.activeForeground $NORMAL_FG
        option add *Menubutton.background $NORMAL_BG
        option add *Menubutton.foreground $NORMAL_FG

        option add *Message.background $NORMAL_BG
        option add *Message.foreground $NORMAL_FG

        option add *Panedwindow.background $NORMAL_BG

        option add *Scale.activeBackground $NORMAL_BG
        option add *Scale.background $NORMAL_BG
        option add *Scale.foreground $NORMAL_FG
        option add *Scale.troughColor $TROUGH

        option add *Scrollbar.activeBackground $NORMAL_BG
        option add *Scrollbar.background $NORMAL_BG
        option add *Scrollbar.highlightBackground $NORMAL_BG
        option add *Scrollbar.highlightForeground $HIGHLIGHT
        option add *Scale.troughColor $TROUGH

        option add *Text.background $SystemWindow
        option add *Text.background white
        option add *Text.foreground $SystemWindowText
        option add *Text.highlightBackground $NORMAL_BG
        option add *Text.highlightForeground $HIGHLIGHT
        option add *Text.insertForeground $TEXT_FG
        option add *Text.selectBackground $SELECT_BG
        option add *Text.selectBackground $sbg
        option add *Text.selectForeground $SELECT_FG

        option add *Toplevel.background $NORMAL_BG
    }

    if {$::tcl_platform(platform) eq "windows"} {
        option add *Panedwindow.sashRelief flat
        option add *Panedwindow.sashWidth 4
        option add *Panedwindow.sashPad 0
        #option add *Scrollbar.takeFocus 0
        #option add *Menubutton.activeBackground SystemHighlight
        #option add *Menubutton.activeForeground SystemHighlightText
        option add *Menubutton.padY 1
        #option add *highlightThickness 0
    }

    # Use Tahoma 8 as default on Windows, which is the system default
    # on Win2K and WinXP.
    if { [tk windowingsystem] == "win32" } {
        set ASfont "Tahoma 8"
        option add *Button.font             $ASfont widgetDefault
        option add *Checkbutton.font        $ASfont widgetDefault
        option add *Label.font              $ASfont widgetDefault
        option add *Listbox.font            $ASfont widgetDefault
        option add *Menu.font               $ASfont widgetDefault
        option add *Menubutton.font         $ASfont widgetDefault
        option add *Message.font            $ASfont widgetDefault
        option add *Radiobutton.font        $ASfont widgetDefault
        option add *Spinbox.font            $ASfont widgetDefault
    }
}

#####################################
# Startup stuff
#####################################