From 0121f1ea8c9865ed38c73e80878edaaa4416a077 Mon Sep 17 00:00:00 2001 From: svkalinin Date: Tue, 22 Nov 2022 14:55:24 +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=D0=BE=20=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=D0=BA=D0=BB=D1=8E=D1=87=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=9C=D0=B5=D0=BD=D1=8E,=20=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=BE=D0=BA=D0=B8=20=D1=81=D1=82=D0=B0=D1=82=D1=83=D1=81=D0=B0?= =?UTF-8?q?,=20=D0=BF=D0=B0=D0=BD=D0=B5=D0=BB=D0=B8=20=D0=B8=D0=BD=D1=81?= =?UTF-8?q?=D1=82=D1=80=D1=83=D0=BC=D0=B5=D0=BD=D1=82=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/gui.tcl | 21 ++++++++++----- lib/menu.tcl | 2 +- lib/procedure.tcl | 68 +++++++++++++++++++++++++++++------------------ projman.tcl | 2 +- 4 files changed, 59 insertions(+), 34 deletions(-) diff --git a/lib/gui.tcl b/lib/gui.tcl index eb27b0d..2f76379 100644 --- a/lib/gui.tcl +++ b/lib/gui.tcl @@ -74,14 +74,19 @@ ttk::frame .frmBody -border 0 -relief raised ttk::frame .frmStatus -border 0 -relief raised if {$cfgVariables(menuShow) eq "true"} { - pack .frmMenu -side top -padx 1 -fill x + # pack -side top -padx 1 -fill x + grid .frmMenu -row 0 -column 0 -sticky new } -pack .frmBody -side top -padx 1 -fill both -expand true +# pack .frmBody -side top -padx 1 -fill both -expand true +grid .frmBody -row 1 -column 0 -sticky nsew if {$cfgVariables(statusBarShow) eq "true"} { - pack .frmStatus -side top -padx 1 -fill x + # pack .frmStatus -side top -padx 1 -fill x + grid .frmStatus -row 2 -column 0 -sticky sew } +grid columnconfigure . .frmBody -weight 1 +grid rowconfigure . .frmBody -weight 1 # pack .panel -expand true -fill both # pack propagate .panel false @@ -119,12 +124,16 @@ GetViewMenu .popup set frmTool [ttk::frame .frmBody.frmTool] ttk::panedwindow .frmBody.panel -orient horizontal -style TPanedwindow -pack propagate .frmBody.panel false +# pack propagate .frmBody.panel false if {$cfgVariables(toolBarShow) eq "true"} { - pack .frmBody.frmTool -side left -fill y + # pack .frmBody.frmTool -side left -fill y + grid .frmBody.frmTool -row 0 -column 0 -sticky nsw } -pack .frmBody.panel -side left -fill both -expand true +# pack .frmBody.panel -side left -fill both -expand true +grid .frmBody.panel -row 0 -column 1 -sticky nesw +grid columnconfigure .frmBody .frmBody.panel -weight 1 +grid rowconfigure .frmBody .frmBody.panel -weight 1 ttk::button $frmTool.btn_tree -command "ViewFilesTree true" -image tree_24x24 ttk::button $frmTool.btn_search -command FileOper::FindInFiles -image search_24x24 diff --git a/lib/menu.tcl b/lib/menu.tcl index 8b6986b..14a5a8f 100644 --- a/lib/menu.tcl +++ b/lib/menu.tcl @@ -79,7 +79,7 @@ proc GetViewMenu {m} { $m.panelSide add radiobutton -label [::msgcat::mc "Right"] \ -variable cfgVariables(filesPanelPlace) -value right - $m add checkbutton -label [::msgcat::mc "Show the Menu"] -command ViewMenu \ + $m add checkbutton -label [::msgcat::mc "Show the Menu"] -command ViewMenuBar \ -variable cfgVariables(menuShow) -onvalue true -offvalue false $m add checkbutton -label [::msgcat::mc "Toolbar"] -command ViewToolBar \ -variable cfgVariables(toolBarShow) -onvalue true -offvalue false diff --git a/lib/procedure.tcl b/lib/procedure.tcl index 81a910c..1844c84 100644 --- a/lib/procedure.tcl +++ b/lib/procedure.tcl @@ -44,43 +44,58 @@ proc ViewFilesTree {{hotkey "false"}} { } } } -proc ViewToolBar {} { + +proc ViewMenuBar {{hotkey "false"}} { global cfgVariables - if {$cfgVariables(toolBarShow) eq "false"} { - pack forget .frmBody.frmTool - } else { - # pack + if {$hotkey eq "true"} { + if {$cfgVariables(menuShow) eq "false"} { + set cfgVariables(menuShow) true + } else { + set cfgVariables(menuShow) false + } } -} -proc ViewStatusBar {} { - global cfgVariables - if {$cfgVariables(statusBarShow) eq "false"} { - pack forget .frmStatus - } else { - # pack - } -} -proc ViewMenu {} { - global cfgVariables if {$cfgVariables(menuShow) eq "false"} { - pack forget .frmMenu + grid remove .frmMenu } else { - # pack + grid .frmMenu -row 0 -column 0 -sticky new } } +proc ViewStatusBar {{hotkey "false"}} { + global cfgVariables + if {$hotkey eq "true"} { + if {$cfgVariables(statusBarShow) eq "false"} { + set cfgVariables(statusBarShow) true + } else { + set cfgVariables(statusBarShow) false + } + } + if {$cfgVariables(statusBarShow) eq "false"} { + grid remove .frmStatus + } else { + grid .frmStatus -row 2 -column 0 -sticky sew + } +} + +proc ViewToolBar {{hotkey "false"}} { + global cfgVariables + if {$hotkey eq "true"} { + if {$cfgVariables(toolBarShow) eq "false"} { + set cfgVariables(toolBarShow) true + } else { + set cfgVariables(toolBarShow) false + } + } + if {$cfgVariables(toolBarShow) eq "false"} { + grid remove .frmBody.frmTool + } else { + grid .frmBody.frmTool -row 0 -column 0 -sticky nsw + } +} # Enable/Disabled line numbers in editor proc ViewLineNumbers {} { global cfgVariables nbEditor - - # Changed global settigs - # if {$cfgVariables(lineNumberShow) eq "true"} { - # set cfgVariables(lineNumberShow) false - # } else { - # set cfgVariables(lineNumberShow) true - # } - # apply changes for opened tabs foreach node [$nbEditor tabs] { if [winfo exists $node.frmText.t] { $node.frmText.t configure -linemap $cfgVariables(lineNumberShow) @@ -97,6 +112,7 @@ proc ViewHelper {helper} { set cfgVariables($helper) true } } + proc Del {} { return } diff --git a/projman.tcl b/projman.tcl index 1e86dc1..85194c5 100755 --- a/projman.tcl +++ b/projman.tcl @@ -10,7 +10,7 @@ exec wish "$0" -- "$@" ###################################################### # Version: 2.0.0 # Release: alpha -# Build: 22112022130912 +# Build: 22112022145344 ###################################################### # определим текущую версию, релиз и т.д.