From 2f5af66c5c02479d3592e0f45d2e1b076e4df2fe Mon Sep 17 00:00:00 2001 From: svkalinin Date: Tue, 1 Nov 2022 11:23:54 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D1=80=D1=80=D1=80=D0=B5?= =?UTF-8?q?=D0=BA=D1=82=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BF=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B2=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=BA=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/editor.tcl | 30 +++++++++++++++++++++--------- projman.tcl | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/lib/editor.tcl b/lib/editor.tcl index 645447f..fdae284 100644 --- a/lib/editor.tcl +++ b/lib/editor.tcl @@ -394,10 +394,11 @@ namespace eval Editor { wm transient $win . wm overrideredirect $win 1 - listbox $win.lBox -width 30 -border 2 -yscrollcommand "$win.yscroll set" -border 1 - ttk::scrollbar $win.yscroll -orient vertical -command "$win.lBox yview" + # listbox $win.lBox -width 30 -border 2 -yscrollcommand "$win.yscroll set" -border 1 + # ttk::scrollbar $win.yscroll -orient vertical -command "$win.lBox yview" + listbox $win.lBox -width 30 -border 2 -border 1 pack $win.lBox -expand true -fill y -side left - pack $win.yscroll -side left -expand false -fill y + # pack $win.yscroll -side left -expand false -fill y foreach { word } $findedVars { $win.lBox insert end $word @@ -471,16 +472,27 @@ namespace eval Editor { # .varhelper.lBox activate $index # } # # bind $win.lBox {Editor::ListBoxSearch %W %A} + # Определям расстояние до края экрана (основного окна) и если # оно меньше размера окна со списком то сдвигаем его вверх - set winGeom [winfo reqheight $win] + set winGeomY [winfo reqheight $win] + set winGeomX [winfo reqwidth $win] + set topHeight [winfo height .] - # puts "$x, $y, $winGeom, $topHeight" - if [expr [expr $topHeight - $y] < $winGeom] { - set y [expr $topHeight - $winGeom] - } - wm geom $win +$x+$y + set topWidth [winfo width .] + set topLeftUpperX [winfo x .] + set topLeftUpperY [winfo y .] + set topRightLowerX [expr $topLeftUpperX + $topWidth] + set topRightLowerY [expr $topLeftUpperY + $topHeight] + if {[expr [expr $x + $winGeomX] > $topRightLowerX]} { + set x [expr $x - $winGeomX] + } + if {[expr [expr $y + $winGeomY] > $topRightLowerY]} { + set y [expr $y - $winGeomY] + } + + wm geom $win +$x+$y } proc ReleaseKey {k txt} { diff --git a/projman.tcl b/projman.tcl index 8c2168e..51131cc 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish "$0" -- "$@" ###################################################### # Version: 2.0.0 # Release: alpha -# Build: 28102022165035 +# Build: 01112022112028 ###################################################### # определим текущую версию, релиз и т.д.