Added Menu button into tollbar and Hide/Show options into config
This commit is contained in:
81
lib/menu.tcl
81
lib/menu.tcl
@@ -74,8 +74,8 @@ proc GetMenu {m} {
|
||||
unset nb
|
||||
}
|
||||
$m add command -label [::msgcat::mc "Comment selected"] -font $fontNormal -accelerator "Ctrl+,"\
|
||||
-command {TextOperation comment}
|
||||
$m add command -label [::msgcat::mc "Uncomment selected"] -font $fontNormal -accelerator "Ctrl+." \
|
||||
-command {TextOperation comment}
|
||||
$m add command -label [::msgcat::mc "Uncomment selected"] -font $fontNormal -accelerator "Ctrl+." \
|
||||
-command {TextOperation uncomment}
|
||||
|
||||
$m add separator
|
||||
@@ -91,3 +91,80 @@ proc GetMenu {m} {
|
||||
$me add command -label [::msgcat::mc "CP1251"] -command {TextEncode cp1251} -font $fontNormal
|
||||
$me add command -label [::msgcat::mc "CP866"] -command {TextEncode cp866} -font $fontNormal
|
||||
}
|
||||
|
||||
proc GetViewMenu {m} {
|
||||
global fontNormal fontBold imgDir editor
|
||||
$m add checkbutton -label [::msgcat::mc "Show the Menu"] -font $fontNormal -state normal\
|
||||
-offvalue "No" -onvalue "Yes" -variable showMenu -command {ToolBar}
|
||||
$m add checkbutton -label [::msgcat::mc "Toolbar"] -font $fontNormal -state normal\
|
||||
-offvalue "No" -onvalue "Yes" -variable toolBar -command {ToolBar}
|
||||
$m add command -label [::msgcat::mc "Split edit window"] -font $fontNormal -accelerator "F4" -state disable\
|
||||
-command SplitWindow
|
||||
$m add separator
|
||||
$m add command -label [::msgcat::mc "Refresh"] -font $fontNormal -accelerator "F5" -state normal\
|
||||
-command UpdateTree
|
||||
}
|
||||
|
||||
proc GetModulesMenu {m} {
|
||||
global fontNormal fontBold imgDir editor module activeProject
|
||||
if {[info exists module(tkcvs)]} {
|
||||
$m add command -label "TkCVS" -command {DoModule tkcvs} -font $fontNormal
|
||||
}
|
||||
if {[info exists module(tkdiff)]} {
|
||||
$m add command -label "TkDIFF+" -command {DoModule tkdiff} -font $fontNormal
|
||||
}
|
||||
if {[info exists module(tkregexp)]} {
|
||||
$m add command -label "TkREGEXP" -command {DoModule tkregexp} -font $fontNormal
|
||||
}
|
||||
if {[info exists module(gitk)]} {
|
||||
$m add command -label "Gitk" -font $fontNormal -command {
|
||||
DoModule gitk
|
||||
GetTagList [file join $workDir $activeProject.tags] ;# geting tag list
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
proc GetHelpMenu {m} {
|
||||
global fontNormal fontBold imgDir editor
|
||||
$m add command -label [::msgcat::mc "Help"] -command ShowHelp \
|
||||
-accelerator F1 -font $fontNormal
|
||||
$m add command -label [::msgcat::mc "About ..."] -command AboutDialog \
|
||||
-font $fontNormal
|
||||
}
|
||||
proc GetFileMenu {m} {
|
||||
global fontNormal fontBold imgDir editor noteBookFiles noteBook
|
||||
$m add cascade -label [::msgcat::mc "New"] -menu $m.new -font $fontNormal
|
||||
set mn [menu $m.new -bg $editor(bg) -fg $editor(fg)]
|
||||
$mn add command -label [::msgcat::mc "New file"] -command {AddToProjDialog file [$noteBookFiles raise]}\
|
||||
-font $fontNormal -accelerator "Ctrl+N"
|
||||
$mn add command -label [::msgcat::mc "New directory"] -command {AddToProjDialog directory [$noteBookFiles raise]}\
|
||||
-font $fontNormal -accelerator "Ctrl+N"
|
||||
$mn add command -label [::msgcat::mc "New project"] -command {NewProjDialog "new"}\
|
||||
-font $fontNormal
|
||||
#$m add command -label [::msgcat::mc "Open"] -command {FileDialog $tree open}\
|
||||
#-font $fontNormal -accelerator "Ctrl+O" -state disable
|
||||
$m add command -label [::msgcat::mc "Save"] -command {FileDialog [$noteBookFiles raise] save}\
|
||||
-font $fontNormal -accelerator "Ctrl+S"
|
||||
$m add command -label [::msgcat::mc "Save as"] -command {FileDialog [$noteBookFiles raise] save_as}\
|
||||
-font $fontNormal
|
||||
$m add command -label [::msgcat::mc "Save all"] -command {FileDialog [$noteBookFiles raise] save_all}\
|
||||
-font $fontNormal
|
||||
$m add command -label [::msgcat::mc "Close"] -command {FileDialog [$noteBookFiles raise] close}\
|
||||
-font $fontNormal -accelerator "Ctrl+W"
|
||||
$m add command -label [::msgcat::mc "Close all"] -command {FileDialog [$noteBookFiles raise] close_all}\
|
||||
-font $fontNormal
|
||||
$m add command -label [::msgcat::mc "Delete"] -command {FileDialog [$noteBookFiles raise] delete}\
|
||||
-font $fontNormal -accelerator "Ctrl+D"
|
||||
$m add separator
|
||||
$m add command -label [::msgcat::mc "Compile file"] -command {MakeProj compile file} -font $fontNormal -accelerator "Ctrl+F8"
|
||||
$m add command -label [::msgcat::mc "Run file"] -command {MakeProj run file} -font $fontNormal -accelerator "Ctrl+F9"
|
||||
$m add separator
|
||||
$m add command -label [::msgcat::mc "Print"] -command PrintDialog\
|
||||
-font $fontNormal -accelerator "Ctrl+P"
|
||||
$m add separator
|
||||
$m add command -label [::msgcat::mc "Settings"] -command {Settings $noteBook} -font $fontNormal
|
||||
$m add separator
|
||||
$m add command -label [::msgcat::mc "Exit"] -command Quit -font $fontNormal -accelerator "Ctrl+Q"
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user