📄 preferences.tcl
字号:
set prncmd ${win}.prncmd LabelEntryButton& ${prncmd} -text [get_indep String\ PrefAsciiPrintCommand] -labelwidth 25 -anchor nw\ -variable sn_options(opt_def,ascii-print-command)\ -extensions $sn_options(executable_ext)\ -defaultextension $sn_options(executable_defaultext) pack ${prncmd} -side top -anchor nw -fill x #Print command set sn_options(opt_def,print-command)\ $sn_options(def,print-command) set pcmd ${win}.pcmd LabelEntryButton& ${pcmd} -text [get_indep String\ PrefPrintCommand] -labelwidth 25 -anchor nw\ -variable sn_options(opt_def,print-command)\ -extensions $sn_options(executable_ext)\ -defaultextension $sn_options(executable_defaultext) pack ${pcmd} -side top -anchor nw -fill x } set debug [tixLabelFrame ${Others}.debug -label [get_indep String\ DebuggerCommand]] ${debug} config -background $sn_options(def,layout-bg) set win [${Others}.debug subwidget frame] pack ${debug} -fill x -side top -anchor c #Debugger command set sn_options(opt_def,gdb-command) $sn_options(def,gdb-command) set dbgcmd ${win}.dbgcmd LabelEntryButton& ${dbgcmd} -text "" -labelwidth 0 -anchor nw\ -variable sn_options(opt_def,gdb-command) -native 1\ -extensions $sn_options(executable_ext)\ -defaultextension $sn_options(executable_defaultext) pack ${dbgcmd} -side top -fill x #Retriever set retr [tixLabelFrame ${Others}.retr -label [get_indep String\ PrefRetriever]] ${retr} config -background $sn_options(def,layout-bg) set win [${Others}.retr subwidget frame] pack ${retr} -fill x -side top -anchor c set sn_options(opt_donot_display) $sn_options(donot_display) set retr ${win}.retr CheckButton& ${retr} -labels [list [get_indep String\ DonotDisplayWarning]] -underlines [list [get_indep Pos\ DonotDisplayWarning]] -balloons [list [get_indep String\ DonotDisplayWarningINFO]] -variables sn_options(opt_donot_display)\ -label "" pack ${retr} -side top -anchor nw -fill x lappend AvailTools ${Others} } method RaiseOthers {} { #set lastPage others } ##################################################### # Colors and Fonts ##################################################### method AddColorAndFont {nb page} { global sn_options set ColorAndFontPage [${nb} subwidget ${page}] set ColorAndFont ${ColorAndFontPage} #Don't hide any settings on windows, even if the standard #options are used!!# FIXME : I have never seen code more in need of a reformat, we should import what was on elix! #build schemes struct, that can be interpreted #from the color manager set schemes [list \ [list [get_indep String Default] \ [list \ [list [get_indep String General] \ [list \ [list [get_indep String Standard] \ [list def,default-font opt_def,default-font def,default-fg \ opt_def,default-fg def,default-bg opt_def,default-bg]] \ [list [get_indep String Layout] \ [list def,layout-font opt_def,layout-font def,layout-fg \ opt_def,layout-fg def,layout-bg opt_def,layout-bg]] \ [list [get_indep String Highlighting] \ [list "" "" def,highlight-fg opt_def,highlight-fg \ def,highlight-bg opt_def,highlight-bg]] \ [list [get_indep String BoldFont] \ [list def,bold-font opt_def,bold-font "" "" "" ""]] \ [list [get_indep String Marked] \ [list "" "" def,select-fg opt_def,select-fg def,select-bg \ opt_def,select-bg]] \ ] \ ] \ ] \ [list \ [list [get_indep String Editor] \ [list \ [list [get_indep String Text] \ [list def,edit-font opt_def,edit-font def,edit-fg \ opt_def,edit-fg def,edit-bg opt_def,edit-bg]] \ [list "[get_indep String FunctionsNoKey] (fu)" \ [list "" "" def,color_fu opt_def,color_fu "" ""]] \ [list "[get_indep String FunctionsDecNoKey] (fd)" \ [list "" "" def,color_fd opt_def,color_fd "" ""]] \ [list "[get_indep String SubroutinesNoKey] (su)" \ [list "" "" def,color_su opt_def,color_su "" ""]] \ [list [get_indep String Strings] \ [list "" "" def,color_str opt_def,color_str "" ""]] \ [list [get_indep String Comments] \ [list "" "" def,color_rem opt_def,color_rem "" ""]] \ [list [get_indep String Keywords] \ [list "" "" def,color_key opt_def,color_key "" ""]] \ [list "[get_indep String ClassesNoKey] (cl)" \ [list "" "" def,color_cl opt_def,color_cl "" ""]] \ [list "[get_indep String Typedefs] (t)" \ [list "" "" def,color_t opt_def,color_t "" ""]] \ [list "[get_indep String Enums] (e)" \ [list "" "" def,color_e opt_def,color_e "" ""]] \ [list "[get_indep String EnumConsNoKey] (ec)" \ [list "" "" def,color_ec opt_def,color_ec "" ""]] \ [list "[get_indep String MethodsNoKey] (md)" \ [list "" "" def,color_md opt_def,color_md "" ""]] \ [list "[get_indep String FriendsNoKey] (fr)" \ [list "" "" def,color_fr opt_def,color_fr "" ""]] \ [list "[get_indep String MethodImpsNoKey] (mi)" \ [list "" "" def,color_mi opt_def,color_mi "" ""]] \ [list "[get_indep String ClassVarsNoKey] (iv)" \ [list "" "" def,color_iv opt_def,color_iv "" ""]] \ [list "[get_indep String VariablesNoKey] (gv)" \ [list "" "" def,color_gv opt_def,color_gv "" ""]] \ [list "[get_indep String PafLocVars] (lv)" \ [list "" "" def,color_lv opt_def,color_lv "" ""]] \ [list "[get_indep String ConstantsNoKey] (con)" \ [list "" "" def,color_con opt_def,color_con "" ""]] \ [list "[get_indep String CommonsNoKey] (com)" \ [list "" "" def,color_com opt_def,color_com "" ""]] \ [list "[get_indep String CommonsVarsNoKey] (cov)" \ [list "" "" def,color_cov opt_def,color_cov "" ""]] \ [list "[get_indep String DefinesNoKey] (ma)" \ [list "" "" def,color_ma opt_def,color_ma "" ""]] \ [list [get_indep String Brackets] \ [list "" "" def,bracketmatch-bg opt_def,bracketmatch-bg "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String SplitIntoClass] \ [list \ [list [get_indep String Standard] \ [list def,ctree-font opt_def,ctree-font "" "" "" ""]] \ [list [get_indep String AbstractClass] \ [list def,abstract-font opt_def,abstract-font "" "" "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String HierarchyNoKey] \ [list \ [list [get_indep String Standard] \ [list def,class-font opt_def,class-font "" "" "" ""]] \ [list [get_indep String Public] \ [list def,public-font opt_def,public-font "" "" "" ""]] \ [list [get_indep String Protected] \ [list def,protected-font opt_def,protected-font "" "" "" ""]] \ [list [get_indep String Private] \ [list def,private-font opt_def,private-font "" "" "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String CrossReference] \ [list \ [list [get_indep String StandardFont] \ [list def,xref-font opt_def,xref-font "" "" "" ""]] \ [list [get_indep String BranchFont] \ [list def,xref-branch-font opt_def,xref-branch-font "" "" "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String IncludeNoKey] \ [list \ [list [get_indep String Standard] \ [list def,include_font opt_def,include_font "" "" "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String Drawing] \ [list \ [list [get_indep String LinesTo] \ [list "" "" def,canv-line-fg opt_def,canv-line-fg "" ""]] \ [list [get_indep String LinesBy] \ [list "" "" def,xref-used-by-fg opt_def,xref-by-fg "" ""]] \ [list [get_indep String SelectedLines] \ [list "" "" def,tree-select-line opt_def,tree-select-line "" ""]] \ [list [get_indep String BranchToLines] \ [list "" "" def,xref-branch-fg opt_def,xref-branch-fg "" ""]] \ [list [get_indep String BranchByLines] \ [list "" "" def,xref-list-branch-fg opt_def,xref-list-branch-fg "" ""]] \ ] \ ] \ ]\ [list \ [list [get_indep String MultiGrep] \ [list \ [list [get_indep String Listing] \ [list def,grep-font opt_def,grep-font "" "" "" ""]] \ [list [get_indep String FoundText] \ [list def,grep-found-font opt_def,grep-found-font def,grep-found-fg opt_def,grep-found-fg "" ""]] \ ] \ ] \ ] \ [list \ [list [get_indep String OthersNoKey] \ [list \ [list [get_indep String Balloon] \ [list def,balloon-font opt_def,balloon-font \ def,balloon-fg opt_def,balloon-fg def,balloon-bg \ opt_def,balloon-bg]] \ [list [get_indep String Checkbutton] \ [list "" "" def,checkbutton-select \ opt_def,checkbutton-select "" ""]] \ ] \ ] \ ] \ ] \ ] #store the fonts/clors into a variable to test if the #user has changed something. set font_color_variables "" foreach sm ${schemes} { #categories (editor, class, ..) foreach cat [join [lrange ${sm} 1 end]] { set cents [lindex ${cat} 1] #options (text, ..) foreach ent ${cents} { foreach {ename eents} ${ent} { foreach {name opt} ${eents} { if {${name} != ""} { lappend font_color_variables ${name} } } } } } break } Color& ${ColorAndFont}.clr -schemes ${schemes} pack ${ColorAndFont}.clr -fill both -expand y -padx 10 -pady 10 lappend AvailTools ${ColorAndFont} } method RaiseColorAndFont {} { #set lastPage clrfont } ##################################################### method save_cb {what} { apply 0 ${what} switch -- ${what} { "project" { sn_save_project } "default" { save_default_settings } default { bell } } } method goto {pane} { switch -- ${pane} { "classbr" { set pane "ctree" } "retr" - "grep" - "make" { set pane "others" } } if {[catch {${NoteBook} raise ${pane}}]} { ${NoteBook} raise proj } } protected trap1 protected trap2 protected trap3 protected trap4 protected default protected perms_trap protected xref_reenabled method verify_set {var trap {def 0} {strap ""}} { global sn_options if {![info exists sn_options(opt_${var})]} { return } if {$sn_options(opt_${var}) != $sn_options(${var})} { set sn_options(${var}) $sn_options(opt_${var}) incr ${trap} if {${def}} { incr default } if {${strap} != ""} { incr ${strap} } } } method apply {{terminate 1} {from_save_as_default ""}} { global sn_options global tcl_platform global Avail_Parsers Parser_Info global opt_Parser_Info #options that can effected automaticaly set trap1 0 #options that can be effected for new windows set trap2 0 #options that can be effected after restart set trap3 0 #options that can be effected after reparsing set trap4 0 #mark if the seted variable is a part of the default settings set default 0 #to verify if the database permisions set perms_trap 0 #to tell user something about xref
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -