From 6541915bccd4f5f26cedae2c8820a03b0813e9e6 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Fri, 28 Oct 2022 16:45:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=B2=D1=8B=D0=B2=D0=BE=D0=B4=20=D0=BF=D0=BE=D0=B4?= =?UTF-8?q?=D1=81=D0=BA=D0=B0=D0=B7=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=20?= =?UTF-8?q?=D0=B2=D0=B2=D0=BE=D0=B4=D0=B5=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D1=8B=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/editor.tcl | 68 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 62 insertions(+), 6 deletions(-) diff --git a/lib/editor.tcl b/lib/editor.tcl index 3cce76f..645447f 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -407,8 +407,16 @@ namespace eval Editor { if { [set height [llength $findedVars]] > 10 } { set height 10 } $win.lBox configure -height $height - - bind $win { + # bindtags $win.lBox [list VarHelperBind [winfo toplevel $win.lBox] $win.lBox Text sysAfter all] + # bind VarHelperBind "bindtags $win.lBox {[list [winfo toplevel $win.lBox] $win.lBox Text sysAfter all]}; catch { destroy .varhelper }" + bind $txt { + bind $Editor::txt {} + destroy $Editor::win + focus -force $Editor::txt.t + break + } + bind $win { + bind $txt {} destroy $Editor::win focus -force $Editor::txt.t break @@ -420,15 +428,49 @@ namespace eval Editor { } bind $win.lBox { set findString [dict get $lexers [dict get $editors $Editor::txt fileType] procFindString] - set values [.gotofunction.lBox get [.gotofunction.lBox curselection]] + set values [.varhelper.lBox get [.varhelper.lBox curselection]] regsub -all {PROCNAME} $findString $values str Editor::FindFunction $Editor::txt "$str" - destroy .gotofunction - $Editor::txt tag remove sel 1.0 end + destroy .varhelper.lBox # focus $Editor::txt.t + # bind $Editor::txt "Editor::ReleaseKey %K $txt" + # bind $Editor::txt "Editor::PressKey %K $txt" + # bind $Editor::txt "" + # bind $Editor::txt "" break } - bind $win.lBox {Editor::ListBoxSearch %W %A} + + # bind $txt "" + # bind $txt "" + # bind $txt { + # set index [.varhelper.lBox index active] + # .varhelper.lBox selection clear $index $index + # set index [expr $index + 1] + # puts $index + # .varhelper.lBox activate $index + # .varhelper.lBox selection set $index $index + # break + # } + # bind $txt { + # set index [.varhelper.lBox index active] + # .varhelper.lBox selection clear $index $index + # if {$index eq "0" } { + # set index [.varhelper.lBox size] + # } else { + # set index [expr $index - 1] + # } + # puts $index + # .varhelper.lBox activate $index + # .varhelper.lBox selection set $index $index + # break + # } + # bind $win.lBox { + # set index [.varhelper.lBox curselection] + # puts $index + # # .varhelper.lBox selection set [incr index] 0 + # .varhelper.lBox activate $index + # } + # # bind $win.lBox {Editor::ListBoxSearch %W %A} # Определям расстояние до края экрана (основного окна) и если # оно меньше размера окна со списком то сдвигаем его вверх set winGeom [winfo reqheight $win] @@ -594,6 +636,20 @@ namespace eval Editor { bind $txt "$txt delete {insert linestart} insert" bind $txt "$txt delete insert {insert lineend}" bind $txt "Editor::SplitEditorH $w $fileType" + bind $txt { + set filePath [FileOper::OpenDialog] + if {$filePath != ""} { + FileOper::Edit $filePath + } + break + } + bind $txt { + set filePath [FileOper::OpenDialog] + if {$filePath != ""} { + FileOper::Edit $filePath + } + break + } } proc SearchBrackets {txt} {