From e7c4d8c95e55638c97498e000f1402933e5dd5f7 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Thu, 15 Sep 2022 09:36:53 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B3=D0=BE=D1=80=D0=B8=D0=B7=D0=BE?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=BF=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D1=81=D1=8B=20=D0=BF=D1=80=D0=BE=D0=BA=D1=80=D1=83?= =?UTF-8?q?=D1=82=D0=BA=D0=B8=20=D0=B2=20=D0=B7=D0=B0=D0=B2=D0=B8=D1=81?= =?UTF-8?q?=D0=B8=D0=BC=D0=BE=D1=81=D1=82=D0=B8=20=D0=BE=D1=82=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B5=D0=BD=D0=BE=D1=81=D0=B0=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=20=D0=B2=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82?= =?UTF-8?q?=D0=BE=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/editor.tcl | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/lib/editor.tcl b/lib/editor.tcl index e085419..a2eda3e 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -618,7 +618,7 @@ namespace eval Editor { dict set editors $txt variableList $varList } -proc FindFunction {findString} { + proc FindFunction {findString} { global nbEditor puts $findString set pos "0.0" @@ -992,7 +992,7 @@ proc FindFunction {findString} { focus -force $win.entryFind } - proc SplitEditor {w fileType} { + proc SplitEditorH {w fileType} { global cfgVariables puts [$w.panelTxt panes] if [winfo exists $w.frmText2] { @@ -1006,6 +1006,26 @@ proc FindFunction {findString} { # $w.panelTxt add $w.frmText -weight 0 $w.panelTxt add $frmText -weight 1 + $frmText.t see [$w.frmText.t index insert] + focus -force $frmText.t.t + } + + proc SplitEditorV {w fileType} { + global cfgVariables + .frmBody.panel add $frmTree -weight 0 + + puts [$w.panelTxt panes] + if [winfo exists $w.frmText2] { + $w.panelTxt forget $w.frmText2 + destroy $w.frmText2 + return + } + set frmText [Editor::EditorWidget $w $fileType] + $frmText.t insert end [$w.frmText.t get 0.0 end] + + # $w.panelTxt add $w.frmText -weight 0 + $w.panelTxt add $frmText -weight 1 + $frmText.t see [$w.frmText.t index insert] } @@ -1032,7 +1052,9 @@ proc FindFunction {findString} { -tabs "[expr {4 * [font measure $cfgVariables(font) 0]}] left" -tabstyle tabular -undo true pack $txt -fill both -expand 1 - pack $frmText.h -side bottom -fill x + if {$cfgVariables(editorWrap) eq "none"} { + pack $frmText.h -side bottom -fill x + } # puts ">>>>>>> [bindtags $txt]" if {$cfgVariables(lineNumberShow) eq "false"} { $txt configure -linemap 0 @@ -1078,9 +1100,9 @@ proc FindFunction {findString} { set btnSplitV "btnSplitV[string range $itemName [expr [string last "." $itemName] +1] end]" set btnSplitH "btnSplitH[string range $itemName [expr [string last "." $itemName] +1] end]" ttk::button $fr.header.$btnSplitH -image split_horizontal_11x11 \ - -command "Editor::SplitEditor $fr $fileType" + -command "Editor::SplitEditorH $fr $fileType" ttk::button $fr.header.$btnSplitV -image split_vertical_11x11 \ - -command "Editor::SplitEditor $fr $fileType" -state disable + -command "Editor::SplitEditorV $fr $fileType" -state disable # pack $fr.$btnSplitH $fr.$btnSplitV -side right -anchor e pack $fr.header.$lblName -side left -expand true -fill x pack $fr.header.$btnSplitV $fr.header.$btnSplitH -side right