Eskil

Diff
Login

Differences From Artifact [ec5228fb27]:

To Artifact [4d82fb9ec6]:


2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776




2777



2778
2779
2780
2781
2782
2783
2784
            }
            continue
        }
    }
}

# Scroll text windows
proc scrollText {top n what} {
    # Do not scroll if focus is in a text window.
    # This is for scroll bindings in the toplevel.
    if {[winfo class [focus]] != "Text"} {




        $::widgets($top,wDiff1) yview scroll $n $what



    }
}

# 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







|


|
>
>
>
>
|
>
>
>







2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
            }
            continue
        }
    }
}

# Scroll text windows
proc scrollText {top args} {
    # Do not scroll if focus is in a text window.
    # This is for scroll bindings in the toplevel.
    set class [winfo class [focus]]
    if {$class in "Text TEntry"} {
        return
    }

    $::widgets($top,wDiff1) {*}$args
    if {[string index [lindex $args 0] 0] eq "x"} {
        # x commands go to both since that is not synched
        $::widgets($top,wDiff2) {*}$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
3225
3226
3227
3228
3229
3230
3231

3232

3233

3234

3235










3236

3237
3238
3239
3240
3241
3242
3243
    grid $top.ft1  $map    $top.sby $top.ft2  -row 2 -sticky news
    grid $top.sbx1 $top.ls -        $top.sbx2 -row 3 -sticky news
    grid columnconfigure $top {0 3} -weight 1
    grid rowconfigure $top 2 -weight 1
    grid $map -pady [expr {[winfo reqwidth $top.sby] - 2}]
    grid $top.ls -sticky ""


    bind $top <Key-Up>    [list scrollText $top -1 u]

    bind $top <Key-Down>  [list scrollText $top  1 u]

    bind $top <Key-Prior> [list scrollText $top -1 pa]

    bind $top <Key-Next>  [list scrollText $top  1 pa]










    bind $top <Key-Escape> [list focus $top]

    if {$::eskil(debug) == 0} {
        bind $top <Key> "backDoor $top %A"
    }

    pack $top.bfn -in $top.f -side right -padx {3 6}
    pack $top.bfp $top.bcm $top.brv $top.blg \
            $top.er2 $top.lr2 $top.er1 $top.lr1 \







>
|
>
|
>
|
>
|
>
>
>
>
>
>
>
>
>
>

>







3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
    grid $top.ft1  $map    $top.sby $top.ft2  -row 2 -sticky news
    grid $top.sbx1 $top.ls -        $top.sbx2 -row 3 -sticky news
    grid columnconfigure $top {0 3} -weight 1
    grid rowconfigure $top 2 -weight 1
    grid $map -pady [expr {[winfo reqwidth $top.sby] - 2}]
    grid $top.ls -sticky ""

    # Allow scrolling from keys at toplevel
    bind $top <Key-Up>    [list scrollText $top yview scroll -1 u]
    bind $top <Key-k>     [list scrollText $top yview scroll -1 u]
    bind $top <Key-Down>  [list scrollText $top yview scroll  1 u]
    bind $top <Key-j>     [list scrollText $top yview scroll  1 u]
    bind $top <Key-Prior> [list scrollText $top yview scroll -1 pa]
    bind $top <Key-b>     [list scrollText $top yview scroll -1 pa]
    bind $top <Key-Next>  [list scrollText $top yview scroll  1 pa]
    bind $top <Key-space> [list scrollText $top yview scroll  1 pa]
    bind $top <Key-Left>  [list scrollText $top xview scroll -5 u]
    bind $top <Key-h>     [list scrollText $top xview scroll -5 u]
    bind $top <Key-Right> [list scrollText $top xview scroll  5 u]
    bind $top <Key-l>     [list scrollText $top xview scroll  5 u]
    bind $top <Key-Home>  [list scrollText $top yview moveto 0]
    bind $top <Key-g>     [list scrollText $top yview moveto 0]
    bind $top <Key-End>   [list scrollText $top yview moveto 1]

    # Go out to toplevel with escape, whereever you are
    bind $top <Key-Escape> [list focus $top]

    if {$::eskil(debug) == 0} {
        bind $top <Key> "backDoor $top %A"
    }

    pack $top.bfn -in $top.f -side right -padx {3 6}
    pack $top.bfp $top.bcm $top.brv $top.blg \
            $top.er2 $top.lr2 $top.er1 $top.lr1 \