Исправлено переключение вкладок при закрытии

master
svkalinin 2022-11-23 12:50:07 +03:00
parent 8402409489
commit dbb8c3f911
4 changed files with 14 additions and 5 deletions

View File

@ -233,10 +233,13 @@ namespace eval FileOper {
$tree delete $treeItem $tree delete $treeItem
} }
} }
unset modified($nbItem) if [info exists modified($nbItem)] {
unset modified($nbItem)
}
.frmStatus.lblPosition configure -text "" .frmStatus.lblPosition configure -text ""
.frmStatus.lblEncoding configure -text "" .frmStatus.lblEncoding configure -text ""
.frmStatus.lblSize configure -text "" .frmStatus.lblSize configure -text ""
NB::NextTab $nbEditor 0
} }
proc Save {} { proc Save {} {
@ -439,9 +442,10 @@ namespace eval FileOper {
set res [SearchStringInFolder $str] set res [SearchStringInFolder $str]
} }
} }
FindInFilesDialog $txt $res if [FindInFilesDialog $txt $res] {
.find.entryFind delete 0 end .find.entryFind delete 0 end
.find.entryFind insert end $str .find.entryFind insert end $str
}
} }
proc ReplaceInFiles {} { proc ReplaceInFiles {} {

View File

@ -188,6 +188,7 @@ ttk::style layout TNotebook.Tab {
bind TNotebook <Button-1> "catch {NB::PressTab %W %x %y}\;[bind TNotebook <Button-1>];break" bind TNotebook <Button-1> "catch {NB::PressTab %W %x %y}\;[bind TNotebook <Button-1>];break"
# bind <<NotebookTabChanged>> "NB::PressTab %W %x %y" # bind <<NotebookTabChanged>> "NB::PressTab %W %x %y"
bind TNotebook <ButtonRelease-1> "NB::PressTab %W %x %y" bind TNotebook <ButtonRelease-1> "NB::PressTab %W %x %y"
# bind TNotebook <Control-w> FileOper::Close
# bind . <Control-Tab> "NB::NextTab $nbEditor" # bind . <Control-Tab> "NB::NextTab $nbEditor"
bind . <Control-Next> "NB::NextTab $nbEditor 1" bind . <Control-Next> "NB::NextTab $nbEditor 1"
bind . <Control-Prior> "NB::NextTab $nbEditor -1" bind . <Control-Prior> "NB::NextTab $nbEditor -1"

View File

@ -61,6 +61,9 @@ namespace eval NB {
proc NextTab {w step} { proc NextTab {w step} {
global tree global tree
set i [expr [$w index end] - 1] set i [expr [$w index end] - 1]
if {[$w select] eq ""} {
return
}
set nbItemIndex [$w index [$w select]] set nbItemIndex [$w index [$w select]]
if {$nbItemIndex eq 0 && $step eq "-1"} { if {$nbItemIndex eq 0 && $step eq "-1"} {
$w select $i $w select $i

View File

@ -511,7 +511,7 @@ proc FindInFilesDialog {txt {args ""}} {
} }
set win .find set win .find
if { [winfo exists $win] } { destroy $win } if { [winfo exists $win] } { destroy $win; return false}
toplevel $win toplevel $win
wm transient $win . wm transient $win .
wm overrideredirect $win 1 wm overrideredirect $win 1
@ -639,6 +639,7 @@ proc FindInFilesDialog {txt {args ""}} {
focus -force $win.entryFind focus -force $win.entryFind
} }
# $win.lBox focus I001 # $win.lBox focus I001
return true
} }
proc ShowMessage {title msg} { proc ShowMessage {title msg} {