2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
|
# File drop using TkDnd
proc fileDrop {top side files} {
# FIXA: Maybe single drop during rev mode should stay in rev mode?
# Dropping two files mean set both
if {[llength $files] >= 2} {
set leftFile [lindex $files 0]
set rightFile [lindex $files 1]
} elseif {$side eq "left"} {
set leftFile [lindex $files 0]
set rightFile ""
} else {
set leftFile ""
set rightFile [lindex $files 0]
}
if {$leftFile ne ""} {
set ::eskil($top,leftDir) [file dirname $leftFile]
set ::eskil($top,leftFile) $leftFile
set ::eskil($top,leftLabel) $leftFile
set ::eskil($top,leftOK) 1
set ::eskil($top,mode) ""
|
>
>
>
>
>
>
>
>
>
>
>
|
|
|
|
|
|
>
>
|
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
|
# File drop using TkDnd
proc fileDrop {top side files} {
# FIXA: Maybe single drop during rev mode should stay in rev mode?
# Dropping two files mean set both
if {[llength $files] >= 2} {
set leftFile [lindex $files 0]
set rightFile [lindex $files 1]
} else {
if {$side eq "any"} {
# Dropped outside the text widgets. Try to be clever.
if {![info exists ::eskil($top,lastDrop)]} {
set side left
} elseif {$::eskil($top,lastDrop) eq "left"} {
set side right
} else {
set side left
}
}
if {$side eq "left"} {
set leftFile [lindex $files 0]
set rightFile ""
} else {
set leftFile ""
set rightFile [lindex $files 0]
}
set ::eskil($top,lastDrop) $side
}
if {$leftFile ne ""} {
set ::eskil($top,leftDir) [file dirname $leftFile]
set ::eskil($top,leftFile) $leftFile
set ::eskil($top,leftLabel) $leftFile
set ::eskil($top,leftOK) 1
set ::eskil($top,mode) ""
|
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
|
if {[info procs textSearch::enableSearch] != ""} {
textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel)
textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel)
}
# Set up file dropping in text windows if TkDnd is available
if {![catch {package require tkdnd}]} {
dnd bindtarget $top.ft1.tt text/uri-list <Drop> "fileDrop $top left %D"
dnd bindtarget $top.ft2.tt text/uri-list <Drop> "fileDrop $top right %D"
}
# FIXA: verify that this label is ok after Tile migration
ttk::label $top.ls -width 1 \
-textvariable ::widgets($top,isearchLabel)
addBalloon $top.ls "Incremental search indicator"
|
>
>
>
|
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
|
if {[info procs textSearch::enableSearch] != ""} {
textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel)
textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel)
}
# Set up file dropping in text windows if TkDnd is available
if {![catch {package require tkdnd}]} {
dnd bindtarget $top text/uri-list <Drop> "fileDrop $top any %D"
dnd bindtarget $top.ft1.tl text/uri-list <Drop> "fileDrop $top left %D"
dnd bindtarget $top.ft1.tt text/uri-list <Drop> "fileDrop $top left %D"
dnd bindtarget $top.ft2.tl text/uri-list <Drop> "fileDrop $top right %D"
dnd bindtarget $top.ft2.tt text/uri-list <Drop> "fileDrop $top right %D"
}
# FIXA: verify that this label is ok after Tile migration
ttk::label $top.ls -width 1 \
-textvariable ::widgets($top,isearchLabel)
addBalloon $top.ls "Incremental search indicator"
|