Добавлено включение отключение отображения Меню, строки статуса, панели инструментов

master
svkalinin 2022-11-22 14:55:24 +03:00
parent ab9ba18e62
commit 0121f1ea8c
4 changed files with 59 additions and 34 deletions

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -10,7 +10,7 @@ exec wish "$0" -- "$@"
######################################################
# Version: 2.0.0
# Release: alpha
# Build: 22112022130912
# Build: 22112022145344
######################################################
# определим текущую версию, релиз и т.д.