TKE  3.6
Advanced code editor for programmers
pref_ui Namespace Reference

Functions

 register_initialization cmd
 
 initialize_widgets
 
 get_grid_row w
 
 make_spacer w ?grid?
 
 make_cb w msg varname ?grid?
 
 make_rb w msg varname value ?grid?
 
 make_mb w msg varname values ?grid?
 
 init_mb w varname values
 
 make_entry w msg varname ?grid? ?help?
 
 make_token w msg varname watermark ?grid? ?help?
 
 init_token w varname
 
 make_text w msg varname height ?grid? ?help?
 
 init_text w varname
 
 text_modified w
 
 text_save w varname
 
 make_sb w msg varname from to inc ?grid? ?endmsg?
 
 init_sb w varname
 
 handle_sb_change w varname
 
 make_cp w msg varname start_color ?grid?
 
 init_cp w varname
 
 change_cp w varname
 
 make_fp w msg varname type ?type_args? ?grid? ?help?
 
 init_fp w varname
 
 fp_browse win varname type type_args
 
 fp_clear win varname
 
 make_table w msg varname columns height ?grid? ?help?
 
 init_table w varname cols
 
 table_add w cols varname
 
 table_delete w varname
 
 table_selected w
 
 table_left_clicked w cols x y varname
 
 table_edit_start_command varname cols w row col value
 
 table_edit_end_command varname cols w row col value
 
 make_help w msg ?grid?
 
 populate_session_menu language
 
 populate_lang_menu session
 
 select prev_session prev_language session language ?init?
 
 create session language ?panel? ?tab?
 
 pane_clicked panel ?tab?
 
 show_selected_panel
 
 show_panel panel ?tab?
 
 destroy_window
 
 check_on_close session language
 
 handle_prefs_change session language name1 name2 op
 
 show_matches value
 
 perform_search value
 
 search_select
 
 search_clear
 
 register w str var
 
 create_general w
 
 empty_string value
 
 move_to_trash_changed w
 
 set_release_type
 
 set_browse_dir value
 
 handle_var_select
 
 add_variable
 
 del_variable
 
 var_edit_end_command tbl row col value
 
 gather_var_table
 
 populate_lang_table
 
 handle_lang_left_click w x y
 
 lang_edit_end_command tbl row col value
 
 handle_share_directory
 
 handle_share_change
 
 save_share_changes
 
 create_appearance w
 
 set_colorizers
 
 set_font lbl title varname mono
 
 themes_format_visible value
 
 themes_format_imported value
 
 themes_format_date value
 
 themes_populate_table
 
 themes_selected
 
 themes_left_click W x y
 
 themes_add
 
 themes_delete
 
 themes_edit
 
 themes_get_more
 
 create_editor w
 
 set_match_chars
 
 set_snip_compl
 
 set_eol_translation
 
 create_emmet w
 
 set_css_color_case
 
 set_aliases
 
 emmet_na_edit_start_command tbl row col value
 
 emmet_na_edit_end_command tbl row col value
 
 emmet_na_show_preview alias
 
 handle_emmet_na_select
 
 emmet_na_add
 
 emmet_na_del
 
 emmet_aa_show_preview str
 
 emmet_aa_edit_end_command tbl row col value
 
 handle_emmet_aa_select
 
 emmet_aa_add
 
 emmet_aa_del
 
 create_find w
 
 create_sidebar w
 
 sidebar_set_current_width sb
 
 set_attributes
 
 create_view w
 
 create_snippets w
 
 snippets_format_snippet value
 
 snippets_search value
 
 snippets_select
 
 snippets_add
 
 snippets_edit
 
 snippets_del
 
 snippets_create_menu w
 
 snippets_set_language lang
 
 snippets_load_table lang
 
 snippets_save_table
 
 snippets_keyword_changed value
 
 snippets_text_changed
 
 snippets_insert
 
 snippets_insert_str str
 
 snippets_save
 
 snippets_cancel
 
 create_shortcuts w
 
 shortcut_search value
 
 shortcut_use_default
 
 shortcut_sym_is_funckey
 
 shortcut_changed
 
 shortcut_check_matches
 
 shortcut_show_tooltip tbl row col
 
 shortcut_hide_tooltip tbl
 
 shortcut_edit_item mnu lbl
 
 shortcut_table_select
 
 shortcut_create_modifiers
 
 shortcut_create_symbols
 
 shortcut_clear
 
 shortcut_update
 
 shortcut_save
 
 shortcut_cancel
 
 shortcut_format value
 
 populate_shortcut_table mnu ?prefix?
 
 create_plugins w
 
 handle_plugins_change plugin
 
 create_documentation w
 
 documentation_selected
 
 documentation_add
 
 docwin_validate value
 
 docwin_get_title url
 
 documentation_delete
 
 documentation_test
 
 documentation_populate
 
 documentation_save
 
 create_advanced w
 
 set_nfs_mounts
 
 nfs_edit_end_command tbl row col value
 
 nfs_add
 
 nfs_delete
 
 handle_nfs_select
 
 update_theme txt
 

Function Documentation

§ add_variable()

pref_ui::add_variable

Definition at line 1752 of file pref_ui.tcl.

1752  proc add_variable {} {
1753 
1754  variable widgets
1755 
1756  # Clear the selection and disable the delete button
1757  $widgets(var_table) selection clear 0 end
1758  $widgets(var_del) configure -state disabled
1759 
1760  # Add the new variable line
1761  set row [$widgets(var_table) insert end [list "" ""]]
1762 
1763  # Make the first entry to be editable
1764  $widgets(var_table) editcell $row,var
1765 
1766  }

§ change_cp()

pref_ui::change_cp   w varname  

Definition at line 466 of file pref_ui.tcl.

466  proc change_cp {w varname} {
467 
468  # Get the default color
469  set color [tk_chooseColor -initialcolor [[$w cget -image] cget -background] -parent .prefwin -title [msgcat::mc "Choose Color"]]
470 
471  if {$color ne ""} {
472  set pref_ui::prefs($varname) $color
473  init_cp $w $varname
474  }
475 
476  }

§ check_on_close()

pref_ui::check_on_close   session language  

Definition at line 1185 of file pref_ui.tcl.

1185  proc check_on_close {session language} {
1186 
1187  variable changes
1188 
1189  # If we are changing language preferences, there are no changes or we are specified
1190  # to not prompt the user, do nothing
1191  if {($language ne [msgcat::mc "All"]) || ([array size changes] == 0) || !$pref_ui::prefs(General/PromptCrossSessionSave)} {
1192  return 1
1193  }
1194 
1195  if {$session eq [msgcat::mc "None"]} {
1196 
1197  if {[sessions::current] ne ""} {
1198 
1199  set detail [msgcat::mc "You have changed global preferences which will not be visible because you are currently within a named session."]
1200  set answer [tk_messageBox -parent .prefwin -icon question -type yesnocancel -message [msgcat::mc "Save changes to current session?"] -detail $detail]
1201 
1202  switch $answer {
1203  "cancel" { return 0}
1204  "yes" { preferences::save_prefs "" "" [array get changes]}
1205  }
1206 
1207  }
1208 
1209  } else {
1210 
1211  set detail [msgcat::mc "You have changed the current session's preferences which will not be applied globally."]
1212  set answer [tk_messageBox -parent .prefwin -icon question -type yesnocancel -message [msgcat::mc "Save changes to global preferences?"] -detail $detail]
1213 
1214  switch $answer {
1215  "cancel" { return 0}
1216  "yes" { preferences::save_prefs [sessions::current] "" [array get changes]}
1217  }
1218 
1219  }
1220 
1221  # Clear the changes
1222  array unset changes
1223 
1224  return 1
1225 
1226  }

§ create()

pref_ui::create   session language ?panel? ?tab?  

Definition at line 947 of file pref_ui.tcl.

947  proc create {session language {panel ""} {tab ""}} {
948 
949  variable widgets
950  variable prefs
951  variable selected_session
952  variable selected_language
953 
954  if {![winfo exists .prefwin]} {
955 
956  toplevel .prefwin
957  wm title .prefwin [msgcat::mc "Preferences"]
958  wm transient .prefwin .
959  wm protocol .prefwin WM_DELETE_WINDOW [list pref_ui::destroy_window]
960  wm withdraw .prefwin
961 
962  ttk::frame .prefwin.sf
963  set widgets(select_s) [ttk::menubutton .prefwin.sf.sels -menu [set widgets(selsmenu) [menu .prefwin.sf.selectSessionMenu -tearoff 0]]]
964  set widgets(select_l) [ttk::menubutton .prefwin.sf.sell -menu [set widgets(sellmenu) [menu .prefwin.sf.selectLangMenu -tearoff 0]]]
965  set widgets(match_e) [wmarkentry::wmarkentry .prefwin.sf.e -width 30 -watermark [msgcat::mc "Search"] -validate key -validatecommand [list pref_ui::perform_search %P]]
966 
967  # Initialize the syntax menu
968  set selected_session [expr {($session eq "") ? [msgcat::mc "None"] : $session}]
969  set selected_language [expr {($language eq "") ? [msgcat::mc "All"] : $language}]
970  populate_session_menu $selected_language
971  populate_lang_menu $selected_session
972 
973  place $widgets(select_s) -relx 0 -rely 0 -relwidth 0.25
974  place $widgets(select_l) -relx 0.25 -rely 0 -relwidth 0.25
975  pack $widgets(match_e) -side right -padx 2 -pady 2
976 
977  ttk::frame .prefwin.f
978  ttk::separator .prefwin.f.hsep -orient horizontal
979  set widgets(panes) [ttk::frame .prefwin.f.bf]
980  ttk::separator .prefwin.f.vsep -orient vertical
981  set widgets(frame) [ttk::frame .prefwin.f.pf]
982 
983  set widgets(match_f) [ttk::frame .prefwin.f.mf]
984  set widgets(match_lb) [listbox .prefwin.f.mf.lb -relief flat -height 10 \
985  -borderwidth 0 -highlightthickness 0 \
986  -yscrollcommand [list utils::set_yscrollbar .prefwin.f.mf.vb]]
987  scroller::scroller .prefwin.f.mf.vb -orient vertical -command [list .prefwin.f.mf.lb yview]
988 
989  bind [.prefwin.sf.e entrytag] <Return> [list pref_ui::search_select]
990  bind [.prefwin.sf.e entrytag] <Escape> [list pref_ui::search_clear]
991  bind [.prefwin.sf.e entrytag] <Up> "::tk::ListboxUpDown $widgets(match_lb) -1; break"
992  bind [.prefwin.sf.e entrytag] <Down> "::tk::ListboxUpDown $widgets(match_lb) 1; break"
993 
994  grid rowconfigure .prefwin.f.mf 0 -weight 1
995  grid columnconfigure .prefwin.f.mf 0 -weight 1
996  grid .prefwin.f.mf.lb -row 0 -column 0 -sticky news
997  grid .prefwin.f.mf.vb -row 0 -column 1 -sticky ns
998 
999  grid rowconfigure .prefwin.f 1 -weight 1
1000  grid columnconfigure .prefwin.f 2 -weight 1
1001  grid .prefwin.f.hsep -row 0 -column 0 -sticky ew -columnspan 3
1002  grid .prefwin.f.bf -row 1 -column 0 -sticky news
1003  grid .prefwin.f.vsep -row 1 -column 1 -sticky ns -padx 15
1004  grid .prefwin.f.pf -row 1 -column 2 -sticky news
1005 
1006  pack .prefwin.sf -fill x
1007  pack .prefwin.f -fill both -expand yes
1008 
1009  # Select the given session/language information
1010  select "" "" $selected_session $selected_language 1
1011 
1012  # Create the list of panes
1013  set panes [list general [msgcat::mc "General"] appearance [msgcat::mc "Appearance"] \
1014  editor [msgcat::mc "Editor"] find [msgcat::mc "Find"] \
1015  sidebar [msgcat::mc "Sidebar"] view [msgcat::mc "View"] \
1016  snippets [msgcat::mc "Snippets"] emmet "Emmet" \
1017  shortcuts [msgcat::mc "Shortcuts"] plugins [msgcat::mc "Plugins"] \
1018  documentation [msgcat::mc "Documentation"] advanced [msgcat::mc "Advanced"]]
1019 
1020  # Create and pack each of the panes
1021  foreach {pane lbl} $panes {
1022  ttk::label $widgets(panes).$pane -compound left -image pref_$pane -text $lbl -font {-size 14}
1023  bind $widgets(panes).$pane <Button-1> [list pref_ui::pane_clicked $pane]
1024  create_$pane [set widgets($pane) [ttk::frame $widgets(frame).$pane]]
1025  }
1026 
1027  # Initialize widget values
1029 
1030  # Allow the panel dimensions to be calculatable
1031  update
1032 
1033  # Get the requested panel dimensions
1034  foreach {pane lbl} $panes {
1035  lappend pheights [winfo reqheight $widgets($pane)]
1036  lappend pwidths [winfo reqwidth $widgets($pane)]
1037  lappend lwidths [winfo reqwidth $widgets(panes).$pane]
1038  }
1039 
1040  # Calculate the geometry
1041  set win_width [expr [lindex [lsort -integer $pwidths] end] + [winfo reqwidth .prefwin.f.vsep] + [lindex [lsort -integer $lwidths] end]]
1042  set win_height [expr [lindex [lsort -integer $pheights] end] + [winfo reqheight .prefwin.f.hsep] + [winfo reqheight .prefwin.sf]]
1043  set win_x [expr [winfo rootx .] + (([winfo width .] - $win_width) / 2)]
1044  set win_y [expr [winfo rooty .] + (([winfo height .] - $win_height) / 2)]
1045 
1046  # Set the minimum size of the window and center it on the main window
1047  wm geometry .prefwin ${win_width}x${win_height}+${win_x}+${win_y}
1048  wm resizable .prefwin 0 0
1049 
1050  # Emulate a click on the General panel
1051  if {$language ne ""} {
1052  if {$session eq ""} {
1053  foreach item [list editor snippets] {
1054  pack $widgets(panes).$item -fill both -padx 2 -pady 2
1055  }
1056  } else {
1057  pack $widgets(panes).editor -fill both -padx 2 -pady 2
1058  }
1059  if {$panel ne ""} {
1060  pane_clicked $panel $tab
1061  } else {
1062  pane_clicked editor
1063  }
1064  } elseif {$session ne ""} {
1065  foreach item [list appearance editor find sidebar view emmet] {
1066  pack $widgets(panes).$item -fill both -padx 2 -pady 2
1067  }
1068  $widgets(frame).emmet.nb hide $widgets(node_aliases)
1069  $widgets(frame).emmet.nb hide $widgets(abbr_aliases)
1070  pane_clicked appearance
1071  } else {
1072  foreach item [list general appearance editor find sidebar view snippets emmet shortcuts plugins advanced] {
1073  pack $widgets(panes).$item -fill both -padx 2 -pady 2
1074  }
1075  if {$panel ne ""} {
1076  pane_clicked $panel $tab
1077  } else {
1078  pane_clicked general
1079  }
1080  }
1081 
1082  # Give the search panel the focus
1083  focus .prefwin.sf.e
1084 
1085  # Show the window
1086  wm deiconify .prefwin
1087 
1088  }
1089 
1090  }

§ create_advanced()

pref_ui::create_advanced   w  

Definition at line 4579 of file pref_ui.tcl.

4579  proc create_advanced {w} {
4580 
4581  variable widgets
4582  variable prefs
4583 
4584  ttk::notebook $w.nb
4585 
4586  ###########
4587  # GENERAL #
4588  ###########
4589 
4590  $w.nb add [set a [ttk::frame $w.nb.a]] -text [msgcat::mc "General"]
4591 
4592  make_mb $a.dme [msgcat::mc "Default Markdown Export Extension"] General/DefaultMarkdownExportExtension [list html htm xhtml] 1
4593  make_spacer $a 1
4594  make_fp $a.dted [msgcat::mc "Default Theme Export Directory"] General/DefaultThemeExportDirectory dir {} 1
4595  make_fp $a.dped [msgcat::mc "Default Plugin Export Directory"] General/DefaultPluginExportDirectory dir {} 1
4596 
4597  ###############
4598  # DEVELOPMENT #
4599  ###############
4600 
4601  $w.nb add [set b [ttk::frame $w.nb.b]] -text [msgcat::mc "Development"]
4602 
4603  make_cb $b.dm [msgcat::mc "Enable development mode"] Debug/DevelopmentMode
4604  make_cb $b.sdl [msgcat::mc "Show diagnostic logfile at startup"] Debug/ShowDiagnosticLogfileAtStartup
4605  make_cb $b.sc [msgcat::mc "Show Tcl console at startup"] View/ShowConsole
4606  make_spacer $b
4607 
4608  make_fp $b.ld [msgcat::mc "Logfile Directory"] Debug/LogDirectory dir [list -title [msgcat::mc "Choose Logfile Directory"]]
4609 
4610  make_spacer $b
4611 
4612  ttk::labelframe $b.pf -text [msgcat::mc "Profiler Options"]
4613  make_mb $b.pf.prs [msgcat::mc "Sorting Column"] Tools/ProfileReportSortby [list calls real cpu real_per_call cpu_per_call]
4614  make_spacer $b.pf
4615  make_entry $b.pf.pro [msgcat::mc "Report Options"] Tools/ProfileReportOptions
4616  pack $b.pf -fill x -padx 2 -pady 10
4617 
4618  ##############
4619  # NFS MOUNTS #
4620  ##############
4621 
4622  $w.nb add [set c [ttk::frame $w.nb.c]] -text [set wstr [format "NFS %s" [msgcat::mc "Mounts"]]]
4623 
4624  ttk::frame $c.f
4625  set widgets(advanced_tl) [tablelist::tablelist $c.f.tl \
4626  -columns [list 0 [msgcat::mc "Host"] 0 [format "NFS %s" [msgcat::mc "Base Directory"]] 0 [msgcat::mc "Remote Base Directory"]] \
4627  -exportselection 0 -stretch all -editselectedonly 1 -showseparators 1 \
4628  -borderwidth 0 -highlightthickness 0 \
4629  -editendcommand [list pref_ui::nfs_edit_end_command] \
4630  -xscrollcommand [list utils::set_xscrollbar $c.f.hb] \
4631  -yscrollcommand [list utils::set_yscrollbar $c.f.vb]]
4632  scroller::scroller $c.f.vb -orient vertical -command [list $c.f.tl yview]
4633  scroller::scroller $c.f.hb -orient horizontal -command [list $c.f.tl xview]
4634 
4635  register $widgets(advanced_tl) $wstr NFSMounts
4636 
4637  utils::tablelist_configure $widgets(advanced_tl)
4638 
4639  $widgets(advanced_tl) columnconfigure 0 -name host -editable 1 -resizable 1 -stretchable 1
4640  $widgets(advanced_tl) columnconfigure 1 -name nfs -editable 1 -resizable 1 -stretchable 1
4641  $widgets(advanced_tl) columnconfigure 2 -name remote -editable 1 -resizable 1 -stretchable 1
4642 
4643  bind $widgets(advanced_tl) <<TablelistSelect>> [list pref_ui::handle_nfs_select]
4644 
4645  grid rowconfigure $c.f 1 -weight 1
4646  grid columnconfigure $c.f 0 -weight 1
4647  grid $c.f.tl -row 0 -column 0 -sticky news -rowspan 2
4648  grid [$c.f.tl cornerpath] -row 0 -column 1 -sticky news
4649  grid $c.f.vb -row 1 -column 1 -sticky ns
4650  grid $c.f.hb -row 2 -column 0 -sticky ew
4651 
4652  ttk::frame $c.bf
4653  set widgets(advanced_nfs_add) [ttk::button $c.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::nfs_add]]
4654  set widgets(advanced_nfs_del) [ttk::button $c.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::nfs_delete] -state disabled]
4655 
4656  pack $c.bf.add -side left -padx 2 -pady 2
4657  pack $c.bf.del -side left -padx 2 -pady 2
4658 
4659  pack $c.f -fill both -expand yes
4660  pack $c.bf -fill x
4661 
4662  pack $w.nb -fill both -expand yes
4663 
4664  # Initialize widget values
4665  foreach {host values} $prefs(NFSMounts) {
4666  lassign $values nfs_mount remote_mount
4667  $widgets(advanced_tl) insert end [list $host $nfs_mount $remote_mount]
4668  }
4669 
4670  ##################
4671  # PROXY SETTINGS #
4672  ##################
4673 
4674  $w.nb add [set d [ttk::frame $w.nb.d]] -text [set wstr [msgcat::mc "Proxy Settings"]]
4675 
4676  make_entry $d.ph [msgcat::mc "Proxy Host"] General/ProxyHost
4677  make_entry $d.pp [msgcat::mc "Proxy Port"] General/ProxyPort
4678  make_help $d [msgcat::mc "Proxy settings are used when URL requests need to be made by TKE. If you do not require a proxy server, leave these entries empty."]
4679 
4680  }

§ create_appearance()

pref_ui::create_appearance   w  

Definition at line 1980 of file pref_ui.tcl.

1980  proc create_appearance {w} {
1981 
1982  variable widgets
1983  variable colorizers
1984  variable prefs
1985 
1986  pack [ttk::notebook $w.nb] -fill both -expand yes
1987 
1988  ###########
1989  # GENERAL #
1990  ###########
1991 
1992  $w.nb add [set a [ttk::frame $w.nb.a]] -text [msgcat::mc "General"]
1993 
1994  ttk::frame $a.f
1995  set widgets(appear_theme) [make_mb $a.f.th [msgcat::mc "Default theme"] Appearance/Theme [themes::get_visible_themes] 1]
1996  make_sb $a.f.icw [msgcat::mc "Insertion cursor width"] Appearance/CursorWidth 1 5 1 1
1997  make_sb $a.f.els [msgcat::mc "Additional space between lines"] Appearance/ExtraLineSpacing 0 10 1 1
1998 
1999  ttk::labelframe $a.cf -text [set wstr [msgcat::mc "Syntax Coloring"]]
2000 
2001  # Pack the colorizer frame
2002  set i 0
2003  set colorize $prefs(Appearance/Colorize)
2004  foreach type [lsort [array names colorizers]] {
2005  set colorizers($type) [expr {[lsearch $colorize $type] != -1}]
2006  grid [ttk::checkbutton $a.cf.$type -text " $type" -variable pref_ui::colorizers($type) -command [list pref_ui::set_colorizers]] -row [expr $i % 3] -column [expr $i / 3] -sticky news -padx 2 -pady 2
2007  incr i
2008  }
2009 
2010  # Register the widget
2011  register $a.cf.$type $wstr Appearance/Colorize
2012 
2013  # Create fonts frame
2014  ttk::labelframe $a.ff -text [msgcat::mc "Fonts"]
2015  ttk::label $a.ff.l0 -text [format "%s: " [msgcat::mc "Editor"]]
2016  ttk::label $a.ff.f0 -text "AaBbCc0123" -font $prefs(Appearance/EditorFont)
2017  ttk::button $a.ff.b0 -style BButton -text [msgcat::mc "Choose"] -command [list pref_ui::set_font $a.ff.f0 [msgcat::mc "Select Editor Font"] Appearance/EditorFont 1]
2018  ttk::label $a.ff.l1 -text [format "%s: " [msgcat::mc "Command launcher entry"]]
2019  ttk::label $a.ff.f1 -text "AaBbCc0123" -font $prefs(Appearance/CommandLauncherEntryFont)
2020  ttk::button $a.ff.b1 -style BButton -text [msgcat::mc "Choose"] -command [list pref_ui::set_font $a.ff.f1 [msgcat::mc "Select Command Launcher Entry Font"] Appearance/CommandLauncherEntryFont 0]
2021  ttk::label $a.ff.l2 -text [format "%s: " [msgcat::mc "Command launcher preview"]]
2022  ttk::label $a.ff.f2 -text "AaBbCc0123" -font $prefs(Appearance/CommandLauncherPreviewFont)
2023  ttk::button $a.ff.b2 -style BButton -text [msgcat::mc "Choose"] -command [list pref_ui::set_font $a.ff.f2 [msgcat::mc "Select Command Launcher Preview Font"] Appearance/CommandLauncherPreviewFont 0]
2024 
2025  # Register the widgets for search
2026  register $a.ff.b0 "" Appearance/EditorFont
2027  register $a.ff.b1 "" Appearance/CommandLauncherEntryFont
2028  register $a.ff.b2 "" Appearance/CommandLauncherPreviewFont
2029 
2030  grid columnconfigure $a.ff 1 -weight 1
2031  grid $a.ff.l0 -row 0 -column 0 -sticky news -padx 2 -pady 2
2032  grid $a.ff.f0 -row 0 -column 1 -sticky news -padx 2 -pady 2
2033  grid $a.ff.b0 -row 0 -column 2 -sticky news -padx 2 -pady 2
2034  grid $a.ff.l1 -row 1 -column 0 -sticky news -padx 2 -pady 2
2035  grid $a.ff.f1 -row 1 -column 1 -sticky news -padx 2 -pady 2
2036  grid $a.ff.b1 -row 1 -column 2 -sticky news -padx 2 -pady 2
2037  grid $a.ff.l2 -row 2 -column 0 -sticky news -padx 2 -pady 2
2038  grid $a.ff.f2 -row 2 -column 1 -sticky news -padx 2 -pady 2
2039  grid $a.ff.b2 -row 2 -column 2 -sticky news -padx 2 -pady 2
2040 
2041  pack $a.f -fill x -padx 2 -pady 2
2042  make_spacer $a
2043  pack $a.cf -fill x -padx 2 -pady 4
2044  make_spacer $a
2045  pack $a.ff -fill x -padx 2 -pady 4
2046 
2047  make_spacer $a
2048  make_cb $a.cl_pos [msgcat::mc "Remember last position of command launcher"] Appearance/CommandLauncherRememberLastPosition
2049 
2050  ##########
2051  # THEMES #
2052  ##########
2053 
2054  $w.nb add [set b [ttk::frame $w.nb.b]] -text [msgcat::mc "Manage Themes"]
2055 
2056  ttk::frame $b.tf
2057  set widgets(themes_tl) [tablelist::tablelist $b.tf.tl \
2058  -columns [list 0 [msgcat::mc "Name"] 0 [msgcat::mc "Visible"] center 0 [msgcat::mc "Imported"] center 0 [msgcat::mc "Creator"] 0 [msgcat::mc "Date"]] \
2059  -exportselection 0 -stretch all -borderwidth 0 -highlightthickness 0 \
2060  -labelcommand tablelist::sortByColumn \
2061  -xscrollcommand [list utils::set_xscrollbar $b.tf.hb] \
2062  -yscrollcommand [list utils::set_yscrollbar $b.tf.vb]]
2063  scroller::scroller $b.tf.vb -orient vertical -command [list $b.tf.tl yview]
2064  scroller::scroller $b.tf.hb -orient horizontal -command [list $b.tf.tl xview]
2065 
2067 
2068  $widgets(themes_tl) columnconfigure 0 -name name -editable 0
2069  $widgets(themes_tl) columnconfigure 1 -name visible -editable 0 -stretchable 0 -resizable 0 -formatcommand [list pref_ui::themes_format_visible]
2070  $widgets(themes_tl) columnconfigure 2 -name imported -editable 0 -stretchable 0 -resizable 0 -formatcommand [list pref_ui::themes_format_imported]
2071  $widgets(themes_tl) columnconfigure 3 -name creator -editable 0
2072  $widgets(themes_tl) columnconfigure 4 -name date -editable 0 -formatcommand [list pref_ui::themes_format_date]
2073 
2074  bind $widgets(themes_tl) <<TablelistSelect>> [list pref_ui::themes_selected]
2075  bind [$widgets(themes_tl) bodytag] <Button-1> [list pref_ui::themes_left_click %W %x %y]
2076 
2077  grid rowconfigure $b.tf 1 -weight 1
2078  grid columnconfigure $b.tf 0 -weight 1
2079  grid $b.tf.tl -row 0 -column 0 -sticky news -rowspan 2
2080  grid [$b.tf.tl cornerpath] -row 0 -column 1 -sticky news
2081  grid $b.tf.vb -row 1 -column 1 -sticky ns
2082  grid $b.tf.hb -row 2 -column 0 -sticky ew
2083 
2084  ttk::frame $b.bf
2085  ttk::button $b.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::themes_add]
2086  set widgets(themes_del) [ttk::button $b.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::themes_delete] -state disabled]
2087  set widgets(themes_edit) [ttk::button $b.bf.edit -style BButton -text [msgcat::mc "Edit"] -command [list pref_ui::themes_edit] -state disabled]
2088  ttk::button $b.bf.more -style BButton -text [format "%s..." [msgcat::mc "Get More Themes"]] -command [list pref_ui::themes_get_more]
2089 
2090  pack $b.bf.add -side left -padx 2 -pady 2
2091  pack $b.bf.del -side left -padx 2 -pady 2
2092  pack $b.bf.edit -side left -padx 2 -pady 2
2093  pack $b.bf.more -side right -padx 2 -pady 2
2094 
2095  pack $b.tf -fill both -expand yes
2096  pack $b.bf -fill x
2097 
2098  # Register the Appearance/HiddenThemes preference
2099  register $widgets(themes_tl) [msgcat::mc "Manage theme visibility"] Appearance/HiddenThemes
2100 
2101  # Populate the themes table
2103 
2104  }

§ create_documentation()

pref_ui::create_documentation   w  

Definition at line 4332 of file pref_ui.tcl.

4332  proc create_documentation {w} {
4333 
4334  variable widgets
4335  variable prefs
4336 
4337  ttk::frame $w.tf
4338  set widgets(doc,table) [tablelist::tablelist $w.tf.tl \
4339  -columns [list 0 [msgcat::mc "Name"] 0 URL] \
4340  -exportselection 0 -stretch all -editselectedonly 1 \
4341  -borderwidth 0 -highlightthickness 0 \
4342  -movablerows 1 -movecursor [ttk::cursor move] -selectmode single \
4343  -yscrollcommand [list utils::set_yscrollbar $w.tf.vb]]
4344  scroller::scroller $w.tf.vb -orient vertical -command [list $w.tf.tl yview]
4345 
4347 
4348  $w.tf.tl columnconfigure 0 -name name -editable 1 -resizable 1 -stretchable 1
4349  $w.tf.tl columnconfigure 1 -name url -editable 1 -resizable 1 -stretchable 1
4350 
4351  bind $w.tf.tl <<TablelistSelect>> [list pref_ui::documentation_selected]
4352  bind $w.tf.tl <<TablelistCellUpdated>> [list pref_ui::documentation_save]
4353  bind $w.tf.tl <<TablelistRowMoved>> [list pref_ui::documentation_save]
4354 
4355  grid rowconfigure $w.tf 1 -weight 1
4356  grid columnconfigure $w.tf 0 -weight 1
4357  grid $w.tf.tl -row 0 -column 0 -sticky news -rowspan 2
4358  grid [$w.tf.tl cornerpath] -row 0 -column 1 -sticky news
4359  grid $w.tf.vb -row 1 -column 1 -sticky ns
4360 
4361  ttk::frame $w.bf
4362  ttk::button $w.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::documentation_add]
4363  set widgets(doc,delete) [ttk::button $w.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::documentation_delete] -state disabled]
4364  set widgets(doc,test) [ttk::button $w.bf.test -style BButton -text [msgcat::mc "Test"] -command [list pref_ui::documentation_test] -state disabled]
4365 
4366  pack $w.bf.add -side left -padx 2 -pady 2
4367  pack $w.bf.del -side left -padx 2 -pady 2
4368  pack $w.bf.test -side right -padx 2 -pady 2
4369 
4370  pack $w.tf -fill both -expand yes
4371  pack $w.bf -fill x
4372 
4373  # Register the table
4374  register $w.tf.tl [msgcat::mc "Language Documentation"] Documentation/References
4375 
4376  # Initialize the table on initialization
4377  register_initialization pref_ui::documentation_populate
4378 
4379  }

§ create_editor()

pref_ui::create_editor   w  

Definition at line 2334 of file pref_ui.tcl.

2334  proc create_editor {w} {
2335 
2336  variable widgets
2337  variable match_chars
2338  variable snip_compl
2339  variable prefs
2340 
2341  ttk::frame $w.sf
2342  make_sb $w.sf.ww [msgcat::mc "Ruler column"] Editor/WarningWidth 20 150 5 1
2343  make_sb $w.sf.spt [msgcat::mc "Spaces per tab"] Editor/SpacesPerTab 1 20 1 1
2344  make_sb $w.sf.is [msgcat::mc "Indentation spaces"] Editor/IndentSpaces 1 20 1 1
2345  make_sb $w.sf.mu [msgcat::mc "Maximum undo history (set to 0 for unlimited)"] Editor/MaxUndo 0 200 10 1
2346  make_sb $w.sf.chd [msgcat::mc "Clipboard history depth"] Editor/ClipboardHistoryDepth 1 30 1 1
2347  make_sb $w.sf.vml [msgcat::mc "Line count to find Vim modeline information"] Editor/VimModelines 0 20 1 1
2348 
2349  ttk::label $w.sf.eoll -text [format "%s: " [set wstr [msgcat::mc "End-of-line character when saving"]]]
2350  set widgets(editor_eolmb) [ttk::menubutton $w.sf.eolmb -menu [menu $w.sf.eol -tearoff 0]]
2351 
2352  make_mb $w.sf.lna [msgcat::mc "Line number alignment"] Editor/LineNumberAlignment [list left right] 1
2353 
2354  foreach {value desc} [list \
2355  auto [msgcat::mc "Use original EOL character from file"] \
2356  sys [msgcat::mc "Use appropriate EOL character on system"] \
2357  cr [msgcat::mc "Use single carriage return character"] \
2358  crlf [msgcat::mc "Use carriate return linefeed sequence"] \
2359  lf [msgcat::mc "Use linefeed character"]] {
2360  $w.sf.eol add radiobutton -label $desc -value $value -variable pref_ui::prefs(Editor/EndOfLineTranslation) -command [list pref_ui::set_eol_translation]
2361  }
2362 
2363  register $widgets(editor_eolmb) $wstr Editor/EndOfLineTranslation
2364 
2365  grid $w.sf.eoll -row 7 -column 0 -sticky news -padx 2 -pady 2
2366  grid $w.sf.eolmb -row 7 -column 1 -sticky news -padx 2 -pady 2
2367 
2368  ttk::labelframe $w.mcf -text [set wstr [msgcat::mc "Auto-match Characters"]]
2369  ttk::checkbutton $w.mcf.sr -text [format " %s" [msgcat::mc "Square bracket"]] -variable pref_ui::match_chars(square) -command [list pref_ui::set_match_chars]
2370  ttk::checkbutton $w.mcf.cu -text [format " %s" [msgcat::mc "Curly bracket"]] -variable pref_ui::match_chars(curly) -command [list pref_ui::set_match_chars]
2371  ttk::checkbutton $w.mcf.an -text [format " %s" [msgcat::mc "Angled bracket"]] -variable pref_ui::match_chars(angled) -command [list pref_ui::set_match_chars]
2372  ttk::checkbutton $w.mcf.pa -text [format " %s" [msgcat::mc "Parenthesis"]] -variable pref_ui::match_chars(paren) -command [list pref_ui::set_match_chars]
2373  ttk::checkbutton $w.mcf.dq -text [format " %s" [msgcat::mc "Double-quote"]] -variable pref_ui::match_chars(double) -command [list pref_ui::set_match_chars]
2374  ttk::checkbutton $w.mcf.sq -text [format " %s" [msgcat::mc "Single-quote"]] -variable pref_ui::match_chars(single) -command [list pref_ui::set_match_chars]
2375  ttk::checkbutton $w.mcf.bt -text [format " %s" [msgcat::mc "Backtick"]] -variable pref_ui::match_chars(btick) -command [list pref_ui::set_match_chars]
2376 
2377  register $w.mcf.sr $wstr Editor/AutoMatchChars
2378 
2379  grid columnconfigure $w.mcf 1 -weight 1
2380  grid columnconfigure $w.mcf 3 -weight 1
2381  grid columnconfigure $w.mcf 5 -weight 1
2382  grid $w.mcf.sr -row 0 -column 0 -sticky news -padx 2 -pady 2
2383  grid $w.mcf.cu -row 0 -column 2 -sticky news -padx 2 -pady 2
2384  grid $w.mcf.an -row 0 -column 4 -sticky news -padx 2 -pady 2
2385  grid $w.mcf.pa -row 0 -column 6 -sticky news -padx 2 -pady 2
2386  grid $w.mcf.dq -row 1 -column 0 -sticky news -padx 2 -pady 2
2387  grid $w.mcf.sq -row 1 -column 2 -sticky news -padx 2 -pady 2
2388  grid $w.mcf.bt -row 1 -column 4 -sticky news -padx 2 -pady 2
2389 
2390  ttk::frame $w.cf
2391  make_cb $w.cf.vm [msgcat::mc "Enable Vim Mode"] Editor/VimMode
2392  make_cb $w.cf.eai [msgcat::mc "Enable auto-indentation"] Editor/EnableAutoIndent
2393  make_cb $w.cf.hmc [msgcat::mc "Automatically highlight matching bracket"] Editor/HighlightMatchingChar
2394  make_cb $w.cf.hmmb [msgcat::mc "Automatically highlight mismatching brackets"] Editor/HighlightMismatchingChar
2395  make_cb $w.cf.rtw [msgcat::mc "Remove trailing whitespace on save"] Editor/RemoveTrailingWhitespace
2396  make_cb $w.cf.rln [msgcat::mc "Enable relative line numbering"] Editor/RelativeLineNumbers
2397 
2398  pack $w.sf -fill x -padx 2 -pady 2
2399  make_spacer $w
2400  pack $w.mcf -fill x -padx 2 -pady 2
2401  make_spacer $w
2402  pack $w.cf -fill x -padx 2 -pady 2
2403 
2404  # Set the UI state to match preference
2405  foreach char [list square curly angled paren double single btick] {
2406  set match_chars($char) [expr {[lsearch $prefs(Editor/AutoMatchChars) $char] != -1}]
2407  }
2408 
2409  foreach char [list space tab return] {
2410  set snip_compl($char) [expr {[lsearch $prefs(Editor/SnippetCompleters) $char] != -1}]
2411  }
2412 
2414 
2415  }

§ create_emmet()

pref_ui::create_emmet   w  

Definition at line 2471 of file pref_ui.tcl.

2471  proc create_emmet {w} {
2472 
2473  variable widgets
2474  variable prefs
2475 
2476  ttk::notebook $w.nb
2477 
2478  ###########
2479  # GENERAL #
2480  ###########
2481 
2482  $w.nb add [set a [ttk::frame $w.nb.gf]] -text [msgcat::mc "General"]
2483 
2484  make_cb $a.aivp [msgcat::mc "Automatically insert vendor prefixes"] Emmet/CSSAutoInsertVendorPrefixes
2485  make_cb $a.cs [msgcat::mc "Use shortened colors"] Emmet/CSSColorShort
2486  make_cb $a.fs [msgcat::mc "Enable fuzzy search"] Emmet/CSSFuzzySearch
2487 
2488  make_spacer $a
2489 
2490  ttk::frame $a.of
2491  ttk::label $a.of.ccl -text [format "%s: " [set wstr [msgcat::mc "Color value case"]]]
2492  set widgets(emmet_ccmb) [ttk::menubutton $a.of.ccmb -menu [menu $a.of.ccmb_mnu -tearoff 0]]
2493 
2494  foreach {value lbl} [list upper [msgcat::mc "Convert to uppercase"] \
2495  lower [msgcat::mc "Convert to lowercase"] \
2496  keep [msgcat::mc "Retain case"]] {
2497  $a.of.ccmb_mnu add radiobutton -label $lbl -value $value -variable pref_ui::prefs(Emmet/CSSColorCase) -command [list pref_ui::set_css_color_case]
2498  }
2499 
2500  register $widgets(emmet_ccmb) $wstr Emmet/CSSColorCase
2501 
2502  pack $a.of.ccl -side left -padx 2 -pady 2
2503  pack $a.of.ccmb -side left -padx 2 -pady 2
2504  pack $a.of -fill x
2505 
2506  make_spacer $a
2507  make_entry $a.iu [msgcat::mc "Default unit for integer values"] Emmet/CSSIntUnit
2508  make_entry $a.fu [msgcat::mc "Default unit for floating point values"] Emmet/CSSFloatUnit
2509  make_entry $a.vs [msgcat::mc "Symbol between CSS property and value"] Emmet/CSSValueSeparator
2510  make_entry $a.pe [msgcat::mc "Symbol placed at end of CSS property"] Emmet/CSSPropertyEnd
2511 
2512  ##########
2513  # ADDONS #
2514  ##########
2515 
2516  $w.nb add [set b [ttk::frame $w.nb.af]] -text [msgcat::mc "Addons"]
2517 
2518  foreach {type var} {
2519  Mozilla Emmet/CSSMozPropertiesAddon \
2520  MS Emmet/CSSMSPropertiesAddon \
2521  Opera Emmet/CSSOPropertiesAddon \
2522  Webkit Emmet/CSSWebkitPropertiesAddon} {
2523  make_token $b.[string tolower $type] [format "$type %s" [msgcat::mc "Properties"]] $var ""
2524  }
2525 
2526  ################
2527  # NODE ALIASES #
2528  ################
2529 
2530  $w.nb add [set widgets(node_aliases) [set c [ttk::frame $w.nb.nf]]] -text [set wstr [msgcat::mc "Node Aliases"]]
2531 
2532  ttk::frame $c.tf
2533  set widgets(emmet_na_tl) [tablelist::tablelist $c.tf.tl \
2534  -columns [list 0 [msgcat::mc "Alias"] 0 [msgcat::mc "Node"] 0 [msgcat::mc "Closing"] 0 [msgcat::mc "Attributes"]] \
2535  -exportselection 0 -editselectedonly 1 -stretch all \
2536  -borderwidth 0 -highlightthickness 0 \
2537  -editstartcommand [list pref_ui::emmet_na_edit_start_command] \
2538  -editendcommand [list pref_ui::emmet_na_edit_end_command] \
2539  -xscrollcommand [list utils::set_xscrollbar $c.tf.hb] \
2540  -yscrollcommand [list utils::set_yscrollbar $c.tf.vb]]
2541  scroller::scroller $c.tf.vb -orient vertical -command [list $widgets(emmet_na_tl) yview]
2542  scroller::scroller $c.tf.hb -orient horizontal -command [list $widgets(emmet_na_tl) xview]
2543 
2544  $widgets(emmet_na_tl) columnconfigure 0 -name alias -editable 1 -stretchable 1 -resizable 1
2545  $widgets(emmet_na_tl) columnconfigure 1 -name name -editable 1 -stretchable 1 -resizable 1
2546  $widgets(emmet_na_tl) columnconfigure 2 -name ending -editable 1 -stretchable 0 -resizable 1 \
2547  -editwindow ttk::menubutton
2548  $widgets(emmet_na_tl) columnconfigure 3 -name attrs -editable 1 -stretchable 1 -resizable 1
2549 
2550  bind $widgets(emmet_na_tl) <<TablelistSelect>> [list pref_ui::handle_emmet_na_select]
2551 
2552  grid rowconfigure $c.tf 1 -weight 1
2553  grid columnconfigure $c.tf 0 -weight 1
2554  grid $c.tf.tl -row 0 -column 0 -sticky news -rowspan 2
2555  grid [$c.tf.tl cornerpath] -row 0 -column 1 -sticky news
2556  grid $c.tf.vb -row 1 -column 1 -sticky ns
2557  grid $c.tf.hb -row 2 -column 0 -sticky ew
2558 
2559  ttk::frame $c.bf
2560  ttk::button $c.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::emmet_na_add]
2561  set widgets(emmet_na_del) [ttk::button $c.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::emmet_na_del] -state disabled]
2562 
2563  pack $c.bf.add -side left -padx 2 -pady 2
2564  pack $c.bf.del -side left -padx 2 -pady 2
2565 
2566  array set sb_opts [theme::get_category_options text_scrollbar 1]
2567 
2568  ttk::labelframe $c.lf -text [msgcat::mc "Preview"]
2569  frame $c.lf.f
2570  set widgets(emmet_na_preview) [ctext $c.lf.f.t -height 10 -state disabled \
2571  -xscrollcommand [list $c.lf.f.hb set] -yscrollcommand [list $c.lf.f.vb set]]
2572  scroller::scroller $c.lf.f.vb {*}[array get sb_opts] -orient vertical -autohide 1 -command [list $c.lf.f.t yview]
2573  scroller::scroller $c.lf.f.hb {*}[array get sb_opts] -orient horizontal -autohide 0 -command [list $c.lf.f.t xview]
2574 
2575  update_theme $widgets(emmet_na_preview)
2576 
2577  theme::register_widget $widgets(emmet_na_preview) syntax_prefs
2578  theme::register_widget $c.lf.f.vb text_scrollbar
2579  theme::register_widget $c.lf.f.hb text_scrollbar
2580 
2581  indent::add_bindings $widgets(emmet_na_preview)
2582  syntax::set_language $widgets(emmet_na_preview) "HTML"
2583 
2584  # This is needed to keep the modified event from being handled by the editing buffers
2585  bind $widgets(emmet_na_preview) <<Modified>> "break"
2586 
2587  grid rowconfigure $c.lf.f 0 -weight 1
2588  grid columnconfigure $c.lf.f 0 -weight 1
2589  grid $c.lf.f.t -row 0 -column 0 -sticky news
2590  grid $c.lf.f.vb -row 0 -column 1 -sticky ns
2591  grid $c.lf.f.hb -row 1 -column 0 -sticky ew
2592 
2593  pack $c.lf.f -fill both -expand yes
2594 
2595  pack $c.tf -padx 2 -pady 2 -fill both -expand yes
2596  pack $c.bf -padx 2 -pady 2 -fill x
2597  pack [ttk::separator $c.sep -orient horizontal] -padx 2 -pady 2 -fill x -expand yes
2598  pack $c.lf -padx 2 -pady 2 -fill x
2599 
2600  register $c.tf.tl $wstr Emmet/NodeAliases
2601 
2602  ########################
2603  # ABBREVIATION ALIASES #
2604  ########################
2605 
2606  $w.nb add [set widgets(abbr_aliases) [set d [ttk::frame $w.nb.vf]]] -text [set wstr [msgcat::mc "Abbreviation Aliases"]]
2607 
2608  ttk::frame $d.tf
2609  set widgets(emmet_aa_tl) [tablelist::tablelist $d.tf.tl \
2610  -columns [list 0 [msgcat::mc "Alias"] 0 [msgcat::mc "Value"]] \
2611  -exportselection 0 -stretch all -editselectedonly 1 \
2612  -borderwidth 0 -highlightthickness 0 \
2613  -editendcommand [list pref_ui::emmet_aa_edit_end_command] \
2614  -xscrollcommand [list utils::set_xscrollbar $d.tf.hb] \
2615  -yscrollcommand [list utils::set_yscrollbar $d.tf.vb]]
2616  scroller::scroller $d.tf.vb -orient vertical -command [list $d.tf.tl yview]
2617  scroller::scroller $d.tf.hb -orient horizontal -command [list $d.tf.tl xview]
2618 
2619  $widgets(emmet_aa_tl) columnconfigure 0 -name alias -editable 1 -resizable 1 -stretchable 0
2620  $widgets(emmet_aa_tl) columnconfigure 1 -name value -editable 1 -resizable 1 -stretchable 1
2621 
2622  bind $widgets(emmet_aa_tl) <<TablelistSelect>> [list pref_ui::handle_emmet_aa_select]
2623 
2624  grid rowconfigure $d.tf 1 -weight 1
2625  grid columnconfigure $d.tf 0 -weight 1
2626  grid $d.tf.tl -row 0 -column 0 -sticky news -rowspan 2
2627  grid [$d.tf.tl cornerpath] -row 0 -column 1 -sticky news
2628  grid $d.tf.vb -row 1 -column 1 -sticky ns
2629  grid $d.tf.hb -row 2 -column 0 -sticky ew
2630 
2631  ttk::frame $d.bf
2632  ttk::button $d.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::emmet_aa_add]
2633  set widgets(emmet_aa_del) [ttk::button $d.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::emmet_aa_del] -state disabled]
2634 
2635  pack $d.bf.add -side left -padx 2 -pady 2
2636  pack $d.bf.del -side left -padx 2 -pady 2
2637 
2638  array set sb_opts [theme::get_category_options text_scrollbar 1]
2639 
2640  ttk::labelframe $d.lf -text [msgcat::mc "Preview"]
2641  frame $d.lf.f
2642  set widgets(emmet_aa_preview) [ctext $d.lf.f.t -height 10 -state disabled \
2643  -xscrollcommand [list $d.lf.f.hb set] -yscrollcommand [list $d.lf.f.vb set]]
2644  scroller::scroller $d.lf.f.vb {*}[array get sb_opts] -orient vertical -autohide 1 -command [list $d.lf.f.t yview]
2645  scroller::scroller $d.lf.f.hb {*}[array get sb_opts] -orient horizontal -autohide 0 -command [list $d.lf.f.t xview]
2646 
2647  update_theme $widgets(emmet_aa_preview)
2648 
2649  theme::register_widget $widgets(emmet_aa_preview) syntax_prefs
2650  theme::register_widget $d.lf.f.vb text_scrollbar
2651  theme::register_widget $d.lf.f.hb text_scrollbar
2652 
2653  indent::add_bindings $widgets(emmet_aa_preview)
2654  syntax::set_language $widgets(emmet_aa_preview) "HTML"
2655 
2656  # This is needed to keep the modified event from being handled by the editing buffers
2657  bind $widgets(emmet_aa_preview) <<Modified>> "break"
2658 
2659  grid rowconfigure $d.lf.f 0 -weight 1
2660  grid columnconfigure $d.lf.f 0 -weight 1
2661  grid $d.lf.f.t -row 0 -column 0 -sticky news
2662  grid $d.lf.f.vb -row 0 -column 1 -sticky ns
2663  grid $d.lf.f.hb -row 1 -column 0 -sticky ew
2664 
2665  pack $d.lf.f -fill both -expand yes
2666 
2667  pack $d.tf -padx 2 -pady 2 -fill both -expand yes
2668  pack $d.bf -padx 2 -pady 2 -fill x
2669  pack [ttk::separator $d.sep -orient horizontal] -padx 2 -pady 2 -fill x -expand yes
2670  pack $d.lf -padx 2 -pady 2 -fill x
2671 
2672  register $d.tf.tl $wstr Emmet/AbbreviationAliases
2673 
2674  pack $w.nb -fill both -expand yes
2675 
2676  # Initialize the UI state
2678  set_aliases
2679 
2680  }

§ create_find()

pref_ui::create_find   w  

Definition at line 2992 of file pref_ui.tcl.

2992  proc create_find {w} {
2993 
2994  variable widgets
2995  variable prefs
2996 
2997  make_sb $w.mh [msgcat::mc "Set find history depth"] Find/MaxHistory 0 100 10 1
2998  make_sb $w.cn [msgcat::mc "Set Find in Files line context"] Find/ContextNum 0 10 1 1
2999  make_sb $w.jd [msgcat::mc "Set jump distance"] Find/JumpDistance 1 20 1 1
3000  make_spacer $w 1
3001  make_mb $w.dsm [msgcat::mc "Default Find search method"] Find/DefaultMethod {regexp glob exact} 1
3002  make_mb $w.dfm [msgcat::mc "Default Find in Files search method"] Find/DefaultFIFMethod {regexp glob exact} 1
3003  make_spacer $w 1
3004  make_cb $w.cp [msgcat::mc "Close find panels when editing buffer gets focus"] Find/ClosePanelsOnTextFocus 1
3005 
3006  }

§ create_general()

pref_ui::create_general   w  

Definition at line 1447 of file pref_ui.tcl.

1447  proc create_general {w} {
1448 
1449  variable widgets
1450  variable prefs
1451  variable enable_share
1452  variable share_changed
1453 
1454  pack [ttk::notebook $w.nb] -fill both -expand yes
1455 
1456  ###############
1457  # GENERAL TAB #
1458  ###############
1459 
1460  $w.nb add [set a [ttk::frame $w.nb.a]] -text [msgcat::mc "General"]
1461 
1462  make_cb $a.lls [msgcat::mc "Automatically load last session on start"] General/LoadLastSession
1463  make_cb $a.eolc [msgcat::mc "Exit the application after the last tab is closed"] General/ExitOnLastClose
1464  make_cb $a.acwd [msgcat::mc "Automatically set the current working directory to the current tabs directory"] General/AutoChangeWorkingDirectory
1465  set umtt [make_cb $a.umtt [msgcat::mc "Show 'Move To Trash' for local files/directories instead of 'Delete'"] General/UseMoveToTrash]
1466  pack [ttk::frame $a.mttf] -fill x -padx 2 -pady 2
1467  pack [ttk::label $a.mttf.l -text " "] -side left -padx 2 -pady 2
1468  set cmtt [make_cb $a.mttf.cb [msgcat::mc "Confirm 'Move To Trash' operation prior to operation"] General/ConfirmMoveToTrash]
1469  make_cb $a.pcs [msgcat::mc "Prompt user to save preference changes in global or named session"] General/PromptCrossSessionSave
1470 
1471  $umtt configure -command [list pref_ui::move_to_trash_changed $cmtt]
1472  move_to_trash_changed $cmtt
1473 
1474  make_spacer $a
1475 
1476  ttk::frame $a.f
1477  ttk::label $a.f.dl -text [format "%s: " [set wstr [msgcat::mc "Set default open/save browsing directory to"]]]
1478  set widgets(browse_mb) [ttk::menubutton $a.f.dmb -menu [menu $a.browMnu -tearoff 0]]
1479  set widgets(browse_l) [ttk::label $a.f.dir]
1480 
1481  $a.browMnu add command -label [msgcat::mc "Last accessed"] -command [list pref_ui::set_browse_dir "last"]
1482  $a.browMnu add command -label [msgcat::mc "Current editing buffer directory"] -command [list pref_ui::set_browse_dir "buffer"]
1483  $a.browMnu add command -label [msgcat::mc "Current working directory"] -command [list pref_ui::set_browse_dir "current"]
1484  $a.browMnu add command -label [msgcat::mc "Use directory"] -command [list pref_ui::set_browse_dir "dir"]
1485 
1486  # Register the widget for search
1487  register $widgets(browse_mb) $wstr General/DefaultFileBrowserDirectory
1488 
1489  switch $prefs(General/DefaultFileBrowserDirectory) {
1490  "last" { $widgets(browse_mb) configure -text [msgcat::mc "Last"]}
1491  "buffer" { $widgets(browse_mb) configure -text [msgcat::mc "Buffer"]}
1492  "current" { $widgets(browse_mb) configure -text [msgcat::mc "Current"]}
1493  default {
1494  $widgets(browse_mb) configure -text [msgcat::mc "Directory"]
1495  $widgets(browse_l) configure -text " $prefs(General/DefaultFileBrowserDirectory)"
1496  }
1497  }
1498 
1499  grid $a.f.dl -row 1 -column 0 -sticky news -padx 2 -pady 2
1500  grid $a.f.dmb -row 1 -column 1 -sticky news -padx 2 -pady 2
1501  grid $a.f.dir -row 2 -column 0 -sticky news -columnspan 2
1502 
1503  pack $a.f -fill x -padx 2 -pady 2
1504 
1505  #################
1506  # VARIABLES TAB #
1507  #################
1508 
1509  $w.nb add [set b [ttk::frame $w.nb.b]] -text [set wstr [msgcat::mc "Variables"]]
1510 
1511  ttk::frame $b.f
1512  set widgets(var_table) [tablelist::tablelist $b.f.tl \
1513  -columns [list 0 [msgcat::mc "Variable"] 0 [msgcat::mc "Value"]] \
1514  -stretch all -editselectedonly 1 -exportselection 0 -showseparators 1 \
1515  -borderwidth 0 -highlightthickness 0 \
1516  -height 25 \
1517  -editendcommand [list pref_ui::var_edit_end_command] \
1518  -xscrollcommand [list utils::set_xscrollbar $b.f.hb] \
1519  -yscrollcommand [list utils::set_yscrollbar $b.f.vb]]
1520  scroller::scroller $b.f.vb -orient vertical -command [list $b.f.tl yview]
1521  scroller::scroller $b.f.hb -orient horizontal -command [list $b.f.tl xview]
1522 
1523  utils::tablelist_configure $widgets(var_table)
1524 
1525  $widgets(var_table) columnconfigure 0 -name var -editable 1 -stretchable 1
1526  $widgets(var_table) columnconfigure 1 -name val -editable 1 -stretchable 1
1527 
1528  bind $widgets(var_table) <<TablelistSelect>> [list pref_ui::handle_var_select]
1529 
1530  grid rowconfigure $b.f 1 -weight 1
1531  grid columnconfigure $b.f 0 -weight 1
1532  grid $b.f.tl -row 0 -column 0 -sticky news -rowspan 2
1533  grid [$b.f.tl cornerpath] -row 0 -column 1 -sticky news
1534  grid $b.f.vb -row 1 -column 1 -sticky ns
1535  grid $b.f.hb -row 2 -column 0 -sticky ew
1536 
1537  register $widgets(var_table) $wstr General/Variables
1538 
1539  ttk::frame $b.bf
1540  set widgets(var_add) [ttk::button $b.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::add_variable]]
1541  set widgets(var_del) [ttk::button $b.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::del_variable] -state disabled]
1542 
1543  pack $b.bf.add -side left -padx 2 -pady 2
1544  pack $b.bf.del -side left -padx 2 -pady 2
1545 
1546  pack $b.f -fill both -expand yes
1547  pack $b.bf -fill x
1548 
1549  # Populate the variable table
1550  foreach row $prefs(General/Variables) {
1551  $widgets(var_table) insert end $row
1552  }
1553 
1554  #################
1555  # LANGUAGES TAB #
1556  #################
1557 
1558  $w.nb add [set c [ttk::frame $w.nb.c]] -text [set wstr [msgcat::mc "Languages"]]
1559 
1560  set widgets(lang_table) [tablelist::tablelist $c.tl \
1561  -columns [list 0 [msgcat::mc "Enabled"] 0 [msgcat::mc "Language"] 0 [msgcat::mc "Extensions"]] \
1562  -stretch all -exportselection 1 -showseparators 1 \
1563  -height 25 -borderwidth 0 -highlightthickness 0 \
1564  -editendcommand [list pref_ui::lang_edit_end_command] \
1565  -xscrollcommand [list utils::set_xscrollbar $c.hb] \
1566  -yscrollcommand [list utils::set_yscrollbar $c.vb]]
1567  scroller::scroller $c.vb -orient vertical -command [list $c.tl yview]
1568  scroller::scroller $c.hb -orient horizontal -command [list $c.tl xview]
1569 
1570  utils::tablelist_configure $widgets(lang_table)
1571 
1572  $widgets(lang_table) columnconfigure 0 -name enabled -editable 0 -resizable 0 -stretchable 0 -formatcommand [list pref_ui::empty_string]
1573  $widgets(lang_table) columnconfigure 1 -name lang -editable 0 -resizable 0 -stretchable 0
1574  $widgets(lang_table) columnconfigure 2 -name exts -editable 1 -resizable 1 -stretchable 1
1575 
1576  bind [$widgets(lang_table) bodytag] <Button-1> [list pref_ui::handle_lang_left_click %W %x %y]
1577 
1578  # Register the widget for search
1579  register $widgets(lang_table) $wstr General/DisabledLanguages
1580  register $widgets(lang_table) $wstr General/LanguagePatternOverrides
1581 
1582  grid rowconfigure $c 1 -weight 1
1583  grid columnconfigure $c 0 -weight 1
1584  grid $c.tl -row 0 -column 0 -sticky news -rowspan 2
1585  grid [$c.tl cornerpath] -row 0 -column 1 -sticky news
1586  grid $c.vb -row 1 -column 1 -sticky ns
1587  grid $c.hb -row 2 -column 0 -sticky ew
1588 
1589  # Populate the language table
1591 
1592  ###############
1593  # SHARING TAB #
1594  ###############
1595 
1596  $w.nb add [set e [ttk::frame $w.nb.e]] -text [msgcat::mc "Sharing"]
1597 
1598  ttk::frame $e.sf
1599  set widgets(share_enable) [ttk::checkbutton $e.sf.cb -text [format " %s: " [set wstr [msgcat::mc "Directory"]]] -variable pref_ui::enable_share -command [list pref_ui::handle_share_directory]]
1600  set widgets(share_entry) [ttk::entry $e.sf.e]
1601 
1602  register $widgets(share_enable) $wstr General/ShareDirectory
1603 
1604  pack $e.sf.cb -side left -padx 2 -pady 2
1605  pack $e.sf.e -side left -padx 2 -pady 2 -fill x -expand yes
1606 
1607  set widgets(share_items) [ttk::labelframe $e.if -text [set wstr [msgcat::mc "Sharing Items"]]]
1608  foreach {type nspace name} [share::get_share_items] {
1609  pack [ttk::checkbutton $e.if.$type -text [format " %s" $name] -variable pref_ui::share_$type -command [list pref_ui::handle_share_change]] -fill x -padx 2 -pady 2
1610  }
1611 
1612  register $widgets(share_items) $wstr General/ShareItems
1613 
1614  ttk::button $e.export -text [msgcat::mc "Export Settings"] -command [list share::create_export .prefwin]
1615 
1616  pack $e.sf -padx 2 -pady 4 -fill x
1617  make_spacer $e
1618  pack $e.if -padx 2 -pady 4 -fill both
1619  make_spacer $e
1620  pack $e.export
1621 
1622  # Initialize the sharing UI
1623  lassign [share::get_share_info] share_dir share_items
1624  set enable_share [expr {$share_dir ne ""}]
1625  set share_changed 0
1626  foreach {type value} $share_items {
1627  set pref_ui::share_$type $value
1628  }
1629  $widgets(share_entry) insert end $share_dir
1630  $widgets(share_entry) configure -state readonly
1631 
1632  # The updates tab is not valid for Windows
1633  if {![string match *Win* $::tcl_platform(os)]} {
1634 
1635  ###############
1636  # UPDATES TAB #
1637  ###############
1638 
1639  $w.nb add [set d [ttk::frame $w.nb.d]] -text [set wstr [msgcat::mc "Updates"]]
1640 
1641  make_cb $d.ucos [msgcat::mc "Automatically check for updates on start"] General/UpdateCheckOnStart
1642 
1643  ttk::frame $d.f
1644  ttk::label $d.f.ul -text [format "%s: " [set wstr [msgcat::mc "Update using release type"]]]
1645  set widgets(upd_mb) [ttk::menubutton $d.f.umb -menu [menu $d.updMnu -tearoff 0]]
1646 
1647  $d.updMnu add radiobutton -label [msgcat::mc "Stable"] -value "stable" -variable pref_ui::prefs(General/UpdateReleaseType) -command [list pref_ui::set_release_type]
1648  $d.updMnu add radiobutton -label [msgcat::mc "Development"] -value "devel" -variable pref_ui::prefs(General/UpdateReleaseType) -command [list pref_ui::set_release_type]
1649 
1650  ttk::button $d.upd -style BButton -text [msgcat::mc "Check for Update"] -command [list menus::check_for_update]
1651 
1652  pack $d.f.ul -side left -padx 2 -pady 2
1653  pack $d.f.umb -side left -padx 2 -pady 2
1654  pack $d.f -fill x
1655  pack $d.upd -padx 2 -pady 2
1656 
1657  # Register the widget for search
1658  register $widgets(upd_mb) $wstr General/UpdateReleaseType
1659 
1660  # Initialize the release type menubutton text
1662 
1663  }
1664 
1665  }

§ create_plugins()

pref_ui::create_plugins   w  

Definition at line 4289 of file pref_ui.tcl.

4289  proc create_plugins {w} {
4290 
4291  variable widgets
4292  variable prefs
4293 
4294  set widgets(plugins_mb) [ttk::menubutton $w.mb -text [msgcat::mc "Select a plugin"] -menu [menu $w.pluginsMenu -tearoff 0]]
4295  set widgets(plugins_nb) [ttk::notebook $w.nb -style Plain.TNotebook]
4296 
4297  pack $widgets(plugins_mb) -padx 2 -pady 2
4298  pack $widgets(plugins_nb) -fill both -expand yes -padx 2 -pady 2
4299 
4300  $widgets(plugins_nb) add [ttk::frame $widgets(plugins_nb)._none]
4301  $widgets(plugins_nb) hide $widgets(plugins_nb)._none
4302 
4303  # Create the plugin frames
4304  foreach plugin [plugins::handle_on_pref_ui $widgets(plugins_nb)] {
4305  $w.pluginsMenu add command -label $plugin -command [list pref_ui::handle_plugins_change $plugin]
4306  }
4307 
4308  }

§ create_shortcuts()

pref_ui::create_shortcuts   w  

Definition at line 3684 of file pref_ui.tcl.

3684  proc create_shortcuts {w} {
3685 
3686  variable widgets
3687  variable prefs
3688 
3689  if {[tk windowingsystem] eq "aqua"} {
3690  set mod_width 6
3691  } else {
3692  set mod_width 20
3693  }
3694 
3695  ttk::frame $w.sf
3696  wmarkentry::wmarkentry $w.sf.search -width 30 -watermark [msgcat::mc "Search Shortcuts"] \
3697  -validate key -validatecommand [list pref_ui::shortcut_search %P]
3698  ttk::button $w.sf.revert -style BButton -text [msgcat::mc "Use Default"] -command [list pref_ui::shortcut_use_default]
3699 
3700  pack $w.sf.search -side left -padx 2 -pady 2
3701  pack $w.sf.revert -side right -padx 2 -pady 2
3702 
3703  ttk::frame $w.tf
3704  set widgets(shortcut_tl) [tablelist::tablelist $w.tf.tl \
3705  -columns [list 0 [msgcat::mc "Menu Item"] 0 [msgcat::mc "Shortcut"] 0 {}] \
3706  -height 20 -exportselection 0 -stretch all -borderwidth 0 -highlightthickness 0 \
3707  -tooltipaddcommand pref_ui::shortcut_show_tooltip -tooltipdelcommand pref_ui::shortcut_hide_tooltip \
3708  -yscrollcommand [list $w.tf.vb set]]
3709  scroller::scroller $w.tf.vb -orient vertical -command [list $w.tf.tl yview]
3710 
3711  utils::tablelist_configure $widgets(shortcut_tl)
3712 
3713  $widgets(shortcut_tl) columnconfigure 0 -name label -editable 0 -resizable 0 -stretchable 1 -maxwidth 50
3714  $widgets(shortcut_tl) columnconfigure 1 -name shortcut -editable 0 -resizable 0 -stretchable 0 -formatcommand [list pref_ui::shortcut_format]
3715  $widgets(shortcut_tl) columnconfigure 2 -name clear -hide 1
3716 
3717  bind [$widgets(shortcut_tl) bodytag] <Return> [list pref_ui::shortcut_table_select]
3718  bind [$widgets(shortcut_tl) bodytag] <Key-space> [list pref_ui::shortcut_table_select]
3719  bind [$widgets(shortcut_tl) bodytag] <Escape> [list pref_ui::shortcut_cancel]
3720  bind [$widgets(shortcut_tl) bodytag] <Delete> [list pref_ui::shortcut_clear]
3721  bind [$widgets(shortcut_tl) bodytag] <Double-Button-1> [list pref_ui::shortcut_table_select]
3722 
3723  set bwidth [msgcat::mcmax "Clear" "Set" "Cancel"]
3724 
3725  set widgets(shortcut_frame) [ttk::frame $w.tf.sf]
3726  ttk::label $w.tf.sf.l -text [format "%s: " [msgcat::mc "Shortcut"]]
3727  set widgets(shortcut_mod) [ttk::combobox $w.tf.sf.mod -width $mod_width -height 5 -state readonly]
3728  set widgets(shortcut_sym) [ttk::combobox $w.tf.sf.sym -width 5 -height 5 -state readonly]
3729  set widgets(shortcut_clear) [ttk::button $w.tf.sf.clear -style BButton -text [msgcat::mc "Clear"] -width $bwidth -command [list pref_ui::shortcut_clear]]
3730  set widgets(shortcut_update) [ttk::button $w.tf.sf.update -style BButton -text [msgcat::mc "Set"] -width $bwidth -state disabled -command [list pref_ui::shortcut_update]]
3731  ttk::button $w.tf.sf.cancel -style BButton -text [msgcat::mc "Cancel"] -width $bwidth -command [list pref_ui::shortcut_cancel]
3732 
3733  bind $widgets(shortcut_mod) <<ComboboxSelected>> [list pref_ui::shortcut_changed]
3734  bind $widgets(shortcut_mod) <Escape> [list pref_ui::shortcut_cancel]
3735  bind $widgets(shortcut_sym) <<ComboboxSelected>> [list pref_ui::shortcut_changed]
3736  bind $widgets(shortcut_sym) <Escape> [list pref_ui::shortcut_cancel]
3737  bind $widgets(shortcut_clear) <Escape> [list pref_ui::shortcut_cancel]
3738  bind $widgets(shortcut_update) <Escape> [list pref_ui::shortcut_cancel]
3739  bind $w.tf.sf.cancel <Escape> [list pref_ui::shortcut_cancel]
3740 
3741  pack $w.tf.sf.l -side left -padx 2 -pady 2
3742  pack $w.tf.sf.mod -side left -padx 2 -pady 2
3743  pack $w.tf.sf.sym -side left -padx 2 -pady 2
3744  pack $w.tf.sf.cancel -side right -padx 2 -pady 2
3745  pack $w.tf.sf.update -side right -padx 2 -pady 2
3746  pack $w.tf.sf.clear -side right -padx 2 -pady 2
3747 
3748  set widgets(shortcut_note) [ttk::frame $w.tf.nf]
3749  ttk::label $w.tf.nf.l -style HLabel -text [msgcat::mc "Select a shortcut and hit the Return or Space key to edit the shortcut"]
3750 
3751  pack $w.tf.nf.l -fill x -padx 2 -pady 2
3752 
3753  grid rowconfigure $w.tf 1 -weight 1
3754  grid columnconfigure $w.tf 0 -weight 1
3755  grid $w.tf.tl -row 0 -column 0 -sticky news -rowspan 2
3756  grid [$w.tf.tl cornerpath] -row 0 -column 1 -sticky news
3757  grid $w.tf.vb -row 1 -column 1 -sticky ns
3758  grid $w.tf.sf -row 2 -column 0 -sticky ew -columnspan 2
3759  grid $w.tf.nf -row 3 -column 0 -sticky ew -columnspan 2
3760 
3761  # Hide the shortcut frame
3762  grid remove $w.tf.sf
3763 
3764  pack $w.sf -fill x
3765  pack $w.tf -fill both -expand yes -padx 2 -pady 2
3766 
3767  # Register the option for search
3768  register $widgets(shortcut_tl) [msgcat::mc "Menu bindings"] Shortcuts
3769  register $widgets(shortcut_tl) [msgcat::mc "Shortcuts"] Shortcuts
3770 
3771  # Populate the table
3772  populate_shortcut_table .menubar
3773 
3774  }

§ create_sidebar()

pref_ui::create_sidebar   w  

Definition at line 3014 of file pref_ui.tcl.

3014  proc create_sidebar {w} {
3015 
3016  variable widgets
3017  variable prefs
3018  variable attributes
3019 
3020  ttk::notebook $w.nb
3021 
3022  #################
3023  # BEHAVIORS TAB #
3024  #################
3025 
3026  $w.nb add [set a [ttk::frame $w.nb.a]] -text [msgcat::mc "Behaviors"]
3027 
3028  make_cb $a.rralc [msgcat::mc "Remove root directory after last sub-file is closed"] Sidebar/RemoveRootAfterLastClose
3029  make_cb $a.fat [msgcat::mc "Show folders at top"] Sidebar/FoldersAtTop
3030  make_cb $a.nat [msgcat::mc "Insert unsorted files at the top of a manually sorted directory"] Sidebar/ManualInsertNewAtTop
3031  make_spacer $a
3032  make_sb $a.kst [msgcat::mc "Append characters to search string if entered within"] Sidebar/KeySearchTimeout 100 3000 100 0 [msgcat::mc "milliseconds"]
3033  make_spacer $a
3034  make_sb $a.dw [msgcat::mc "Default sidebar width on startup"] Sidebar/DefaultWidth 100 600 10 0 [msgcat::mc "pixels"]
3035 
3036  pack [ttk::button $a.dw.b -style BButton -text [msgcat::mc "Use current width"] -command [list pref_ui::sidebar_set_current_width $a.dw.sb]] -side left -padx 20 -pady 2
3037 
3038  ##############
3039  # HIDING TAB #
3040  ##############
3041 
3042  $w.nb add [set b [ttk::frame $w.nb.b]] -text [msgcat::mc "Hiding"]
3043 
3044  make_cb $b.shf [msgcat::mc "Show hidden files"] Sidebar/ShowHiddenFiles
3045  make_cb $b.ib [msgcat::mc "Hide binary files"] Sidebar/IgnoreBinaries
3046  make_spacer $b
3047  set win [make_token $b.hp [msgcat::mc "Hide Patterns"] Sidebar/IgnoreFilePatterns ""]
3048  $win configure -height 6
3049 
3050  ##################
3051  # INFO PANEL TAB #
3052  ##################
3053 
3054  $w.nb add [set c [ttk::frame $w.nb.c]] -text [set wstr [msgcat::mc "Info Panel"]]
3055 
3056  make_cb $c.kfiv [msgcat::mc "Keep information panel visible when sidebar doesn't have focus"] Sidebar/KeepInfoPanelVisible
3057  make_cb $c. [msgcat::mc "Update information panel whenever the sidebar selection changes"] Sidebar/InfoPanelFollowsSelection
3058  make_spacer $c
3059  make_sb $c.rtwpm [msgcat::mc "Reading time words per minute"] Sidebar/InfoPanelReadingTimeWordsPerMinute 100 400 5
3060  make_spacer $c
3061 
3062  ttk::labelframe $c.if -text [set wstr [msgcat::mc "Displayed Information"]]
3063 
3064  grid columnconfigure $c.if 1 -weight 1
3065  grid columnconfigure $c.if 3 -weight 1
3066  grid columnconfigure $c.if 5 -weight 1
3067 
3068  # Pack the colorizer frame
3069  set attrs $prefs(Sidebar/InfoPanelAttributes)
3070  set i 0
3071  foreach attr [lsort [array names attributes]] {
3072  set attributes($attr) [expr {[lsearch $attrs $attr] != -1}]
3073  set row [expr $i % 4]
3074  set col [expr ($i / 4) * 2]
3075  grid [ttk::checkbutton $c.if.$attr -text " $attr" -variable pref_ui::attributes($attr) -command [list pref_ui::set_attributes]] -row $row -column $col -sticky news -padx 2 -pady 2
3076  incr i
3077  }
3078 
3079  # Register the widget
3080  register $c.if.$attr $wstr Sidebar/InfoPanelAttributes
3081 
3082  pack $w.nb.c.if -fill x -padx 2 -pady 2
3083 
3084  pack $w.nb -fill both -expand yes
3085 
3086  }

§ create_snippets()

pref_ui::create_snippets   w  

Definition at line 3162 of file pref_ui.tcl.

3162  proc create_snippets {w} {
3163 
3164  variable widgets
3165  variable selected_language
3166 
3167  ttk::notebook $w.nb
3168 
3169  ###############
3170  # TABLE FRAME #
3171  ###############
3172 
3173  $w.nb add [ttk::frame $w.sf] -text [msgcat::mc "Snippets"]
3174 
3175  set widgets(snippets_tf) [ttk::frame $w.sf.tf]
3176 
3177  ttk::frame $w.sf.tf.sf
3178  wmarkentry::wmarkentry $w.sf.tf.sf.e -width 20 -watermark [msgcat::mc "Search Snippets"] \
3179  -validate key -validatecommand [list pref_ui::snippets_search %P]
3180 
3181  set widgets(snippets_lang_frame) [ttk::frame $w.sf.tf.sf.lf]
3182  ttk::label $w.sf.tf.sf.lf.l -text [msgcat::mc "Language"]
3183  set widgets(snippets_lang) [ttk::menubutton $w.sf.tf.sf.lf.mb -text [msgcat::mc "Language"] \
3184  -menu [pref_ui::snippets_create_menu $w]]
3185 
3186  pack $w.sf.tf.sf.lf.l -side left -padx 2 -pady 2
3187  pack $w.sf.tf.sf.lf.mb -side left -padx 2 -pady 2
3188 
3189  pack $w.sf.tf.sf.e -side left -padx 2 -pady 2
3190  pack $w.sf.tf.sf.lf -side right -padx 2 -pady 2
3191 
3192  ttk::frame $w.sf.tf.tf
3193  set widgets(snippets_tl) [tablelist::tablelist $w.sf.tf.tf.tl \
3194  -columns [list 0 [msgcat::mc "Keyword"] 0 [msgcat::mc "Snippet"]] \
3195  -exportselection 0 -stretch all -borderwidth 0 -highlightthickness 0 \
3196  -xscrollcommand [list utils::set_xscrollbar $w.sf.tf.tf.hb] \
3197  -yscrollcommand [list utils::set_yscrollbar $w.sf.tf.tf.vb]]
3198  scroller::scroller $w.sf.tf.tf.vb -orient vertical -command [list $w.sf.tf.tf.tl yview]
3199  scroller::scroller $w.sf.tf.tf.hb -orient horizontal -command [list $w.sf.tf.tf.tl xview]
3200 
3201  utils::tablelist_configure $widgets(snippets_tl)
3202 
3203  $widgets(snippets_tl) columnconfigure 0 -name keyword -editable 0 -resizable 0 -stretchable 0
3204  $widgets(snippets_tl) columnconfigure 1 -name snippet -editable 0 -resizable 1 -stretchable 1 \
3205  -wrap 0 -maxwidth 50 -formatcommand pref_ui::snippets_format_snippet
3206 
3207  bind $widgets(snippets_tl) <<TablelistSelect>> [list pref_ui::snippets_select]
3208  bind [$widgets(snippets_tl) bodytag] <Double-Button-1> [list pref_ui::snippets_edit]
3209 
3210  grid rowconfigure $w.sf.tf.tf 1 -weight 1
3211  grid columnconfigure $w.sf.tf.tf 0 -weight 1
3212  grid $w.sf.tf.tf.tl -row 0 -column 0 -sticky news -rowspan 2
3213  grid [$w.sf.tf.tf.tl cornerpath] -row 0 -column 1 -sticky news
3214  grid $w.sf.tf.tf.vb -row 1 -column 1 -sticky ns
3215  grid $w.sf.tf.tf.hb -row 2 -column 0 -sticky ew
3216 
3217  ttk::frame $w.sf.tf.bf
3218  ttk::button $w.sf.tf.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::snippets_add]
3219  set widgets(snippets_del) [ttk::button $w.sf.tf.bf.del -style BButton -text [msgcat::mc "Delete"] \
3220  -command [list pref_ui::snippets_del] -state disabled]
3221 
3222  pack $w.sf.tf.bf.add -side left -padx 2 -pady 2
3223  pack $w.sf.tf.bf.del -side left -padx 2 -pady 2
3224 
3225  pack $w.sf.tf.sf -fill x
3226  pack $w.sf.tf.tf -fill both -expand yes
3227  pack $w.sf.tf.bf -fill x
3228 
3229  ##############
3230  # EDIT FRAME #
3231  ##############
3232 
3233  set widgets(snippets_ef) [ttk::frame $w.sf.ef]
3234 
3235  ttk::frame $w.sf.ef.kf
3236  ttk::label $w.sf.ef.kf.l -text [format "%s: " [msgcat::mc "Keyword"]]
3237  set widgets(snippets_keyword) [ttk::entry $w.sf.ef.kf.e -validate key -validatecommand [list pref_ui::snippets_keyword_changed %P]]
3238 
3239  pack $w.sf.ef.kf.l -side left -padx 2 -pady 2
3240  pack $w.sf.ef.kf.e -side left -padx 2 -pady 2 -fill x -expand yes
3241 
3242  array set sb_opts [theme::get_category_options text_scrollbar 1]
3243 
3244  ttk::labelframe $w.sf.ef.tf -text [msgcat::mc "Snippet Text"]
3245  frame $w.sf.ef.tf.tf
3246  set widgets(snippets_text) [ctext $w.sf.ef.tf.tf.t -wrap none \
3247  -xscrollcommand [list $w.sf.ef.tf.tf.hb set] -yscrollcommand [list $w.sf.ef.tf.tf.vb set]]
3248  scroller::scroller $w.sf.ef.tf.tf.vb {*}[array get sb_opts] -orient vertical -autohide 1 -command [list $w.sf.ef.tf.tf.t yview]
3249  scroller::scroller $w.sf.ef.tf.tf.hb {*}[array get sb_opts] -orient horizontal -autohide 0 -command [list $w.sf.ef.tf.tf.t xview]
3250 
3251  bind $widgets(snippets_text) <<Modified>> [list if {[pref_ui::snippets_text_changed]} break]
3252 
3253  update_theme $widgets(snippets_text)
3254 
3255  theme::register_widget $widgets(snippets_text) syntax_prefs
3256  theme::register_widget $w.sf.ef.tf.tf.vb text_scrollbar
3257  theme::register_widget $w.sf.ef.tf.tf.hb text_scrollbar
3258 
3259  indent::add_bindings $widgets(snippets_text)
3260 
3261  set modifier [expr {([tk windowingsystem] eq "aqua") ? "Command" : "Control"}]
3262 
3263  bind $widgets(snippets_text) <$modifier-c> {
3264  %W copy
3265  break
3266  }
3267  bind $widgets(snippets_text) <$modifier-x> {
3268  %W cut
3269  break
3270  }
3271  bind $widgets(snippets_text) <$modifier-v> {
3272  %W paste
3273  break
3274  }
3275 
3276  grid rowconfigure $w.sf.ef.tf.tf 0 -weight 1
3277  grid columnconfigure $w.sf.ef.tf.tf 0 -weight 1
3278  grid $w.sf.ef.tf.tf.t -row 0 -column 0 -sticky news
3279  grid $w.sf.ef.tf.tf.vb -row 0 -column 1 -sticky ns
3280  grid $w.sf.ef.tf.tf.hb -row 1 -column 0 -sticky ew
3281 
3282  pack $w.sf.ef.tf.tf -fill both -expand yes
3283 
3284  set bwidth [msgcat::mcmax "Insert" "Save" "Cancel"]
3285 
3286  ttk::frame $w.sf.ef.bf
3287  set widgets(snippets_ins) [ttk::button $w.sf.ef.bf.insert -style BButton -text [msgcat::mc "Insert"] -width $bwidth -command [list pref_ui::snippets_insert]]
3288  set widgets(snippets_save) [ttk::button $w.sf.ef.bf.save -style BButton -text [msgcat::mc "Save"] \
3289  -width $bwidth -command [list pref_ui::snippets_save] -state disabled]
3290  ttk::button $w.sf.ef.bf.cancel -style BButton -text [msgcat::mc "Cancel"] -width $bwidth -command [list pref_ui::snippets_cancel]
3291 
3292  pack $w.sf.ef.bf.insert -side left -padx 2 -pady 2
3293  pack $w.sf.ef.bf.cancel -side right -padx 2 -pady 2
3294  pack $w.sf.ef.bf.save -side right -padx 2 -pady 2
3295 
3296  pack $w.sf.ef.kf -fill x
3297  pack $w.sf.ef.tf -fill both -expand yes
3298  pack $w.sf.ef.bf -fill x
3299 
3300  # Display the table frame
3301  pack $w.sf.tf -fill both -expand yes
3302 
3303  # Setup the snippet insert menu
3304  set widgets(snippets_ins_menu) [menu $w.sf.insPopup -tearoff 0]
3305  $widgets(snippets_ins_menu) add cascade -label [format "%s / %s" [msgcat::mc "Date"] [msgcat::mc "Time"]] -menu [menu $w.sf.datePopup -tearoff 0]
3306  $widgets(snippets_ins_menu) add cascade -label [msgcat::mc "File"] -menu [menu $w.sf.filePopup -tearoff 0]
3307  $widgets(snippets_ins_menu) add separator
3308  $widgets(snippets_ins_menu) add command -label [msgcat::mc "Selected Text"] -command [list pref_ui::snippets_insert_str "\$SELECTED_TEXT"]
3309  $widgets(snippets_ins_menu) add command -label [msgcat::mc "Clipboard"] -command [list pref_ui::snippets_insert_str "\$CLIPBOARD"]
3310  $widgets(snippets_ins_menu) add command -label [msgcat::mc "Clipboard History"] -command [list pref_ui::snippets_insert_str "\$CLIPHIST\[1\]"]
3311  $widgets(snippets_ins_menu) add separator
3312  $widgets(snippets_ins_menu) add command -label [msgcat::mc "Tab Stop"] -command [list pref_ui::snippets_insert_str "\${1}"]
3313  $widgets(snippets_ins_menu) add command -label [msgcat::mc "Cursor"] -command [list pref_ui::snippets_insert_str "\$0"]
3314 
3315  # Setup the date/time submenu
3316  $w.sf.datePopup add command -label "01/13/2001" -command [list pref_ui::snippets_insert_str "\$CURRENT_DATE"]
3317  $w.sf.datePopup add command -label "2001/01/13" -command [list pref_ui::snippets_insert_str "\$CURRENT_DATE2"]
3318  $w.sf.datePopup add command -label "01:01 PM" -command [list pref_ui::snippets_insert_str "\$CURRENT_TIME"]
3319  $w.sf.datePopup add separator
3320  $w.sf.datePopup add command -label "Jan" -command [list pref_ui::snippets_insert_str "\$CURRENT_MON"]
3321  $w.sf.datePopup add command -label "January" -command [list pref_ui::snippets_insert_str "\$CURRENT_MONTH"]
3322  $w.sf.datePopup add command -label " 1" -command [list pref_ui::snippets_insert_str "\$CURRENT_MON1"]
3323  $w.sf.datePopup add command -label "01" -command [list pref_ui::snippets_insert_str "\$CURRENT_MON2"]
3324  $w.sf.datePopup add separator
3325  $w.sf.datePopup add command -label "Mon" -command [list pref_ui::snippets_insert_str "\$CURRENT_DAYN"]
3326  $w.sf.datePopup add command -label "Monday" -command [list pref_ui::snippets_insert_str "\$CURRENT_DAYNAME"]
3327  $w.sf.datePopup add command -label "1" -command [list pref_ui::snippets_insert_str "\$CURRENT_DAY1"]
3328  $w.sf.datePopup add command -label "01" -command [list pref_ui::snippets_insert_str "\$CURRENT_DAY2"]
3329  $w.sf.datePopup add separator
3330  $w.sf.datePopup add command -label "01" -command [list pref_ui::snippets_insert_str "\$CURRENT_YEAR2"]
3331  $w.sf.datePopup add command -label "2001" -command [list pref_ui::snippets_insert_str "\$CURRENT_YEAR"]
3332 
3333  # Setup the file submenu
3334  $w.sf.filePopup add command -label [msgcat::mc "Current Directory"] -command [list pref_ui::snippets_insert_str "\$DIRECTORY"]
3335  $w.sf.filePopup add command -label [msgcat::mc "Current File Pathname"] -command [list pref_ui::snippets_insert_str "\$FILEPATH"]
3336  $w.sf.filePopup add command -label [msgcat::mc "Current Filename"] -command [list pref_ui::snippets_insert_str "\$FILENAME"]
3337  $w.sf.filePopup add separator
3338  $w.sf.filePopup add command -label [msgcat::mc "Current Line"] -command [list pref_ui::snippets_insert_str "\$CURRENT_LINE"]
3339  $w.sf.filePopup add command -label [msgcat::mc "Current Word"] -command [list pref_ui::snippets_insert_str "\$CURRENT_WORD"]
3340  $w.sf.filePopup add separator
3341  $w.sf.filePopup add command -label [msgcat::mc "Current Line Number"] -command [list pref_ui::snippets_insert_str "\$LINE_NUMBER"]
3342  $w.sf.filePopup add command -label [msgcat::mc "Current Line Column"] -command [list pref_ui::snippets_insert_str "\$LINE_INDEX"]
3343 
3344  # Populate the snippets table
3345  snippets_set_language $selected_language
3346 
3347  ##################
3348  # COMPLETERS TAB #
3349  ##################
3350 
3351  $w.nb add [ttk::frame $w.nb.opt] -text [msgcat::mc "Options"]
3352 
3353  ttk::labelframe $w.nb.opt.scf -text [set wstr [msgcat::mc "Snippet Completion Characters"]]
3354  pack [ttk::checkbutton $w.nb.opt.scf.s -text [format " %s" [msgcat::mc "Space"]] -variable pref_ui::snip_compl(space) -command [list pref_ui::set_snip_compl]] -fill x -padx 2 -pady 2
3355  pack [ttk::checkbutton $w.nb.opt.scf.t -text [format " %s" [msgcat::mc "Tab"]] -variable pref_ui::snip_compl(tab) -command [list pref_ui::set_snip_compl]] -fill x -padx 2 -pady 2
3356  pack [ttk::checkbutton $w.nb.opt.scf.r -text [format " %s" [msgcat::mc "Return"]] -variable pref_ui::snip_compl(return) -command [list pref_ui::set_snip_compl]] -fill x -padx 2 -pady 2
3357 
3358  register $w.nb.opt.scf.s $wstr Editor/SnippetCompleters
3359 
3360  pack $w.nb.opt.scf -fill x -padx 2 -pady 2
3361 
3362  make_spacer $w.nb.opt
3363  make_cb $w.nb.opt.sfai [msgcat::mc "Format snippet indentation after insert"] Editor/SnippetFormatAfterInsert
3364 
3365  pack $w.nb -fill both -expand yes
3366 
3367  }

§ create_view()

pref_ui::create_view   w  

Definition at line 3128 of file pref_ui.tcl.

3128  proc create_view {w} {
3129 
3130  make_cb $w.sm [msgcat::mc "Show menubar"] View/ShowMenubar
3131  make_cb $w.ss [msgcat::mc "Show sidebar"] View/ShowSidebar
3132  make_cb $w.ssb [msgcat::mc "Show status bar"] View/ShowStatusBar
3133  make_cb $w.stb [msgcat::mc "Show tab bar"] View/ShowTabBar
3134  make_cb $w.sln [msgcat::mc "Show line numbers"] View/ShowLineNumbers
3135  make_cb $w.smm [msgcat::mc "Show marker map"] View/ShowMarkerMap
3136  make_cb $w.sbe [msgcat::mc "Show bird's eye view"] View/ShowBirdsEyeView
3137  make_cb $w.sdio [msgcat::mc "Show difference file in other pane than original"] View/ShowDifferenceInOtherPane
3138  make_cb $w.sdvi [msgcat::mc "Show difference file version information"] View/ShowDifferenceVersionInfo
3139  make_cb $w.sfif [msgcat::mc "Show 'Find in Files' result in other pane"] View/ShowFindInFileResultsInOtherPane
3140  make_cb $w.ats [msgcat::mc "Allow scrolling in tab bar"] View/AllowTabScrolling
3141  make_cb $w.ota [msgcat::mc "Sort tabs alphabetically on open"] View/OpenTabsAlphabetically
3142  make_cb $w.ecf [msgcat::mc "Enable code folding"] View/EnableCodeFolding
3143  make_cb $w.sls [msgcat::mc "Show language submenu"] View/ShowLanguagesSubmenu
3144 
3145  make_spacer $w
3146 
3147  ttk::frame $w.sf
3148  make_sb $w.sf.sro [msgcat::mc "Recently opened history depth"] View/ShowRecentlyOpened 0 20 1 1
3149  make_sb $w.sf.befs [msgcat::mc "Bird's Eye View Font Size"] View/BirdsEyeViewFontSize 1 2 1 1
3150  make_sb $w.sf.bew [msgcat::mc "Bird's Eye View Width"] View/BirdsEyeViewWidth 30 80 5 1
3151  make_mb $w.sf.elw [msgcat::mc "Line Wrapping Default"] View/EnableLineWrapping [list syntax enable disable] 1
3152  pack $w.sf -fill x -pady 8
3153 
3154  }

§ del_variable()

pref_ui::del_variable

Definition at line 1770 of file pref_ui.tcl.

1770  proc del_variable {} {
1771 
1772  variable widgets
1773 
1774  set selected [$widgets(var_table) curselection]
1775 
1776  # Delete the row
1777  $widgets(var_table) delete $selected
1778 
1779  # Disable the delete button
1780  $widgets(var_del) configure -state disabled
1781 
1782  # Update the General/Variable array value
1784 
1785  }

§ destroy_window()

pref_ui::destroy_window

Definition at line 1163 of file pref_ui.tcl.

1163  proc destroy_window {} {
1164 
1165  variable selected_session
1166  variable selected_language
1167 
1168  # Save any sharing changes (if necessary)
1170 
1171  # Check the state of the preferences and, if necessary, ask the user to
1172  # apply the changes to other preferences
1173  if {![check_on_close $selected_session $selected_language]} {
1174  return
1175  }
1176 
1177  # Kill the window
1178  destroy .prefwin
1179 
1180  }

§ documentation_add()

pref_ui::documentation_add

Definition at line 4399 of file pref_ui.tcl.

4399  proc documentation_add {} {
4400 
4401  variable widgets
4402 
4403  toplevel .prefwin.docwin
4404  wm title .prefwin.docwin [format "%s URL" [msgcat::mc "Add Language Reference"]]
4405  wm transient .prefwin.docwin .prefwin
4406  wm resizable .prefwin.docwin 0 0
4407 
4408  ttk::frame .prefwin.docwin.f
4409  ttk::label .prefwin.docwin.f.ul -text "URL: "
4410  ttk::entry .prefwin.docwin.f.url -validate key -validatecommand [list pref_ui::docwin_validate %P] -width 60
4411 
4412  bind .prefwin.docwin.f.url <Return> [list .prefwin.docwin.bf.ok invoke]
4413 
4414  pack .prefwin.docwin.f.ul -side left -padx 2 -pady 2
4415  pack .prefwin.docwin.f.url -side left -padx 2 -pady 2
4416 
4417  set bwidth [msgcat::mcmax "Add" "Cancel"]
4418 
4419  ttk::frame .prefwin.docwin.bf
4420  ttk::button .prefwin.docwin.bf.ok -style BButton -text [msgcat::mc "Add"] -width $bwidth -command {
4421  set url [.prefwin.docwin.f.url get]
4422  set name [pref_ui::docwin_get_title $url]
4423  set row [$pref_ui::widgets(doc,table) insert end [list $name $url]]
4424  $pref_ui::widgets(doc,table) see $row
4425  $pref_ui::widgets(doc,table) selection clear 0 end
4426  $pref_ui::widgets(doc,table) selection set $row
4427  $pref_ui::widgets(doc,delete) configure -state normal
4428  $pref_ui::widgets(doc,test) configure -state normal
4429  after idle [list pref_ui::documentation_save]
4430  destroy .prefwin.docwin
4431  } -state disabled
4432  ttk::button .prefwin.docwin.bf.cancel -style BButton -text [msgcat::mc "Cancel"] -width $bwidth -command {
4433  destroy .prefwin.docwin
4434  }
4435 
4436  pack .prefwin.docwin.bf.cancel -side right -padx 2 -pady 2
4437  pack .prefwin.docwin.bf.ok -side right -padx 2 -pady 2
4438 
4439  pack .prefwin.docwin.f -fill both -expand yes
4440  pack .prefwin.docwin.bf -fill x
4441 
4442  # Place the window in the middle of the preference window
4443  ::tk::PlaceWindow .prefwin.docwin widget .prefwin
4444 
4445  # Get the grab and focus
4446  ::tk::SetFocusGrab .prefwin.docwin .prefwin.docwin.f.url
4447 
4448  # Wait for the window to be closed
4449  tkwait window .prefwin.docwin
4450 
4451  # Restore the focus and grab
4452  ::tk::RestoreFocusGrab .prefwin.docwin .prefwin.docwin.f.url
4453 
4454  }

§ documentation_delete()

pref_ui::documentation_delete

Definition at line 4503 of file pref_ui.tcl.

4503  proc documentation_delete {} {
4504 
4505  variable widgets
4506  variable prefs
4507 
4508  # Get the currently selected row
4509  set selected [$widgets(doc,table) curselection]
4510 
4511  # Delete the row in the table
4512  $widgets(doc,table) delete $selected
4513 
4514  # Delete the preference value
4515  set prefs(Documentation/References) [lreplace $prefs(Documentation/References) $selected $selected]
4516 
4517  # Set the delete/test button state to invalid
4518  $widgets(doc,delete) configure -state disabled
4519  $widgets(doc,test) configure -state disabled
4520 
4521  }

§ documentation_populate()

pref_ui::documentation_populate

Definition at line 4541 of file pref_ui.tcl.

4541  proc documentation_populate {} {
4542 
4543  variable widgets
4544  variable prefs
4545 
4546  # Clear the table
4547  $widgets(doc,table) delete 0 end
4548 
4549  # Populate the table
4550  foreach pref $prefs(Documentation/References) {
4551  $widgets(doc,table) insert end $pref
4552  }
4553 
4554  }

§ documentation_save()

pref_ui::documentation_save

Definition at line 4558 of file pref_ui.tcl.

4558  proc documentation_save {} {
4559 
4560  variable widgets
4561  variable prefs
4562 
4563  set references [list]
4564  for {set i 0} {$i < [$widgets(doc,table) size]} {incr i} {
4565  lappend references [list [$widgets(doc,table) cellcget $i,name -text] [$widgets(doc,table) cellcget $i,url -text]]
4566  }
4567 
4568  # Set the Documentation/References preference variable with the list of values
4569  set prefs(Documentation/References) $references
4570 
4571  }

§ documentation_selected()

pref_ui::documentation_selected

Definition at line 4383 of file pref_ui.tcl.

4383  proc documentation_selected {} {
4384 
4385  variable widgets
4386 
4387  if {[set selected [$widgets(doc,table) curselection]] ne ""} {
4388  $widgets(doc,delete) configure -state normal
4389  $widgets(doc,test) configure -state normal
4390  } else {
4391  $widgets(doc,delete) configure -state disabled
4392  $widgets(doc,test) configure -state disabled
4393  }
4394 
4395  }

§ documentation_test()

pref_ui::documentation_test

Definition at line 4525 of file pref_ui.tcl.

4525  proc documentation_test {} {
4526 
4527  variable widgets
4528 
4529  # Get the currently selected row
4530  set selected [$widgets(doc,table) curselection]
4531 
4532  # Get the URL to display
4533  if {[set url [$widgets(doc,table) cellcget $selected,url -text]] ne ""} {
4535  }
4536 
4537  }

§ docwin_get_title()

pref_ui::docwin_get_title   url  

Definition at line 4475 of file pref_ui.tcl.

4475  proc docwin_get_title {url} {
4476 
4477  # If the URL contains a {query} substring, replace it with "foobar"
4478  set url [string map {\{query\} foobar} $url]
4479 
4480  # Set the default value of title
4481  set title [msgcat::mc "Unknown"]
4482 
4483  # Attempt to open the URL
4484  if {[catch { http::geturl $url} token]} {
4485  return $title
4486  }
4487 
4488  # Check the return status
4489  if {([http::status $token] eq "ok") && ([http::ncode $token] == 200)} {
4490  set content [http::data $token]
4491  regexp -nocase {<title>(.*?)</title>} $content -> title
4492  }
4493 
4494  # Cleanup the token
4495  http::cleanup $token
4496 
4497  return $title
4498 
4499  }

§ docwin_validate()

pref_ui::docwin_validate   value  

Definition at line 4459 of file pref_ui.tcl.

4459  proc docwin_validate {value} {
4460 
4461  variable widgets
4462 
4463  if {$value ne ""} {
4464  .prefwin.docwin.bf.ok configure -state active
4465  } else {
4466  .prefwin.docwin.bf.ok configure -state disabled
4467  }
4468 
4469  return 1
4470 
4471  }

§ emmet_aa_add()

pref_ui::emmet_aa_add

Definition at line 2951 of file pref_ui.tcl.

2951  proc emmet_aa_add {} {
2952 
2953  variable widgets
2954 
2955  # Add a new row to the table
2956  set row [$widgets(emmet_aa_tl) insert end [list "" ""]]
2957 
2958  # Make the first entry to be editable
2959  $widgets(emmet_aa_tl) editcell $row,alias
2960 
2961  }

§ emmet_aa_del()

pref_ui::emmet_aa_del

Definition at line 2965 of file pref_ui.tcl.

2965  proc emmet_aa_del {} {
2966 
2967  variable widgets
2968 
2969  # Get the currently selected row
2970  set selected [$widgets(emmet_aa_tl) curselection]
2971 
2972  # Get the aliased name
2973  set alias_name [$widgets(emmet_aa_tl) cellcget $selected,alias -text]
2974 
2975  # Delete the item
2976  $widgets(emmet_aa_tl) delete $selected
2977 
2978  # Set the state of the delete button to disabled
2979  $widgets(emmet_aa_del) configure -state disabled
2980 
2981  # Save the deletion
2982  emmet::update_alias abbreviation_aliases $alias_name "" ""
2983 
2984  }

§ emmet_aa_edit_end_command()

pref_ui::emmet_aa_edit_end_command   tbl row col value  

Definition at line 2906 of file pref_ui.tcl.

2906  proc emmet_aa_edit_end_command {tbl row col value} {
2907 
2908  variable widgets
2909 
2910  switch [$tbl columncget $col -name] {
2911  alias {
2912  set alias_value [$tbl cellcget $row,value -text]
2913  if {![catch { ::parse_emmet $alias_value ""}]} {
2914  emmet::update_alias abbreviation_aliases [$tbl cellcget $row,$col -text] $value $alias_value
2915  }
2916  }
2917  value {
2918  set alias_name [$tbl cellcget $row,alias -text]
2919  if {[emmet_aa_show_preview $value] && ($alias_name ne "")} {
2920  emmet::update_alias abbreviation_aliases $alias_name $alias_name $value
2921  }
2922  }
2923  }
2924 
2925  return $value
2926 
2927  }

§ emmet_aa_show_preview()

pref_ui::emmet_aa_show_preview   str  

Definition at line 2884 of file pref_ui.tcl.

2884  proc emmet_aa_show_preview {str} {
2885 
2886  variable widgets
2887 
2888  set retval 0
2889 
2890  $widgets(emmet_aa_preview) configure -state normal
2891  $widgets(emmet_aa_preview) delete 1.0 end
2892 
2893  if {![catch { ::parse_emmet $str ""} str]} {
2894  snippets::insert_snippet $widgets(emmet_aa_preview).t $str -traverse 0
2895  set retval 1
2896  }
2897 
2898  $widgets(emmet_aa_preview) configure -state disabled
2899 
2900  return $retval
2901 
2902  }

§ emmet_na_add()

pref_ui::emmet_na_add

Definition at line 2847 of file pref_ui.tcl.

2847  proc emmet_na_add {} {
2848 
2849  variable widgets
2850 
2851  # Add a new row to the table
2852  set row [$widgets(emmet_na_tl) insert end [list "" "" <x></x> ""]]
2853 
2854  # Make the first entry to be editable
2855  $widgets(emmet_na_tl) editcell $row,alias
2856 
2857  }

§ emmet_na_del()

pref_ui::emmet_na_del

Definition at line 2861 of file pref_ui.tcl.

2861  proc emmet_na_del {} {
2862 
2863  variable widgets
2864 
2865  # Get the currently selected row
2866  set selected [$widgets(emmet_na_tl) curselection]
2867 
2868  # Get the aliased name
2869  set alias_name [$widgets(emmet_na_tl) cellcget $selected,alias -text]
2870 
2871  # Delete the item
2872  $widgets(emmet_na_tl) delete $selected
2873 
2874  # Set the state of the delete button to disabled
2875  $widgets(emmet_na_del) configure -state disabled
2876 
2877  # Save the deletion
2878  emmet::update_alias node_aliases $alias_name "" ""
2879 
2880  }

§ emmet_na_edit_end_command()

pref_ui::emmet_na_edit_end_command   tbl row col value  

Definition at line 2746 of file pref_ui.tcl.

2746  proc emmet_na_edit_end_command {tbl row col value} {
2747 
2748  # Get the row contents
2749  lassign [$tbl rowcget $row -text] alias name ending attrs
2750 
2751  set curr_alias $alias
2752 
2753  # Replace the equality sign in the attrs list with a space
2754  set attrs [string map {= { }} $attrs]
2755 
2756  array set endings {
2757  <x/> 0
2758  <x></x> 1
2759  None 2
2760  }
2761 
2762  switch [$tbl columncget $col -name] {
2763  alias { set alias $value}
2764  name { set name $value}
2765  ending { set ending $value}
2766  attrs { set attrs [string map {= { }} $value]}
2767  }
2768 
2769  # Save the alias if it's worth saving
2770  if {$name ne ""} {
2771  emmet::update_alias node_aliases $curr_alias $alias [list $name $endings($ending) $attrs]
2772  }
2773 
2774  # Display the generated code
2775  emmet_na_show_preview $alias
2776 
2777  return $value
2778 
2779  }

§ emmet_na_edit_start_command()

pref_ui::emmet_na_edit_start_command   tbl row col value  

Definition at line 2729 of file pref_ui.tcl.

2729  proc emmet_na_edit_start_command {tbl row col value} {
2730 
2731  if {[$tbl columncget $col -name] eq "ending"} {
2732  set w [$tbl editwinpath]
2733  set mnu [$w cget -menu]
2734  $mnu delete 0 end
2735  foreach type [list <x/> <x></x> None] {
2736  $mnu add radiobutton -label $type
2737  }
2738  }
2739 
2740  return $value
2741 
2742  }

§ emmet_na_show_preview()

pref_ui::emmet_na_show_preview   alias  

Definition at line 2783 of file pref_ui.tcl.

2783  proc emmet_na_show_preview {alias} {
2784 
2785  variable widgets
2786 
2787  $widgets(emmet_na_preview) configure -state normal
2788  $widgets(emmet_na_preview) delete 1.0 end
2789 
2790  # Get the alias data
2791  lassign [emmet::lookup_node_alias $alias] name ending attrs
2792 
2793  if {$name ne ""} {
2794 
2795  # Construct the node
2796  set str "<$name"
2797  foreach {attr value} $attrs {
2798  append str " $attr=\"$value\""
2799  }
2800  switch $ending {
2801  0 { append str " />"}
2802  1 { append str "></$name>"}
2803  2 { append str ">"}
2804  }
2805 
2806  set index 1
2807  while {[regexp {(.*?)\{\|(.*?)\}(.*)$} $str -> before value after]} {
2808  if {$value eq ""} {
2809  set str "$before\$$index$after"
2810  } else {
2811  set str "$before\${$index:$value}$after"
2812  }
2813  incr index
2814  }
2815 
2816  # Insert the resulting string as a snippet
2817  snippets::insert_snippet $widgets(emmet_na_preview).t $str -traverse 0
2818 
2819  }
2820 
2821  $widgets(emmet_na_preview) configure -state disabled
2822 
2823  }

§ empty_string()

pref_ui::empty_string   value  

Definition at line 1669 of file pref_ui.tcl.

1669  proc empty_string {value} {
1670 
1671  return ""
1672 
1673  }

§ fp_browse()

pref_ui::fp_browse   win varname type type_args  

Definition at line 525 of file pref_ui.tcl.

525  proc fp_browse {win varname type type_args} {
526 
527  array set type_args_array $type_args
528 
529  set type_args_array(-parent) .prefwin
530 
531  # Override the -initialdir value if the value was previously set
532  if {[set value [$win.l cget -text]] ne ""} {
533  set type_args_array(-initialdir) [file dirname $value]
534  }
535 
536  switch $type {
537  open {
538  set type_args_array(-multiple) 0
539  set ans [tk_getOpenFile {*}[array get type_args_array]]
540  }
541  save {
542  set type_args_array(-initialfile) $value
543  set ans [tk_getOpenFile {*}[array get type_args_array]]
544  }
545  default {
546  set ans [tk_chooseDirectory {*}[array get type_args_array]]
547  }
548  }
549 
550  # Configure the label and set the preference value
551  if {$ans ne ""} {
552  set pref_ui::prefs($varname) $ans
553  init_fp $win $varname
554  }
555 
556  }

§ fp_clear()

pref_ui::fp_clear   win varname  

Definition at line 560 of file pref_ui.tcl.

560  proc fp_clear {win varname} {
561 
562  # Clear the preference value
563  set pref_ui::prefs($varname) ""
564 
565  # Set the filepicker state
566  init_fp $win $varname
567 
568  }

§ gather_var_table()

pref_ui::gather_var_table

Definition at line 1800 of file pref_ui.tcl.

1800  proc gather_var_table {} {
1801 
1802  variable widgets
1803  variable prefs
1804 
1805  set values [list]
1806 
1807  for {set i 0} {$i < [$widgets(var_table) size]} {incr i} {
1808  if {([set var [$widgets(var_table) cellcget $i,var -text]] ne "") && \
1809  ([set val [$widgets(var_table) cellcget $i,val -text]] ne "")} {
1810  lappend values [list $var $val]
1811  } else {
1812  return
1813  }
1814  }
1815 
1816  set prefs(General/Variables) $values
1817 
1818  }

§ get_grid_row()

pref_ui::get_grid_row   w  

Definition at line 112 of file pref_ui.tcl.

112  proc get_grid_row {w} {
113 
114  lassign [grid size [winfo parent $w]] col row
115 
116  # If we are the first row, configure the grid
117  if {$row == 0} {
118  grid columnconfigure [winfo parent $w] 3 -weight 1
119  }
120 
121  return $row
122 
123  }

§ handle_emmet_aa_select()

pref_ui::handle_emmet_aa_select

Definition at line 2931 of file pref_ui.tcl.

2931  proc handle_emmet_aa_select {} {
2932 
2933  variable widgets
2934 
2935  # Get the current selection
2936  set selected [$widgets(emmet_aa_tl) curselection]
2937 
2938  if {$selected ne ""} {
2939  $widgets(emmet_aa_del) configure -state normal
2940  } else {
2941  $widgets(emmet_aa_del) configure -state disabled
2942  }
2943 
2944  # Update the preview
2945  emmet_aa_show_preview [$widgets(emmet_aa_tl) cellcget $selected,value -text]
2946 
2947  }

§ handle_emmet_na_select()

pref_ui::handle_emmet_na_select

Definition at line 2827 of file pref_ui.tcl.

2827  proc handle_emmet_na_select {} {
2828 
2829  variable widgets
2830 
2831  # Get the current selection
2832  set selected [$widgets(emmet_na_tl) curselection]
2833 
2834  if {$selected ne ""} {
2835  $widgets(emmet_na_del) configure -state normal
2836  } else {
2837  $widgets(emmet_na_del) configure -state disabled
2838  }
2839 
2840  # Update the preview
2841  emmet_na_show_preview [$widgets(emmet_na_tl) cellcget $selected,alias -text]
2842 
2843  }

§ handle_lang_left_click()

pref_ui::handle_lang_left_click   w x y  

Definition at line 1859 of file pref_ui.tcl.

1859  proc handle_lang_left_click {w x y} {
1860 
1861  variable prefs
1862 
1863  lassign [tablelist::convEventFields $w $x $y] tbl x y
1864  lassign [split [$tbl containingcell $x $y] ,] row col
1865 
1866  if {$row >= 0} {
1867  if {$col == 0} {
1868  set lang [$tbl cellcget $row,lang -text]
1869  if {[$tbl cellcget $row,$col -text]} {
1870  $tbl cellconfigure $row,$col -text 0 -image pref_unchecked
1871  lappend prefs(General/DisabledLanguages) $lang
1872  } else {
1873  $tbl cellconfigure $row,$col -text 1 -image pref_checked
1874  set index [lsearch $prefs(General/DisabledLanguages) $lang]
1875  set prefs(General/DisabledLanguages) [lreplace $prefs(General/DisabledLanguages) $index $index]
1876  }
1877  }
1878  }
1879 
1880  }

§ handle_nfs_select()

pref_ui::handle_nfs_select

Definition at line 4753 of file pref_ui.tcl.

4753  proc handle_nfs_select {} {
4754 
4755  variable widgets
4756 
4757  if {[$widgets(advanced_tl) curselection] ne ""} {
4758  $widgets(advanced_nfs_del) configure -state normal
4759  } else {
4760  $widgets(advanced_nfs_del) configure -state disabled
4761  }
4762 
4763  }

§ handle_plugins_change()

pref_ui::handle_plugins_change   plugin  

Definition at line 4313 of file pref_ui.tcl.

4313  proc handle_plugins_change {plugin} {
4314 
4315  variable widgets
4316 
4317  # Change the menubutton text
4318  $widgets(plugins_mb) configure -text $plugin
4319 
4320  # Select the needed frame
4321  $widgets(plugins_nb) select $widgets(plugins_nb).$plugin
4322 
4323 
4324  }

§ handle_prefs_change()

pref_ui::handle_prefs_change   session language name1 name2 op  

Definition at line 1230 of file pref_ui.tcl.

1230  proc handle_prefs_change {session language name1 name2 op} {
1231 
1232  variable widgets
1233  variable prefs
1234  variable changes
1235 
1236  if {[winfo exists .prefwin]} {
1237 
1238  # Track the preferences change
1239  set changes($name2) $prefs($name2)
1240  array unset changes General/*
1241  array unset changes Help/*
1242  array unset changes Debug/*
1243  array unset changes Tools/Profile*
1244 
1245  # Save the preferences
1246  preferences::save_prefs $session $language [array get prefs]
1247 
1248  # Refresh any UI state after the preferences update
1249  init_mb $widgets(appear_theme) Appearance/Theme [themes::get_visible_themes]
1250 
1251  }
1252 
1253  }

§ handle_sb_change()

pref_ui::handle_sb_change   w varname  

Definition at line 420 of file pref_ui.tcl.

420  proc handle_sb_change {w varname} {
421 
422  set pref_ui::prefs($varname) [$w get]
423 
424  }

§ handle_share_change()

pref_ui::handle_share_change

Definition at line 1942 of file pref_ui.tcl.

1942  proc handle_share_change {} {
1943 
1944  variable share_changed
1945 
1946  set share_changed 1
1947 
1948  }

§ handle_share_directory()

pref_ui::handle_share_directory

Definition at line 1916 of file pref_ui.tcl.

1916  proc handle_share_directory {} {
1917 
1918  variable widgets
1919  variable enable_share
1920 
1921  if {$enable_share} {
1922  if {[set share_dir [tk_chooseDirectory -parent .prefwin -title [msgcat::mc "Select Settings Sharing Directory"]]] eq ""} {
1923  set enable_share 0
1924  } else {
1925  $widgets(share_entry) configure -state normal
1926  $widgets(share_entry) delete 0 end
1927  $widgets(share_entry) insert end $share_dir
1928  $widgets(share_entry) configure -state readonly
1930  }
1931  } else {
1932  $widgets(share_entry) configure -state normal
1933  $widgets(share_entry) delete 0 end
1934  $widgets(share_entry) configure -state readonly
1936  }
1937 
1938  }

§ handle_var_select()

pref_ui::handle_var_select

Definition at line 1737 of file pref_ui.tcl.

1737  proc handle_var_select {} {
1738 
1739  variable widgets
1740 
1741  # Enable the delete button
1742  if {[$widgets(var_table) curselection] eq ""} {
1743  $widgets(var_del) configure -state disabled
1744  } else {
1745  $widgets(var_del) configure -state normal
1746  }
1747 
1748  }

§ init_cp()

pref_ui::init_cp   w varname  

Definition at line 458 of file pref_ui.tcl.

458  proc init_cp {w varname} {
459 
460  [$w cget -image] configure -background $pref_ui::prefs($varname)
461 
462  }

§ init_fp()

pref_ui::init_fp   w varname  

Definition at line 510 of file pref_ui.tcl.

510  proc init_fp {w varname} {
511 
512  $w.l configure -text $pref_ui::prefs($varname)
513 
514  if {$pref_ui::prefs($varname) eq ""} {
515  $w.c configure -state disabled
516  } else {
517  $w.c configure -state normal
518  }
519 
520  }

§ init_mb()

pref_ui::init_mb   w varname values  

Definition at line 214 of file pref_ui.tcl.

214  proc init_mb {w varname values} {
215 
216  # Get the menu from the menubutton
217  set mnu [$w cget -menu]
218 
219  # Clear the menu
220  $mnu delete 0 end
221 
222  foreach value $values {
223  $mnu add radiobutton -label $value -variable pref_ui::prefs($varname) -value $value
224  }
225 
226  }

§ init_sb()

pref_ui::init_sb   w varname  

Definition at line 412 of file pref_ui.tcl.

412  proc init_sb {w varname} {
413 
414  $w set $pref_ui::prefs($varname)
415 
416  }

§ init_table()

pref_ui::init_table   w varname cols  

Definition at line 652 of file pref_ui.tcl.

652  proc init_table {w varname cols} {
653 
654  # Clear the table
655  $w delete 0 end
656 
657  # Insert the contents into the table
658  foreach row $pref_ui::prefs($varname) {
659  $w insert end $row
660  }
661 
662  # Set checkbutton images, if necessary
663  set column 0
664  foreach col $cols {
665  array set opts $col
666  if {$opts(-type) eq "checkbutton"} {
667  for {set i 0} {$i < [$w size]} {incr i} {
668  $w cellconfigure $i,$column -image [expr {[$w cellcget $i,$column -text] ? "pref_checked" : "pref_unchecked"}]
669  }
670  }
671  incr column
672  }
673 
674  }

§ init_text()

pref_ui::init_text   w varname  

Definition at line 335 of file pref_ui.tcl.

335  proc init_text {w varname} {
336 
337  # Inser the text
338  $w delete 1.0 end
339  $w insert end $pref_ui::prefs($varname)
340 
341  # Set the edit status to false
342  $w edit modified 0
343 
344  # Redisable the Save button
345  [winfo parent $w].bf.save configure -state disabled
346 
347  }

§ init_token()

pref_ui::init_token   w varname  

Definition at line 285 of file pref_ui.tcl.

285  proc init_token {w varname} {
286 
287  $w tokendelete 0 end
288  $w tokeninsert end $pref_ui::prefs($varname)
289 
290  }

§ initialize_widgets()

pref_ui::initialize_widgets

Definition at line 98 of file pref_ui.tcl.

98  proc initialize_widgets {} {
99 
100  variable initialize_callbacks
101 
102  foreach callback $initialize_callbacks {
103  uplevel #0 $callback
104  }
105 
106  }

§ lang_edit_end_command()

pref_ui::lang_edit_end_command   tbl row col value  

Definition at line 1884 of file pref_ui.tcl.

1884  proc lang_edit_end_command {tbl row col value} {
1885 
1886  variable prefs
1887 
1888  set lang [$tbl cellcget $row,lang -text]
1889  set patterns [syntax::get_file_patterns $lang]
1890 
1891  set lang_oride [list]
1892  foreach pattern $patterns {
1893  if {[lsearch -exact $value $pattern] == -1} {
1894  lappend lang_oride "-$pattern"
1895  }
1896  }
1897  foreach val $value {
1898  if {[lsearch -exact $patterns $val] == -1} {
1899  lappend lang_oride "+$val"
1900  }
1901  }
1902  array set pref_orides $prefs(General/LanguagePatternOverrides)
1903  if {[llength $lang_oride] == 0} {
1904  unset pref_orides($lang)
1905  } else {
1906  set pref_orides($lang) $lang_oride
1907  }
1908  set prefs(General/LanguagePatternOverrides) [array get pref_orides]
1909 
1910  return $value
1911 
1912  }

§ make_cb()

pref_ui::make_cb   w msg varname ?grid?  

Definition at line 143 of file pref_ui.tcl.

143  proc make_cb {w msg varname {grid 0}} {
144 
145  # Create the widget
146  ttk::checkbutton $w -text [format " %s" $msg] -variable pref_ui::prefs($varname)
147 
148  # Pack the widget
149  if {$grid} {
150  grid $w -row [get_grid_row $w] -column 0 -sticky ew -columnspan 4 -padx 2 -pady 2
151  } else {
152  pack $w -fill x -padx 2 -pady 2
153  }
154 
155  # Register the widget for search
156  register $w $msg $varname
157 
158  return $w
159 
160  }

§ make_cp()

pref_ui::make_cp   w msg varname start_color ?grid?  

Definition at line 428 of file pref_ui.tcl.

428  proc make_cp {w msg varname start_color {grid 0}} {
429 
430  # Create the bitmap containing the color
431  set img [image create bitmap -file [file join $::tke_dir lib images color_box.bmp] -background $start_color -foreground black]
432 
433  # Create the widget
434  if {$grid} {
435  ttk::label ${w}l -text [format "%s: " $msg]
436  set win [ttk::button ${w}b -style BButton -image $img -command [list pref_ui::change_cp ${w}b $varname]]
437  set row [get_grid_row ${w}l]
438  grid ${w}l -row $row -column 0 -sticky news -padx 2 -pady 2
439  grid ${w}b -row $row -column 1 -sticky news -padx 2 -pady 2
440  } else {
441  pack [ttk::label $w] -fill x
442  pack [ttk::label $w.l -text [format "%s: " $msg]] -side left -padx 2 -pady 2
443  pack [set win [ttk::button $w.b -style BButton -image $img -command [list pref_ui::change_cp $w.b $varname]]] -side left -padx 2 -pady 2
444  }
445 
446  # Add the widget to the initialize_callbacks array
447  register_initialization [list pref_ui::init_cp $win $varname]
448 
449  # Register the widget
450  register $win $msg $varname
451 
452  return $win
453 
454  }

§ make_entry()

pref_ui::make_entry   w msg varname ?grid? ?help?  

Definition at line 230 of file pref_ui.tcl.

230  proc make_entry {w msg varname {grid 0} {help ""}} {
231 
232  # Create the widget
233  ttk::labelframe $w -text $msg
234  pack [ttk::entry $w.e -textvariable pref_ui::prefs($varname)] -fill x
235  if {$help ne ""} {
236  make_help $w $help
237  }
238 
239  # Pack the widget
240  if {$grid} {
241  grid $w -row [get_grid_row $w] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
242  } else {
243  pack $w -fill x -padx 2 -pady 2
244  }
245 
246  # Register the widget for search
247  register $w.e $msg $varname
248 
249  return $w.e
250 
251  }

§ make_fp()

pref_ui::make_fp   w msg varname type ?type_args? ?grid? ?help?  

Definition at line 480 of file pref_ui.tcl.

480  proc make_fp {w msg varname type {type_args {}} {grid 0} {help ""}} {
481 
482  # Create the widget
483  set frame [ttk::labelframe $w -text $msg]
484  pack [set win [ttk::label $w.l]] -side left -fill x -padx 2 -pady 2
485  pack [ttk::button $w.c -style BButton -text [msgcat::mc "Clear"] -command [list pref_ui::fp_clear $w $varname]] -side right -padx 2 -pady 2
486  pack [ttk::button $w.b -style BButton -text [format "%s..." [msgcat::mc "Browse"]] -command [list pref_ui::fp_browse $w $varname $type $type_args]] -side right -padx 2 -pady 2
487 
488  if {$help ne ""} {
489  make_help $w $help
490  }
491 
492  if {$grid} {
493  grid $w -row [get_grid_row $w] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
494  } else {
495  pack $w -fill x -padx 2 -pady 2
496  }
497 
498  # Add the widget to the initialize_callbacks array
499  register_initialization [list pref_ui::init_fp $w $varname]
500 
501  # Register the widget
502  register $win $msg $varname
503 
504  return $win
505 
506  }

§ make_help()

pref_ui::make_help   w msg ?grid?  

Definition at line 792 of file pref_ui.tcl.

792  proc make_help {w msg {grid 0}} {
793 
794  set win [ttk::frame $w.help[llength [lsearch -all [winfo children $w] $w.help*]]]
795  pack [ttk::label $win.t -text " "] -side left -padx 2 -pady 2
796  pack [ttk::label $win.l -style HLabel -wraplength 500 -text $msg] -side left -padx 2 -pady 2
797 
798  if {$grid} {
799  grid $win -row [get_grid_row $win] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
800  } else {
801  pack $win -fill x
802  }
803 
804  return $win
805 
806  }

§ make_mb()

pref_ui::make_mb   w msg varname values ?grid?  

Definition at line 185 of file pref_ui.tcl.

185  proc make_mb {w msg varname values {grid 0}} {
186 
187  # Create and pack the widget
188  if {$grid} {
189  ttk::label ${w}l -text $msg
190  set win [ttk::menubutton ${w}mb -textvariable pref_ui::prefs($varname) \
191  -menu [set mnu [menu ${w}mbMenu -tearoff 0]]]
192  set row [get_grid_row ${w}l]
193  grid ${w}l -row $row -column 0 -sticky news -padx 2 -pady 2
194  grid ${w}mb -row $row -column 1 -sticky news -columnspan 2 -padx 2 -pady 2
195  } else {
196  pack [ttk::frame $w] -fill x
197  pack [ttk::label $w.l -text $msg] -side left -padx 2 -pady 2
198  pack [set win [ttk::menubutton $w.mb -textvariable pref_ui::prefs($varname) \
199  -menu [set mnu [menu $w.mbMenu -tearoff 0]]]] -side left -padx 2 -pady 2
200  }
201 
202  # Populate the menu
203  init_mb $win $varname $values
204 
205  # Register the widget
206  register $win $msg $varname
207 
208  return $win
209 
210  }

§ make_rb()

pref_ui::make_rb   w msg varname value ?grid?  

Definition at line 164 of file pref_ui.tcl.

164  proc make_rb {w msg varname value {grid 0}} {
165 
166  # Create the widget
167  ttk::radiobutton $w -text [format " %s" $msg] -variable pref_ui::prefs($varname) -value $value
168 
169  # Pack the widget
170  if {$grid} {
171  grid $w -row [get_grid_row $w] -column 0 -sticky ew -columnspan 4 -padx 2 -pady 2
172  } else {
173  pack $w -fill x -padx 2 -pady 2
174  }
175 
176  # Register the widget for search
177  register $w $msg $varname
178 
179  return $w
180 
181  }

§ make_sb()

pref_ui::make_sb   w msg varname from to inc ?grid? ?endmsg?  

Definition at line 376 of file pref_ui.tcl.

376  proc make_sb {w msg varname from to inc {grid 0} {endmsg ""}} {
377 
378  variable widgets
379 
380  if {$grid} {
381  ttk::label ${w}l -text [format "%s: " $msg]
382  set win [$widgets(sb) ${w}sb {*}$widgets(sb_opts) -from $from -to $to -increment $inc \
383  -width [string length $to] -state readonly -command [list pref_ui::handle_sb_change ${w}sb $varname]]
384  set row [get_grid_row ${w}l]
385  grid ${w}l -row $row -column 0 -sticky news -padx 2 -pady 2
386  grid ${w}sb -row $row -column 1 -sticky news -padx 2 -pady 2
387  if {$endmsg ne ""} {
388  grid [ttk::label ${w}l2 -text $endmsg] -row $row -column 2 -sticky news -padx 2 -pady 2
389  }
390  } else {
391  pack [ttk::frame $w] -fill x
392  pack [ttk::label $w.l -text [format "%s: " $msg]] -side left -padx 2 -pady 2
393  pack [set win [$widgets(sb) $w.sb {*}$widgets(sb_opts) -from $from -to $to -increment $inc \
394  -width [string length $to] -state readonly -command [list pref_ui::handle_sb_change $w.sb $varname]]] -side left -padx 2 -pady 2
395  if {$endmsg ne ""} {
396  pack [ttk::label $w.l2 -text $endmsg] -side left -padx 2 -pady 2
397  }
398  }
399 
400  # Add the widget to the initialize_callbacks array
401  register_initialization [list pref_ui::init_sb $win $varname]
402 
403  # Register the widget
404  register $win $msg $varname
405 
406  return $win
407 
408  }

§ make_spacer()

pref_ui::make_spacer   w ?grid?  

Definition at line 127 of file pref_ui.tcl.

127  proc make_spacer {w {grid 0}} {
128 
129  set win [ttk::label $w.spacer[llength [lsearch -all [winfo children $w] $w.spacer*]]]
130 
131  if {$grid} {
132  grid $win -row [get_grid_row $win] -column 0 -sticky ew -columnspan 4
133  } else {
134  pack $win -fill x
135  }
136 
137  return $win
138 
139  }

§ make_table()

pref_ui::make_table   w msg varname columns height ?grid? ?help?  

Definition at line 573 of file pref_ui.tcl.

573  proc make_table {w msg varname columns height {grid 0} {help ""}} {
574 
575  set tl_cols [list]
576  set cols [list]
577 
578  # Sort out the column information
579  foreach column $columns {
580  set args [lassign $column title]
581  array set opts {
582  -width 0
583  -type "text"
584  -editable 1
585  -value ""
586  -values {}
587  }
588  array set opts $args
589  lappend cols [array get opts]
590  lappend tl_cols $opts(-width) $title
591  array unset opts
592  }
593 
594  ttk::labelframe $w -text $msg
595  set win [tablelist::tablelist $w.tl -columns $tl_cols \
596  -stretch all -editselectedonly 1 -exportselection 0 -showseparators 1 \
597  -height $height -borderwidth 0 -highlightthickness 0 \
598  -editstartcommand [list pref_ui::table_edit_start_command $varname $cols] \
599  -editendcommand [list pref_ui::table_edit_end_command $varname $cols] \
600  -xscrollcommand [list utils::set_xscrollbar $w.hb] \
601  -yscrollcommand [list utils::set_yscrollbar $w.vb]]
602  scroller::scroller $w.vb -orient vertical -command [list $w.tl yview]
603  scroller::scroller $w.hb -orient horizontal -command [list $w.tl xview]
604  ttk::frame $w.bf
605  pack [ttk::button $w.bf.add -style BButton -text [msgcat::mc "Add"] -command [list pref_ui::table_add $win $cols $varname]] -side left -padx 2 -pady 2
606  pack [ttk::button $w.bf.del -style BButton -text [msgcat::mc "Delete"] -command [list pref_ui::table_delete $win $varname] -state disabled] -side left -padx 2 -pady 2
607 
609 
610  for {set i 0} {$i < [$win columncount]} {incr i} {
611  array set opts [lindex $cols $i]
612  switch $opts(-type) {
613  text { $win columnconfigure $i -editable $opts(-editable) -resizable 1 -stretchable 1}
614  checkbutton { $win columnconfigure $i -editable 0 -resizable 0 -stretchable 0 -formatcommand [list pref_ui::empty_string]}
615  menubutton { $win columnconfigure $i -editable 1 -resizable 0 -stretchable 1 -editwindow menubutton}
616  }
617  }
618 
619  bind $win <<TablelistSelect>> [list pref_ui::table_selected $win]
620  bind [$win bodytag] <Button-1> [list pref_ui::table_left_click %W $cols %x %y $varname]
621 
622  grid rowconfigure $w 1 -weight 1
623  grid columnconfigure $w 0 -weight 1
624  grid $w.tl -row 0 -column 0 -sticky news -rowspan 2
625  grid [$w.tl cornerpath] -row 0 -column 1 -sticky news
626  grid $w.vb -row 1 -column 1 -sticky ns
627  grid $w.hb -row 2 -column 0 -sticky ew
628  grid $w.bf -row 3 -column 0 -sticky ew -columnspan 2
629 
630  if {$help ne ""} {
631  make_help $w $help 1
632  }
633 
634  if {$grid} {
635  grid $w -row [get_grid_row $w] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
636  } else {
637  pack $w -fill both -expand yes -padx 2 -pady 2
638  }
639 
640  # Add the widget to the initialize_callbacks array
641  register_initialization [list pref_ui::init_table $win $varname $cols]
642 
643  # Register the widget
644  register $win $msg $varname
645 
646  return $win
647 
648  }

§ make_text()

pref_ui::make_text   w msg varname height ?grid? ?help?  

Definition at line 294 of file pref_ui.tcl.

294  proc make_text {w msg varname height {grid 0} {help ""}} {
295 
296  ttk::labelframe $w -text $msg
297  text $w.t -height $height -borderwidth 0 -highlightthickness 0 \
298  -xscrollcommand [list utils::set_xscrollbar $w.hb] -yscrollcommand [list utils::set_yscrollbar $w.vb]
299  scroller::scroller $w.vb -orient vertical -command [list $w.t yview]
300  scroller::scroller $w.hb -orient horizontal -command [list $w.t xview]
301  ttk::frame $w.bf
302  pack [ttk::button $w.bf.save -style BButton -text [msgcat::mc "Save"] -command [list pref_ui::text_save $w.t $varname] -state disabled] -side left -padx 2 -pady 2
303 
304  bind $w.t <<Modified>> [list pref_ui::text_modified $w]
305 
306  grid rowconfigure $w 0 -weight 1
307  grid columnconfigure $w 0 -weight 1
308  grid $w.t -row 0 -column 0 -sticky news
309  grid $w.vb -row 0 -column 1 -sticky ns
310  grid $w.hb -row 1 -column 0 -sticky ew
311  grid $w.bf -row 2 -column 0 -sticky ew
312 
313  if {$help ne ""} {
314  make_help $w $help 1
315  }
316 
317  # Register the widget for initialization
318  register_initialization [list pref_ui::init_text $w.t $varname]
319 
320  if {$grid} {
321  grid $w -row [get_grid_row $w] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
322  } else {
323  pack $w -fill both -expand yes -padx 2 -pady 2
324  }
325 
326  # Register the widget for search
327  register $w.t $msg $varname
328 
329  return $w.t
330 
331  }

§ make_token()

pref_ui::make_token   w msg varname watermark ?grid? ?help?  

Definition at line 255 of file pref_ui.tcl.

255  proc make_token {w msg varname watermark {grid 0} {help ""}} {
256 
257  # Create the widget
258  ttk::labelframe $w -text $msg
259  pack [tokenentry::tokenentry $w.te -tokenvar pref_ui::prefs($varname) \
260  -watermark $watermark -tokenshape square] -fill x
261 
262  if {$help ne ""} {
263  make_help $w $help
264  }
265 
266  # Pack the widget
267  if {$grid} {
268  grid $w -row [get_grid_row $w] -column 0 -sticky news -columnspan 4 -padx 2 -pady 2
269  } else {
270  pack $w -fill x -padx 2 -pady 2
271  }
272 
273  # Initialize the widget
274  register_initialization [list pref_ui::init_token $w.te $varname]
275 
276  # Register the widget for search
277  register $w.te $msg $varname
278 
279  return $w.te
280 
281  }

§ move_to_trash_changed()

pref_ui::move_to_trash_changed   w  

Definition at line 1678 of file pref_ui.tcl.

1678  proc move_to_trash_changed {w} {
1679 
1680  variable prefs
1681 
1682  $w configure -state [expr {$prefs(General/UseMoveToTrash) ? "normal" : "disabled"}]
1683 
1684  }

§ nfs_add()

pref_ui::nfs_add

Definition at line 4718 of file pref_ui.tcl.

4718  proc nfs_add {} {
4719 
4720  variable widgets
4721 
4722  # Insert the blank row into the table
4723  set row [$widgets(advanced_tl) insert end [list "" "" ""]]
4724 
4725  # Clear any selections and make the first cell editable
4726  $widgets(advanced_tl) selection clear 0 end
4727  $widgets(advanced_tl) editcell $row,host
4728 
4729  # Disable the delete button
4730  $widgets(advanced_nfs_del) configure -state disabled
4731 
4732  }

§ nfs_delete()

pref_ui::nfs_delete

Definition at line 4736 of file pref_ui.tcl.

4736  proc nfs_delete {} {
4737 
4738  variable widgets
4739 
4740  # Delete the current selection
4741  $widgets(advanced_tl) delete [$widgets(advanced_tl) curselection]
4742 
4743  # Disable the delete button
4744  $widgets(advanced_nfs_del) configure -state disabled
4745 
4746  # Update the NFSMounts preference value
4748 
4749  }

§ nfs_edit_end_command()

pref_ui::nfs_edit_end_command   tbl row col value  

Definition at line 4707 of file pref_ui.tcl.

4707  proc nfs_edit_end_command {tbl row col value} {
4708 
4709  after 1 [list pref_ui::set_nfs_mounts]
4710 
4711  return $value
4712 
4713  }

§ pane_clicked()

pref_ui::pane_clicked   panel ?tab?  

Definition at line 1095 of file pref_ui.tcl.

1095  proc pane_clicked {panel {tab ""}} {
1096 
1097  variable widgets
1098 
1099  # Delete the search text
1100  $widgets(match_e) delete 0 end
1101 
1102  # Remove the results frame
1103  catch { place forget $widgets(match_f)}
1104 
1105  # Clear all of the panel selection labels, if necessary
1106  foreach p [winfo children $widgets(panes)] {
1107  $p state !active
1108  }
1109 
1110  # Set the color of the label to the given color
1111  $widgets(panes).$panel state active
1112 
1113  # Show the panel
1114  show_panel $panel $tab
1115 
1116  }

§ perform_search()

pref_ui::perform_search   value  

Definition at line 1281 of file pref_ui.tcl.

1281  proc perform_search {value} {
1282 
1283  variable widgets
1284  variable search
1285  variable selected_session
1286  variable selected_language
1287 
1288  set matches [list]
1289 
1290  array set tabs1 [list]
1291 
1292  # Get the list of matches
1293  if {$value ne ""} {
1294  if {$selected_language eq [msgcat::mc "All"]} {
1295  if {$selected_session eq [msgcat::mc "None"]} {
1296  set matches [array names search -regexp (?i).*$value.*::a.*]
1297  } else {
1298  set matches [array names search -regexp (?i).*$value.*::.*b.*]
1299  }
1300  } else {
1301  set matches [array names search -regexp (?i).*$value.*::.*c]
1302  }
1303  foreach match $matches {
1304  lassign $search($match) win lbl plugin tab1 tab2
1305  set tabs1($tab1) [list $win $lbl]
1306  }
1307  }
1308 
1309  # Display the matches
1310  if {[set match_len [llength $matches]] > 0} {
1311  $widgets(match_lb) delete 0 end
1312  foreach match $matches {
1313  $widgets(match_lb) insert end [lindex [split $match ::] 0]
1314  }
1315  $widgets(match_lb) configure -height [expr (($match_len) > 10) ? 10 : $match_len]
1316  place $widgets(match_f) -relx 0.5 -relwidth 0.5 -rely 0.0
1317  } else {
1318  catch { place forget $widgets(match_f)}
1319  }
1320 
1321  foreach p [winfo children $widgets(panes)] {
1322  $p state !active
1323  }
1324 
1325  # Display the tab if there is only one match
1326  foreach tab [array names tabs1] {
1327  $tab state active
1328  }
1329 
1330  # Select the first item in the list
1331  $widgets(match_lb) see 0
1332  $widgets(match_lb) selection clear 0 end
1333  $widgets(match_lb) selection set 0
1334  $widgets(match_lb) selection anchor 0
1335  $widgets(match_lb) activate 0
1336 
1337  return 1
1338 
1339  }

§ populate_lang_menu()

pref_ui::populate_lang_menu   session  

Definition at line 829 of file pref_ui.tcl.

829  proc populate_lang_menu {session} {
830 
831  variable widgets
832  variable selected_language
833 
834  syntax::populate_syntax_menu $widgets(sellmenu) [list pref_ui::select $session $selected_language $session] pref_ui::selected_language [msgcat::mc "All"] [syntax::get_all_languages]
835 
836  }

§ populate_lang_table()

pref_ui::populate_lang_table

Definition at line 1823 of file pref_ui.tcl.

1823  proc populate_lang_table {} {
1824 
1825  variable widgets
1826  variable prefs
1827 
1828  # Get the list of languages to disable
1829  set dis_langs $prefs(General/DisabledLanguages)
1830 
1831  # Get the extension overrides
1832  array set orides $prefs(General/LanguagePatternOverrides)
1833 
1834  # Add all of the languages
1835  foreach lang [lsort [syntax::get_all_languages]] {
1836  set enabled [expr [lsearch $dis_langs $lang] == -1]
1837  set patterns [syntax::get_file_patterns $lang]
1838  if {[info exists orides($lang)]} {
1839  foreach pattern $orides($lang) {
1840  if {[string index $pattern 0] eq "+"} {
1841  lappend patterns [string range $pattern 1 end]
1842  } elseif {[set index [lsearch -exact $patterns [string range $pattern 1 end]]] != -1} {
1843  set patterns [lreplace $patterns $index $index]
1844  }
1845  }
1846  }
1847  set row [$widgets(lang_table) insert end [list $enabled $lang $patterns]]
1848  if {$enabled} {
1849  $widgets(lang_table) cellconfigure $row,enabled -image pref_checked
1850  } else {
1851  $widgets(lang_table) cellconfigure $row,enabled -image pref_unchecked
1852  }
1853  }
1854 
1855  }

§ populate_session_menu()

pref_ui::populate_session_menu   language  

Definition at line 810 of file pref_ui.tcl.

810  proc populate_session_menu {language} {
811 
812  variable widgets
813  variable selected_session
814 
815  # Delete the current menu
816  $widgets(selsmenu) delete 0 end
817 
818  # Populate the selection menu
819  $widgets(selsmenu) add radiobutton -label [msgcat::mc "None"] -variable pref_ui::selected_session -value [msgcat::mc "None"] -command [list pref_ui::select $selected_session $language [msgcat::mc "None"] $language]
820  $widgets(selsmenu) add separator
821  foreach name [sessions::get_names] {
822  $widgets(selsmenu) add radiobutton -label $name -variable pref_ui::selected_session -value $name -command [list pref_ui::select $selected_session $language $name $language]
823  }
824 
825  }

§ populate_shortcut_table()

pref_ui::populate_shortcut_table   mnu ?prefix?  

Definition at line 4251 of file pref_ui.tcl.

4251  proc populate_shortcut_table {mnu {prefix ""}} {
4252 
4253  variable widgets
4254 
4255  # If there are no elements return
4256  if {[set last [$mnu index end]] eq "none"} {
4257  return
4258  }
4259 
4260  for {set i 0} {$i <= $last} {incr i} {
4261  set type [$mnu type $i]
4262  switch $type {
4263  cascade {
4264  if {[string index [$mnu entrycget $i -label] 0] ne " "} {
4265  set lbl [string trim [$mnu entrycget $i -label]]
4266  populate_shortcut_table [$mnu entrycget $i -menu] "$prefix$lbl/"
4267  }
4268  }
4269  command -
4270  checkbutton -
4271  radiobutton {
4272  set lbl [string trim [$mnu entrycget $i -label]]
4273  if {(($type ne "command") || ([$mnu entrycget $i -command] ne "")) && ([string index [$mnu entrycget $i -label] 0] ne " ")} {
4274  set name "$prefix$lbl"
4275  $widgets(shortcut_tl) insert end [list $name [$mnu entrycget $i -accelerator] [bindings::is_cleared $name]]
4276  }
4277  }
4278  }
4279  }
4280 
4281  }

§ register()

pref_ui::register   w str var  

Definition at line 1399 of file pref_ui.tcl.

1399  proc register {w str var} {
1400 
1401  variable search
1402 
1403  # Figure out which notebooks
1404  set insts [split $w .]
1405  set tabs [list]
1406  set plugin [expr {([lindex $insts 4] eq "plugins") ? [lindex $insts 6] : ""}]
1407  lappend tabs .prefwin.f.bf.[lindex $insts 4]
1408  for {set i 3} {$i < [llength $insts]} {incr i} {
1409  set hier [join [lrange $insts 0 $i] .]
1410  if {[winfo class $hier] eq "TNotebook"} {
1411  lappend tabs [join [lrange $insts 0 [expr $i + 1]] .]
1412  }
1413  }
1414 
1415  lassign [split $var /] category var
1416 
1417  switch $category {
1418  General { set tag a}
1419  Appearance { set tag ab}
1420  Editor { set tag abc}
1421  Emmet { set tag ab}
1422  Find { set tag ab}
1423  Sidebar { set tag ab}
1424  View { set tag ab}
1425  Shortcuts { set tag a}
1426  Plugins { set tag a}
1427  Documentation { set tag c}
1428  Advanced { set tag a}
1429  default { set tag ""}
1430  }
1431 
1432  set lang_only [expr {($category eq "Editor") ? 1 : 0}]
1433  set search(${var}::$tag) [list $w $str $plugin {*}$tabs]
1434 
1435  if {$str ne ""} {
1436  set search(${str}::$tag) [list $w $str $plugin {*}$tabs]
1437  }
1438 
1439  }

§ register_initialization()

pref_ui::register_initialization   cmd  

Definition at line 88 of file pref_ui.tcl.

88  proc register_initialization {cmd} {
89 
90  variable initialize_callbacks
91 
92  lappend initialize_callbacks $cmd
93 
94  }

§ save_share_changes()

pref_ui::save_share_changes

Definition at line 1952 of file pref_ui.tcl.

1952  proc save_share_changes {} {
1953 
1954  variable widgets
1955  variable share_changed
1956 
1957  if {$share_changed} {
1958 
1959  # Gather the items
1960  set items [list]
1961  foreach {type nspace name} [share::get_share_items] {
1962  if {[set pref_ui::share_$type]} {
1963  lappend items $type
1964  }
1965  }
1966 
1967  # Save the changes
1968  share::save_changes [$widgets(share_entry) get] $items
1969 
1970  }
1971 
1972  }

§ search_clear()

pref_ui::search_clear

Definition at line 1381 of file pref_ui.tcl.

1381  proc search_clear {} {
1382 
1383  variable widgets
1384  variable current_panel
1385 
1386  # Delete the search text
1387  $widgets(match_e) delete 0 end
1388 
1389  # Remove the results frame
1390  catch { place forget $widgets(match_f)}
1391 
1392  # Make sure that the current tab is selected
1393  pane_clicked $current_panel
1394 
1395  }

§ search_select()

pref_ui::search_select

Definition at line 1343 of file pref_ui.tcl.

1343  proc search_select {} {
1344 
1345  variable widgets
1346  variable search
1347 
1348  # Get the selected item
1349  set selected_value [$widgets(match_lb) get active]
1350 
1351  # Get the information from the matching element
1352  set key [lindex [array names search ${selected_value}::*] 0]
1353  lassign $search($key) win lbl plugin tab1 tab2
1354 
1355  # Select the pane containing the item
1356  pane_clicked [lindex [split $tab1 .] end]
1357 
1358  # If the matched item is within a plugin preference pane, put the pane into view
1359  if {$plugin ne ""} {
1360  handle_plugins_change $plugin
1361  }
1362 
1363  # If the element exists within a notebook tab, display it
1364  if {$tab2 ne ""} {
1365  [winfo parent $tab2] select $tab2
1366  }
1367 
1368  # Select the match text
1369  $widgets(match_e) selection range 0 end
1370 
1371  # Remove the results frame
1372  catch { place forget $widgets(match_f)}
1373 
1374  # Give the focus to the matching element
1375  focus $win
1376 
1377  }

§ select()

pref_ui::select   prev_session prev_language session language ?init?  

Definition at line 840 of file pref_ui.tcl.

840  proc select {prev_session prev_language session language {init 0}} {
841 
842  variable widgets
843  variable prefs
844  variable current_panel
845 
846  # Check for any changes that we might want to save to another set of preferences
847  if {!$init && ![check_on_close $prev_session $prev_language]} {
848  return
849  }
850 
851  # Disable traces
852  catch { trace remove variable pref_ui::prefs {*}[lindex [trace info variable pref_ui::prefs] 0]} rc
853 
854  # Update the menubuttons text
855  $widgets(select_s) configure -text [format "%s: %s" [msgcat::mc "Session"] $session]
856  $widgets(select_l) configure -text [format "%s: %s" [msgcat::mc "Language"] $language]
857 
858  # Update the language menu in case the user changed the session
859  populate_session_menu $language
860  populate_lang_menu $session
861 
862  # Update the snippets table
863  if {!$init} {
864  snippets_set_language $language
865  }
866 
867  # Translate the session and language values
868  if {$session eq [msgcat::mc "None"]} {
869  set session ""
870  }
871  if {$language eq [msgcat::mc "All"]} {
872  set language ""
873  }
874 
875  # Setup the prefs
876  array unset prefs
877  array set prefs [preferences::get_loaded $session $language]
878 
879  # Initialize the widgets
880  if {!$init} {
882  }
883 
884  # Remove all listed panels
885  foreach panel [pack slaves $widgets(panes)] {
886  pack forget $panel
887  }
888 
889  # If we are only changing language information, remove the sidebar and just display the editor pane
890  if {$language ne ""} {
891 
892  # Display the editor and snippets panes
893  if {!$init} {
894  if {$session eq ""} {
895  foreach panel [list editor snippets documentation] {
896  pack $widgets(panes).$panel -fill both -padx 2 -pady 2
897  }
898  if {($current_panel ne "editor") && ($current_panel ne "snippets") && ($current_panel ne "documentation")} {
899  pane_clicked editor
900  }
901  } else {
902  pack $widgets(panes).editor -fill both -padx 2 -pady 2
903  pane_clicked editor
904  }
905  pack forget $widgets(snippets_lang_frame)
906  }
907 
908  # Otherwise, make sure the entire UI is displayed.
909  } else {
910 
911  if {!$init} {
912  if {$session eq ""} {
913  foreach panel [list general appearance editor find sidebar view snippets emmet shortcuts plugins advanced] {
914  pack $widgets(panes).$panel -fill both -padx 2 -pady 2
915  }
916  $widgets(frame).emmet.nb add $widgets(node_aliases)
917  $widgets(frame).emmet.nb add $widgets(abbr_aliases)
918  pane_clicked $current_panel
919  } else {
920  foreach panel [list appearance editor find sidebar view emmet] {
921  pack $widgets(panes).$panel -fill both -padx 2 -pady 2
922  }
923  $widgets(frame).emmet.nb hide $widgets(node_aliases)
924  $widgets(frame).emmet.nb hide $widgets(abbr_aliases)
925  if {($current_panel eq "general") || \
926  ($current_panel eq "snippets") || \
927  ($current_panel eq "shortcuts") || \
928  ($current_panel eq "plugins") || \
929  ($current_panel eq "advanced")} {
930  pane_clicked appearance
931  } else {
932  pane_clicked $current_panel
933  }
934  }
935  pack $widgets(snippets_lang_frame) -side right -padx 2 -pady 2
936  }
937 
938  }
939 
940  # Trace on any changes to the preferences variable
941  trace add variable pref_ui::prefs write [list pref_ui::handle_prefs_change $session $language]
942 
943  }

§ set_aliases()

pref_ui::set_aliases

Definition at line 2695 of file pref_ui.tcl.

2695  proc set_aliases {} {
2696 
2697  variable widgets
2698 
2699  # Retrieve the aliases from the Emmet namespace
2700  array set aliases [emmet::get_aliases]
2701 
2702  array set endings {
2703  0 <x/>
2704  1 <x></x>
2705  2 None
2706  }
2707 
2708  # Add the node aliases
2709  array set node_aliases $aliases(node_aliases)
2710  foreach alias [lsort [array names node_aliases]] {
2711  lassign $node_aliases($alias) name ending attrs
2712  set attr_value [list]
2713  foreach {attr value} $attrs {
2714  lappend attr_value "$attr=\"$value\""
2715  }
2716  $widgets(emmet_na_tl) insert end [list $alias $name $endings($ending) [join $attr_value]]
2717  }
2718 
2719  # Add the abbreviation aliases
2720  array set abbr_aliases $aliases(abbreviation_aliases)
2721  foreach alias [lsort [array names abbr_aliases]] {
2722  $widgets(emmet_aa_tl) insert end [list $alias $abbr_aliases($alias)]
2723  }
2724 
2725 
2726  }

§ set_attributes()

pref_ui::set_attributes

Definition at line 3106 of file pref_ui.tcl.

3106  proc set_attributes {} {
3107 
3108  variable attributes
3109  variable prefs
3110 
3111  set attrs [list]
3112  foreach {attr value} [array get attributes] {
3113  if {$value} {
3114  lappend attrs $attr
3115  }
3116  }
3117 
3118  set prefs(Sidebar/InfoPanelAttributes) [lsort $attrs]
3119 
3120  }

§ set_browse_dir()

pref_ui::set_browse_dir   value  

Definition at line 1703 of file pref_ui.tcl.

1703  proc set_browse_dir {value} {
1704 
1705  variable widgets
1706  variable prefs
1707 
1708  # Clear the browser label text
1709  $widgets(browse_l) configure -text ""
1710 
1711  switch $value {
1712  "last" {
1713  $widgets(browse_mb) configure -text [msgcat::mc "Last"]
1714  }
1715  "buffer" {
1716  $widgets(browse_mb) configure -text [msgcat::mc "Buffer"]
1717  }
1718  "current" {
1719  $widgets(browse_mb) configure -text [msgcat::mc "Current"]
1720  }
1721  default {
1722  if {[set dir [tk_chooseDirectory -parent .prefwin -title [msgcat::mc "Select default browsing directory"]]] ne ""} {
1723  $widgets(browse_mb) configure -text [msgcat::mc "Directory"]
1724  $widgets(browse_l) configure -text " $dir"
1725  set value $dir
1726  }
1727  }
1728  }
1729 
1730  # Update the preference value
1731  set prefs(General/DefaultFileBrowserDirectory) $value
1732 
1733  }

§ set_colorizers()

pref_ui::set_colorizers

Definition at line 2109 of file pref_ui.tcl.

2109  proc set_colorizers {} {
2110 
2111  variable colorizers
2112  variable prefs
2113 
2114  # Get the list of selected colorizers
2115  set colorize [list]
2116  foreach {name value} [array get colorizers] {
2117  if {$value} {
2118  lappend colorize $name
2119  }
2120  }
2121 
2122  # Set the preference array
2123  set prefs(Appearance/Colorize) [lsort $colorize]
2124 
2125  }

§ set_css_color_case()

pref_ui::set_css_color_case

Definition at line 2684 of file pref_ui.tcl.

2684  proc set_css_color_case {} {
2685 
2686  variable widgets
2687  variable prefs
2688 
2689  $widgets(emmet_ccmb) configure -text $prefs(Emmet/CSSColorCase)
2690 
2691  }

§ set_eol_translation()

pref_ui::set_eol_translation

Definition at line 2456 of file pref_ui.tcl.

2456  proc set_eol_translation {} {
2457 
2458  variable widgets
2459  variable prefs
2460 
2461  $widgets(editor_eolmb) configure -text $prefs(Editor/EndOfLineTranslation)
2462 
2463  }

§ set_font()

pref_ui::set_font   lbl title varname mono  

Definition at line 2129 of file pref_ui.tcl.

2129  proc set_font {lbl title varname mono} {
2130 
2131  variable prefs
2132 
2133  set opts [list]
2134  if {$mono} {
2135  lappend opts -mono 1 -styles Regular
2136  }
2137 
2138  # Select the new font
2139  if {[set new_font [fontchooser -parent .prefwin -title $title -initialfont [$lbl cget -font] -effects 0 {*}$opts]] ne ""} {
2140  $lbl configure -font $new_font
2141  set prefs($varname) $new_font
2142  }
2143 
2144  }

§ set_match_chars()

pref_ui::set_match_chars

Definition at line 2419 of file pref_ui.tcl.

2419  proc set_match_chars {} {
2420 
2421  variable match_chars
2422  variable prefs
2423 
2424  set mchars [list]
2425  foreach char [list square curly angled paren double single btick] {
2426  if {$match_chars($char)} {
2427  lappend mchars $char
2428  }
2429  }
2430 
2431  set prefs(Editor/AutoMatchChars) $mchars
2432 
2433  }

§ set_nfs_mounts()

pref_ui::set_nfs_mounts

Definition at line 4685 of file pref_ui.tcl.

4685  proc set_nfs_mounts {} {
4686 
4687  variable widgets
4688  variable prefs
4689 
4690  set values [list]
4691 
4692  for {set i 0} {$i < [$widgets(advanced_tl) size]} {incr i} {
4693  lassign [$widgets(advanced_tl) get $i] host nfs remote
4694  if {($host ne "") && ($nfs ne "") && ($remote ne "")} {
4695  lappend values $host [list $nfs $remote]
4696  } else {
4697  return
4698  }
4699  }
4700 
4701  set prefs(NFSMounts) $values
4702 
4703  }

§ set_release_type()

pref_ui::set_release_type

Definition at line 1688 of file pref_ui.tcl.

1688  proc set_release_type {} {
1689 
1690  variable widgets
1691  variable prefs
1692 
1693  if {$prefs(General/UpdateReleaseType) eq "stable"} {
1694  $widgets(upd_mb) configure -text [msgcat::mc "Stable"]
1695  } else {
1696  $widgets(upd_mb) configure -text [msgcat::mc "Development"]
1697  }
1698 
1699  }

§ set_snip_compl()

pref_ui::set_snip_compl

Definition at line 2438 of file pref_ui.tcl.

2438  proc set_snip_compl {} {
2439 
2440  variable snip_compl
2441  variable prefs
2442 
2443  set schars [list]
2444  foreach char [list space tab return] {
2445  if {$snip_compl($char)} {
2446  lappend schars $char
2447  }
2448  }
2449 
2450  set prefs(Editor/SnippetCompleters) $schars
2451 
2452  }

§ shortcut_cancel()

pref_ui::shortcut_cancel

Definition at line 4215 of file pref_ui.tcl.

4215  proc shortcut_cancel {} {
4216 
4217  variable widgets
4218 
4219  # Remove the shortcut editor frame
4220  grid remove $widgets(shortcut_frame)
4221  grid $widgets(shortcut_note)
4222 
4223  # Put the focus back on the shortcut table
4224  focus [$widgets(shortcut_tl) bodypath]
4225 
4226  }

§ shortcut_changed()

pref_ui::shortcut_changed

Definition at line 3846 of file pref_ui.tcl.

3846  proc shortcut_changed {} {
3847 
3848  variable widgets
3849 
3850  # Get the widget contents
3851  set mod [$widgets(shortcut_mod) get]
3852  set sym [$widgets(shortcut_sym) get]
3853 
3854  # Make sure that the Update button is enabled
3855  if {(($mod ne "") && ($sym ne "")) || [shortcut_sym_is_funckey]} {
3856  $widgets(shortcut_update) configure -state normal
3857  }
3858 
3859  # Update the modifier and symbol lists after checking for matches
3861 
3862  }

§ shortcut_check_matches()

pref_ui::shortcut_check_matches

Definition at line 3868 of file pref_ui.tcl.

3868  proc shortcut_check_matches {} {
3869 
3870  variable widgets
3871  variable mod_dict
3872  variable sym_dict
3873 
3874  # Get the current modifier
3875  if {[tk windowingsystem] eq "aqua"} {
3876  set curr_mod [list]
3877  foreach elem [split [$widgets(shortcut_mod) get] ""] {
3878  lappend curr_mod [lindex [bindings::accelerator_mapping $elem] 1]
3879  }
3880  } else {
3881  set curr_mod [split [$widgets(shortcut_mod) get] -]
3882  }
3883 
3884  # Get the current symbol
3885  set curr_sym [$widgets(shortcut_sym) get]
3886 
3887  # Create dictionaries from the mod_dict and sym_dict dictionaries
3888  set mods [dict create {*}[dict get $mod_dict]]
3889  set syms [dict create {*}[dict get $sym_dict]]
3890 
3891  # If the symbol widget is not displaying a function key, remove the empty space modifier
3892  if {![shortcut_sym_is_funckey]} {
3893  catch { dict unset mods {}}
3894  }
3895 
3896  # If we are on macOS, we need to remove dead keys and other keys that
3897  # would cause problems
3898  if {[tk windowingsystem] eq "aqua"} {
3899  if {[lsearch [list E I U Up Down Left Right] $curr_sym] != -1} {
3900  catch { dict unset mods Alt}
3901  }
3902  if {$curr_mod eq "Alt"} {
3903  catch { dict unset syms E I U Up Down Left Right}
3904  }
3905  }
3906 
3907  # Iterate through the table finding partial matches
3908  foreach tl_shortcut [$widgets(shortcut_tl) getcolumn shortcut] {
3909  if {$tl_shortcut ne ""} {
3910  if {[string range $tl_shortcut end-1 end] eq "--"} {
3911  set tl_list [split [string range $tl_shortcut 0 end-2] -]
3912  lappend tl_list "-"
3913  } else {
3914  set tl_list [split $tl_shortcut -]
3915  }
3916  if {[llength $tl_list] == 1} {
3917  set tl_mod ""
3918  } else {
3919  set tl_mod [lrange $tl_list 0 end-1]
3920  }
3921  set tl_sym [lindex $tl_list end]
3922  if {$curr_mod eq $tl_mod} {
3923  catch { dict unset syms $tl_sym}
3924  }
3925  if {$curr_sym eq $tl_sym} {
3926  catch { dict unset mods $tl_mod}
3927  }
3928  }
3929  }
3930 
3931  # Set the widgets
3932  $widgets(shortcut_mod) configure -values [dict values $mods]
3933  $widgets(shortcut_sym) configure -values [dict values $syms]
3934 
3935  }

§ shortcut_clear()

pref_ui::shortcut_clear

Definition at line 4128 of file pref_ui.tcl.

4128  proc shortcut_clear {} {
4129 
4130  variable widgets
4131 
4132  # Get the currently selected row
4133  set selected [$widgets(shortcut_tl) curselection]
4134 
4135  # Set the shortcut cell value
4136  $widgets(shortcut_tl) cellconfigure $selected,shortcut -text ""
4137  $widgets(shortcut_tl) cellconfigure $selected,clear -text 1
4138 
4139  # Save the table to the menu binding file
4141 
4142  # Close the shortcut after clearing
4144 
4145  }

§ shortcut_create_modifiers()

pref_ui::shortcut_create_modifiers

Definition at line 4063 of file pref_ui.tcl.

4063  proc shortcut_create_modifiers {} {
4064 
4065  variable widgets
4066  variable mod_dict
4067 
4068  set mod_dict [dict create]
4069 
4070  switch [tk windowingsystem] {
4071  aqua {
4072  set mods [list {} Cmd Ctrl Alt \
4073  Ctrl-Cmd Alt-Cmd Shift-Cmd Ctrl-Shift Ctrl-Alt Shift-Alt \
4074  Ctrl-Alt-Cmd Ctrl-Alt-Shift Ctrl-Shift-Cmd Alt-Shift-Cmd \
4075  Ctrl-Alt-Shift-Cmd]
4076  }
4077  win32 -
4078  x11 {
4079  set mods [list {} Ctrl Alt \
4080  Shift-Ctrl Ctrl-Alt Shift-Alt \
4081  Shift-Ctrl-Alt]
4082  }
4083  }
4084 
4085  if {[tk windowingsystem] eq "aqua"} {
4086  foreach mod $mods {
4087  set value [list "" "" "" ""]
4088  foreach elem [split $mod -] {
4089  lset value {*}[bindings::accelerator_mapping $elem]
4090  }
4091  dict set mod_dict $mod [join $value ""]
4092  }
4093  } else {
4094  foreach mod $mods {
4095  dict set mod_dict $mod $mod
4096  }
4097  }
4098 
4099  }

§ shortcut_create_symbols()

pref_ui::shortcut_create_symbols

Definition at line 4103 of file pref_ui.tcl.

4103  proc shortcut_create_symbols {} {
4104 
4105  variable widgets
4106  variable sym_dict
4107 
4108  set sym_dict [dict create]
4109  set syms [list A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 \
4110  4 5 6 7 8 9 ~ ! @ \# \$ % ^ & {\*} ( ) _ + ` - = \{ \} \[ \] | \\ : \
4111  {;} \" \' < , > . {\?} / Up Down Left Right Space Tab \
4112  F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12]
4113 
4114  if {[tk windowingsystem] eq "aqua"} {
4115  foreach sym $syms {
4116  dict set sym_dict $sym [lindex [bindings::accelerator_mapping $sym] 1]
4117  }
4118  } else {
4119  foreach sym $syms {
4120  dict set sym_dict $sym $sym
4121  }
4122  }
4123 
4124  }

§ shortcut_edit_item()

pref_ui::shortcut_edit_item   mnu lbl  

Definition at line 3957 of file pref_ui.tcl.

3957  proc shortcut_edit_item {mnu lbl} {
3958 
3959  variable widgets
3960 
3961  set mnu_path ""
3962  while {$mnu ne ".menubar"} {
3963  set parent_mnu [winfo parent $mnu]
3964  for {set i 0} {$i <= [$parent_mnu index end]} {incr i} {
3965  if {([$parent_mnu type $i] eq "cascade") && ([$parent_mnu entrycget $i -menu] eq $mnu)} {
3966  set mnu_path "[$parent_mnu entrycget $i -label]/$mnu_path"
3967  break
3968  }
3969  }
3970  set mnu $parent_mnu
3971  }
3972 
3973  # Create the full label based on the menu and label name
3974  set lbl "$mnu_path$lbl"
3975 
3976  # Search the table for the matching menu item (if none is found return)
3977  if {[set row [$widgets(shortcut_tl) searchcolumn label $lbl]] == -1} {
3978  return
3979  }
3980 
3981  # Select the row in the tabl
3982  $widgets(shortcut_tl) selection clear 0 end
3983  $widgets(shortcut_tl) selection set $row
3984  $widgets(shortcut_tl) see $row
3985 
3986  # Initiate the table selection
3988 
3989  }

§ shortcut_format()

pref_ui::shortcut_format   value  

Definition at line 4230 of file pref_ui.tcl.

4230  proc shortcut_format {value} {
4231 
4232  if {[tk windowingsystem] eq "aqua"} {
4233  set new_value [list "" "" "" "" ""]
4234  if {[string range $value end-1 end] eq "--"} {
4235  lset new_value 4 "-"
4236  set value [string range $value 0 end-2]
4237  }
4238  foreach elem [split $value -] {
4239  lset new_value {*}[bindings::accelerator_mapping $elem]
4240  }
4241  set value [join $new_value ""]
4242  }
4243 
4244  return $value
4245 
4246  }

§ shortcut_hide_tooltip()

pref_ui::shortcut_hide_tooltip   tbl  

Definition at line 3949 of file pref_ui.tcl.

3949  proc shortcut_hide_tooltip {tbl} {
3950 
3951  tooltip::tooltip clear $tbl
3952 
3953  }

§ shortcut_save()

pref_ui::shortcut_save

Definition at line 4190 of file pref_ui.tcl.

4190  proc shortcut_save {} {
4191 
4192  variable widgets
4193 
4194  set rows [list]
4195  set max 0
4196 
4197  # Get the table rows to save
4198  for {set i 0} {$i < [$widgets(shortcut_tl) size]} {incr i} {
4199  lassign [$widgets(shortcut_tl) get $i] mnu_path shortcut cleared
4200  if {($shortcut ne "") || $cleared} {
4201  if {[set mnu_len [string length $mnu_path]] > $max} {
4202  set max $mnu_len
4203  }
4204  lappend rows [list $mnu_path $shortcut]
4205  }
4206  }
4207 
4208  # Save the given bindings to the menu bindings file
4209  bindings::save $max $rows
4210 
4211  }

§ shortcut_search()

pref_ui::shortcut_search   value  

Definition at line 3778 of file pref_ui.tcl.

3778  proc shortcut_search {value} {
3779 
3780  variable widgets
3781 
3782  if {$value eq ""} {
3783  for {set i 0} {$i < [$widgets(shortcut_tl) size]} {incr i} {
3784  $widgets(shortcut_tl) rowconfigure $i -hide 0
3785  }
3786  } else {
3787  for {set i 0} {$i < [$widgets(shortcut_tl) size]} {incr i} {
3788  if {[string match -nocase *$value* [$widgets(shortcut_tl) cellcget $i,label -text]]} {
3789  $widgets(shortcut_tl) rowconfigure $i -hide 0
3790  } else {
3791  $widgets(shortcut_tl) rowconfigure $i -hide 1
3792  }
3793  }
3794  }
3795 
3796  return 1
3797 
3798  }

§ shortcut_show_tooltip()

pref_ui::shortcut_show_tooltip   tbl row col  

Definition at line 3939 of file pref_ui.tcl.

3939  proc shortcut_show_tooltip {tbl row col} {
3940 
3941  if {($row >= 0) && [$tbl iselemsnipped $row,$col full_text]} {
3942  tooltip::tooltip $tbl $full_text
3943  }
3944 
3945  }

§ shortcut_sym_is_funckey()

pref_ui::shortcut_sym_is_funckey

Definition at line 3834 of file pref_ui.tcl.

3834  proc shortcut_sym_is_funckey {} {
3835 
3836  variable widgets
3837 
3838  return [regexp {^F\d+$} [$widgets(shortcut_sym) get]]
3839 
3840  }

§ shortcut_table_select()

pref_ui::shortcut_table_select

Definition at line 3993 of file pref_ui.tcl.

3993  proc shortcut_table_select {} {
3994 
3995  variable widgets
3996 
3997  # Get the current selection
3998  set selected [$widgets(shortcut_tl) curselection]
3999 
4000  if {$selected eq ""} {
4001 
4002  # Hide the shortcut frame
4003  grid remove $widgets(shortcut_frame)
4004  grid $widgets(shortcut_note)
4005 
4006  } else {
4007 
4008  # Get the current shortcut menu from the table
4009  set shortcut [$widgets(shortcut_tl) cellcget $selected,shortcut -text]
4010  set value [list "" "" "" "" ""]
4011 
4012  # If the shortcut contains the minus key, pull it off and adjust the rest of the shortcut string
4013  if {[string range $shortcut end-1 end] eq "--"} {
4014  lset value 4 "-"
4015  set shortcut [string range $shortcut 0 end-2]
4016  }
4017 
4018  # Setup the value list
4019  if {[tk windowingsystem] eq "aqua"} {
4020  foreach elem [split $shortcut -] {
4021  lset value {*}[bindings::accelerator_mapping $elem]
4022  }
4023  } else {
4024  foreach elem [split $shortcut -] {
4025  lset value [lindex [bindings::accelerator_mapping $elem] 0] $elem
4026  }
4027  }
4028 
4029  # Set the current modifier and symbol
4030  if {[tk windowingsystem] eq "aqua"} {
4031  $widgets(shortcut_mod) set [join [lrange $value 0 3] ""]
4032  } else {
4033  $widgets(shortcut_mod) set [join [concat {*}[lrange $value 0 3]] "-"]
4034  }
4035  $widgets(shortcut_sym) set [lindex $value 4]
4036 
4037  # Make sure the Clear button state is set correctly
4038  if {$shortcut eq ""} {
4039  $widgets(shortcut_clear) configure -state disabled
4040  } else {
4041  $widgets(shortcut_clear) configure -state normal
4042  }
4043 
4044  # Disable the Update button
4045  $widgets(shortcut_update) configure -state disabled
4046 
4047  # Update the modifier and symbol lists after checking for matches
4049 
4050  # Display the shortcut frame
4051  grid remove $widgets(shortcut_note)
4052  grid $widgets(shortcut_frame)
4053 
4054  # Set the focus on the modifier
4055  focus $widgets(shortcut_mod)
4056 
4057  }
4058 
4059  }

§ shortcut_update()

pref_ui::shortcut_update

Definition at line 4150 of file pref_ui.tcl.

4150  proc shortcut_update {} {
4151 
4152  variable widgets
4153 
4154  set value ""
4155  set sym [$widgets(shortcut_sym) get]
4156 
4157  if {[set mod [$widgets(shortcut_mod) get]] ne ""} {
4158  if {$mod ne ""} {
4159  if {[tk windowingsystem] eq "aqua"} {
4160  set value [list "" "" "" "" ""]
4161  foreach elem [list {*}[split $mod ""] $sym] {
4162  lset value {*}[bindings::accelerator_mapping $elem]
4163  }
4164  set value [join [concat {*}$value] -]
4165  } else {
4166  set value "$mod-$sym"
4167  }
4168  }
4169  } else {
4170  set value $sym
4171  }
4172 
4173  # Get the currently selected shortcut
4174  set selected [$widgets(shortcut_tl) curselection]
4175 
4176  # Set the shortcut cell value
4177  $widgets(shortcut_tl) cellconfigure $selected,shortcut -text $value
4178  $widgets(shortcut_tl) cellconfigure $selected,clear -text 0
4179 
4180  # Save the table to the menu binding file
4182 
4183  # Close the editor
4185 
4186  }

§ shortcut_use_default()

pref_ui::shortcut_use_default

Definition at line 3803 of file pref_ui.tcl.

3803  proc shortcut_use_default {} {
3804 
3805  variable widgets
3806 
3807  set msg [msgcat::mc "Delete user bindings and use default?"]
3808  set detail [msgcat::mc "This operation cannot be reversed."]
3809 
3810  # Get confirmation from the user
3811  set ans [tk_messageBox -parent .prefwin -icon question -type yesno -default yes -message $msg -detail $detail]
3812 
3813  if {$ans eq "yes"} {
3814 
3815  # Clear the shortcut editor (in case its visible)
3817 
3818  # Revert the bindings and set them up using the new values
3820 
3821  # Clear the shortcut table
3822  $widgets(shortcut_tl) delete 0 end
3823 
3824  # Re-populate the shortcut table with the updated values
3825  populate_shortcut_table .menubar
3826 
3827  }
3828 
3829  }

§ show_matches()

pref_ui::show_matches   value  

Definition at line 1257 of file pref_ui.tcl.

1257  proc show_matches {value} {
1258 
1259  variable widgets
1260  variable search
1261  variable selected_language
1262 
1263  if {$selected_language eq [msgcat::mc "All"]} {
1264  set matches [array names search -regexp (?i).*$request.*::.]
1265  } else {
1266  set matches [array names search -regexp (?i).*$request.*::1]
1267  }
1268 
1269  foreach match $matches {
1270  lassign $search($match) win lbl plugin tab1 tab2
1271  set tabs1($tab1) [list $win $lbl]
1272  if {$tab2 ne ""} {
1273  set tabs2($tab2) [list $win $lbl]
1274  }
1275  }
1276 
1277  }

§ show_panel()

pref_ui::show_panel   panel ?tab?  

Definition at line 1133 of file pref_ui.tcl.

1133  proc show_panel {panel {tab ""}} {
1134 
1135  variable widgets
1136  variable current_panel
1137 
1138  # Remove the current panel
1139  if {$current_panel ne ""} {
1140  pack forget $widgets($current_panel)
1141  }
1142 
1143  # Display the given panel
1144  pack $widgets($panel) -fill both -expand yes
1145 
1146  # Save the current panel
1147  set current_panel $panel
1148 
1149  # If a tab is presented, find the tab and display it
1150  if {($tab ne "") && [winfo exists $widgets($panel).nb]} {
1151  foreach tab_id [$widgets($panel).nb tabs] {
1152  if {[string tolower [$widgets($panel).nb tab $tab_id -text]] eq [string tolower $tab]} {
1153  $widgets($panel).nb select $tab_id
1154  break
1155  }
1156  }
1157  }
1158 
1159  }

§ show_selected_panel()

pref_ui::show_selected_panel

Definition at line 1120 of file pref_ui.tcl.

1120  proc show_selected_panel {} {
1121 
1122  variable widgets
1123 
1124  set selected [$widgets(bar) selection]
1125  set panel [string tolower [$widgets(bar) item $selected -text]]
1126 
1127  show_panel $panel
1128 
1129  }

§ sidebar_set_current_width()

pref_ui::sidebar_set_current_width   sb  

Definition at line 3091 of file pref_ui.tcl.

3091  proc sidebar_set_current_width {sb} {
3092 
3093  # We will round the width to the nearest 10 pixel increment
3094  set width [expr round( [sidebar::get_width] / 10.0 ) * 10]
3095 
3096  # Set the spinbox value to the width of the
3097  $sb set $width
3098 
3099  # Update the variable
3100  handle_sb_change $sb Sidebar/DefaultWidth
3101 
3102  }

§ snippets_add()

pref_ui::snippets_add

Definition at line 3425 of file pref_ui.tcl.

3425  proc snippets_add {} {
3426 
3427  variable widgets
3428  variable snip_data
3429 
3430  # Indicate that the current type of snippet editing is an add
3431  set snip_data(edit_type) "add"
3432 
3433  # Set the selected syntax
3434  syntax::set_language $widgets(snippets_text) $snip_data(lang)
3435 
3436  # Display the editing frame
3437  pack forget $widgets(snippets_tf)
3438  pack $widgets(snippets_ef) -fill both -expand yes
3439 
3440  # Place the focus on the keyword entry field
3441  focus $widgets(snippets_keyword)
3442 
3443  }

§ snippets_cancel()

pref_ui::snippets_cancel

Definition at line 3663 of file pref_ui.tcl.

3663  proc snippets_cancel {} {
3664 
3665  variable widgets
3666 
3667  # Clear the fields
3668  $widgets(snippets_keyword) delete 0 end
3669  $widgets(snippets_text) delete 1.0 end
3670  $widgets(snippets_save) configure -state disabled
3671 
3672  # Display the table frame
3673  pack forget $widgets(snippets_ef)
3674  pack $widgets(snippets_tf) -fill both -expand yes
3675 
3676  }

§ snippets_create_menu()

pref_ui::snippets_create_menu   w  

Definition at line 3501 of file pref_ui.tcl.

3501  proc snippets_create_menu {w} {
3502 
3503  variable widgets
3504 
3505  # Create the menu
3506  set widgets(snippets_lang_menu) [menu $w.langPopup -tearoff 0]
3507 
3508  # Populate the menu
3509  syntax::populate_syntax_menu $widgets(snippets_lang_menu) pref_ui::snippets_set_language pref_ui::snip_data(lang) "All" [syntax::get_all_languages]
3510 
3511  return $widgets(snippets_lang_menu)
3512 
3513  }

§ snippets_del()

pref_ui::snippets_del

Definition at line 3478 of file pref_ui.tcl.

3478  proc snippets_del {} {
3479 
3480  variable widgets
3481 
3482  # Get the currently selected row
3483  set selected [$widgets(snippets_tl) curselection]
3484 
3485  # Get the snippet keyword
3486  set keyword [$widgets(snippets_tl) cellcget $selected,keyword -text]
3487 
3488  # Ask the user if they really want to delete the entry
3489  set ans [tk_messageBox -parent .prefwin -type okcancel -default cancel -icon question \
3490  -message [format "%s %s" [msgcat::mc "Delete snippet"] $keyword]]
3491 
3492  if {$ans eq "ok"} {
3493  $widgets(snippets_tl) delete $selected
3495  }
3496 
3497  }

§ snippets_edit()

pref_ui::snippets_edit

Definition at line 3447 of file pref_ui.tcl.

3447  proc snippets_edit {} {
3448 
3449  variable widgets
3450  variable snip_data
3451 
3452  # Get the currently selected row
3453  set selected [$widgets(snippets_tl) curselection]
3454 
3455  # Indicate that the current type of snippet editing is an edit
3456  set snip_data(edit_type) "edit"
3457  set snip_data(edit_row) $selected
3458 
3459  # Display the editing frame
3460  pack forget $widgets(snippets_tf)
3461  pack $widgets(snippets_ef) -fill both -expand yes
3462 
3463  # Insert the widget information in the entry and text fields
3464  $widgets(snippets_keyword) insert end [$widgets(snippets_tl) cellcget $selected,keyword -text]
3465  $widgets(snippets_text) insert end [$widgets(snippets_tl) cellcget $selected,snippet -text]
3466 
3467  # Disable the save button
3468  $widgets(snippets_save) configure -state disabled
3469 
3470  # Place the focus on the text widget
3471  focus $widgets(snippets_text).t
3472 
3473  }

§ snippets_format_snippet()

pref_ui::snippets_format_snippet   value  

Definition at line 3371 of file pref_ui.tcl.

3371  proc snippets_format_snippet {value} {
3372 
3373  set lines [split $value \n]
3374 
3375  if {[llength $lines] <= 4} {
3376  return [join $lines \n]
3377  } else {
3378  return [join [concat [lrange $lines 0 2] ...] \n]
3379  }
3380 
3381  }

§ snippets_insert()

pref_ui::snippets_insert

Definition at line 3599 of file pref_ui.tcl.

3599  proc snippets_insert {} {
3600 
3601  variable widgets
3602 
3603  set menu_width [winfo reqwidth $widgets(snippets_ins_menu)]
3604  set menu_height [winfo reqheight $widgets(snippets_ins_menu)]
3605  set w_width [winfo width $widgets(snippets_ins)]
3606  set w_x [winfo rootx $widgets(snippets_ins)]
3607  set w_y [winfo rooty $widgets(snippets_ins)]
3608 
3609  set x $w_x
3610  set y [expr $w_y - ($menu_height + 4)]
3611 
3612  tk_popup $widgets(snippets_ins_menu) $x $y
3613 
3614  }

§ snippets_insert_str()

pref_ui::snippets_insert_str   str  

Definition at line 3618 of file pref_ui.tcl.

3618  proc snippets_insert_str {str} {
3619 
3620  variable widgets
3621 
3622  # Insert the string
3623  $widgets(snippets_text) insert insert $str
3624 
3625  # Give the text widget focus.
3626  focus $widgets(snippets_text).t
3627 
3628  }

§ snippets_keyword_changed()

pref_ui::snippets_keyword_changed   value  

Definition at line 3566 of file pref_ui.tcl.

3566  proc snippets_keyword_changed {value} {
3567 
3568  variable widgets
3569 
3570  if {([$widgets(snippets_text) get 1.0 end-1c] ne "") && ($value ne "")} {
3571  $widgets(snippets_save) configure -state normal
3572  } else {
3573  $widgets(snippets_save) configure -state disabled
3574  }
3575 
3576  return 1
3577 
3578  }

§ snippets_load_table()

pref_ui::snippets_load_table   lang  

Definition at line 3538 of file pref_ui.tcl.

3538  proc snippets_load_table {lang} {
3539 
3540  variable widgets
3541  variable snip_data
3542 
3543  # Clear the table
3544  $widgets(snippets_tl) delete 0 end
3545 
3546  # Get the snippets list and add it to the table.
3547  foreach item [snippets::load_list $lang] {
3548  $widgets(snippets_tl) insert end $item
3549  }
3550 
3551  }

§ snippets_save()

pref_ui::snippets_save

Definition at line 3632 of file pref_ui.tcl.

3632  proc snippets_save {} {
3633 
3634  variable widgets
3635  variable snip_data
3636 
3637  # Get the frame contents
3638  set keyword [$widgets(snippets_keyword) get]
3639  set content [gui::scrub_text $widgets(snippets_text)]
3640 
3641  # Add/modify to the table
3642  switch $snip_data(edit_type) {
3643  "add" { $widgets(snippets_tl) insert end [list $keyword $content]}
3644  "edit" { $widgets(snippets_tl) rowconfigure $snip_data(edit_row) -text [list $keyword $content]}
3645  }
3646 
3647  # Save the table
3649 
3650  # Clear the fields
3651  $widgets(snippets_keyword) delete 0 end
3652  $widgets(snippets_text) delete 1.0 end
3653  $widgets(snippets_save) configure -state disabled
3654 
3655  # Display the table frame
3656  pack forget $widgets(snippets_ef)
3657  pack $widgets(snippets_tf) -fill both -expand yes
3658 
3659  }

§ snippets_save_table()

pref_ui::snippets_save_table

Definition at line 3555 of file pref_ui.tcl.

3555  proc snippets_save_table {} {
3556 
3557  variable widgets
3558  variable snip_data
3559 
3560  snippets::save_list [$widgets(snippets_tl) get 0 end] $snip_data(lang)
3561 
3562  }

§ snippets_search()

pref_ui::snippets_search   value  

Definition at line 3385 of file pref_ui.tcl.

3385  proc snippets_search {value} {
3386 
3387  variable widgets
3388 
3389  if {$value eq ""} {
3390  for {set i 0} {$i < [$widgets(snippets_tl) size]} {incr i} {
3391  $widgets(snippets_tl) rowconfigure $i -hide 0
3392  }
3393  } else {
3394  for {set i 0} {$i < [$widgets(snippets_tl) size]} {incr i} {
3395  if {[string match -nocase "*$value*" [$widgets(snippets_tl) cellcget $i,keyword -text]] || \
3396  [string match -nocase "*$value*" [$widgets(snippets_tl) cellcget $i,snippet -text]]} {
3397  $widgets(snippets_tl) rowconfigure $i -hide 0
3398  } else {
3399  $widgets(snippets_tl) rowconfigure $i -hide 1
3400  }
3401  }
3402  }
3403 
3404  return 1
3405 
3406  }

§ snippets_select()

pref_ui::snippets_select

Definition at line 3411 of file pref_ui.tcl.

3411  proc snippets_select {} {
3412 
3413  variable widgets
3414 
3415  if {[$widgets(snippets_tl) curselection] eq ""} {
3416  $widgets(snippets_del) configure -state disabled
3417  } else {
3418  $widgets(snippets_del) configure -state normal
3419  }
3420 
3421  }

§ snippets_set_language()

pref_ui::snippets_set_language   lang  

Definition at line 3517 of file pref_ui.tcl.

3517  proc snippets_set_language {lang} {
3518 
3519  variable widgets
3520  variable snip_data
3521 
3522  # Save the snippets data
3523  set snip_data(lang) $lang
3524 
3525  # Update the language menubutton text
3526  $widgets(snippets_lang) configure -text $lang
3527 
3528  # Set language of text widget
3529  syntax::set_language $widgets(snippets_text) $lang
3530 
3531  # Loads the snippet tabl
3532  snippets_load_table $lang
3533 
3534  }

§ snippets_text_changed()

pref_ui::snippets_text_changed

Definition at line 3582 of file pref_ui.tcl.

3582  proc snippets_text_changed {} {
3583 
3584  variable widgets
3585 
3586  if {([$widgets(snippets_text) get 1.0 end-1c] ne "") &&
3587  ([$widgets(snippets_keyword) get] ne "")} {
3588  $widgets(snippets_save) configure -state normal
3589  } else {
3590  $widgets(snippets_save) configure -state disabled
3591  }
3592 
3593  return 1
3594 
3595  }

§ table_add()

pref_ui::table_add   w cols varname  

Definition at line 678 of file pref_ui.tcl.

678  proc table_add {w cols varname} {
679 
680  set index 0
681  set ccols [list]
682 
683  # Get the list of values to insert
684  foreach col $cols {
685  array set opts $col
686  lappend values $opts(-value)
687  if {$opts(-type) eq "checkbutton"} {
688  lappend ccols $index
689  }
690  incr index
691  }
692 
693  # Add the entry to the table at the end
694  set row [$w insert end $values]
695 
696  # Make all of the checkboxes look right
697  foreach ccol $ccols {
698  $w cellconfigure $row,$ccol -image [expr {[$w cellcget $row,$ccol -text] ? "pref_checked" : "pref_unchecked"}]
699  }
700 
701  # Make the first cell editable and in view
702  $w see $row
703  $w editcell $row,0
704 
705  # Save the contents to a file in case nothing is edited
706  set pref_ui::prefs($varname) [$w get 0 end]
707 
708  }

§ table_delete()

pref_ui::table_delete   w varname  

Definition at line 712 of file pref_ui.tcl.

712  proc table_delete {w varname} {
713 
714  # Delete the currently selected row
715  $w delete [$w curselection]
716 
717  # Disable the delete button
718  [winfo parent $w].bf.del configure -state disabled
719 
720  # Save the preferences
721  set pref_ui::prefs($varname) [$w get 0 end]
722 
723  }

§ table_edit_end_command()

pref_ui::table_edit_end_command   varname cols w row col value  

Definition at line 775 of file pref_ui.tcl.

775  proc table_edit_end_command {varname cols w row col value} {
776 
777  # Get the table contents
778  set contents [$w get 0 end]
779  lset contents $row $col $value
780 
781  # Save the changes to the preferences
782  set pref_ui::prefs($varname) $contents
783 
784  return $value
785 
786  }

§ table_edit_start_command()

pref_ui::table_edit_start_command   varname cols w row col value  

Definition at line 756 of file pref_ui.tcl.

756  proc table_edit_start_command {varname cols w row col value} {
757 
758  array set opts [lindex $cols $col]
759 
760  switch $opts(-type) {
761  menubutton {
762  set mnu [[$w editwinpath] cget -menu]
763  foreach value $opts(-values) {
764  $mnu add radiobutton -label $value
765  }
766  }
767  }
768 
769  return $value
770 
771  }

§ table_left_clicked()

pref_ui::table_left_clicked   w cols x y varname  

Definition at line 735 of file pref_ui.tcl.

735  proc table_left_clicked {w cols x y varname} {
736 
737  lassign [tablelist::convEventFields $w $x $y] tbl x y
738  lassign [split [$tbl containingcell $x $y] ,] row col
739 
740  if {$row >= 0} {
741  array set opts [lindex $cols $col]
742  if {$opts(-type) eq "checkbutton"} {
743  if {[$tbl cellcget $row,$col -text]} {
744  $tbl cellconfigure $row,$col -text 0 -image pref_unchecked
745  } else {
746  $tbl cellconfigure $row,$col -text 1 -image pref_checked
747  }
748  set pref_ui::prefs($varname) [$tbl get 0 end]
749  }
750  }
751 
752  }

§ table_selected()

pref_ui::table_selected   w  

Definition at line 727 of file pref_ui.tcl.

727  proc table_selected {w} {
728 
729  [winfo parent $w].bf.del configure -state normal
730 
731  }

§ text_modified()

pref_ui::text_modified   w  

Definition at line 351 of file pref_ui.tcl.

351  proc text_modified {w} {
352 
353  if {[$w.t edit modified]} {
354  $w.bf.save configure -state normal
355  }
356 
357  }

§ text_save()

pref_ui::text_save   w varname  

Definition at line 361 of file pref_ui.tcl.

361  proc text_save {w varname} {
362 
363  # Clear the modified state
364  $w edit modified 0
365 
366  # Disable the save button
367  [winfo parent $w].bf.save configure -state disabled
368 
369  # Set the preferences
370  set pref_ui::prefs($varname) [$w get 1.0 end-1c]
371 
372  }

§ themes_add()

pref_ui::themes_add

Definition at line 2264 of file pref_ui.tcl.

2264  proc themes_add {} {
2265 
2266  # Allow the user to select a theme to import
2267  if {[themer::import .prefwin]} {
2268 
2269  # Update the themes table
2271 
2272  }
2273 
2274  }

§ themes_delete()

pref_ui::themes_delete

Definition at line 2278 of file pref_ui.tcl.

2278  proc themes_delete {} {
2279 
2280  variable widgets
2281  variable prefs
2282 
2283  # Get the currently selected theme
2284  set selected [$widgets(themes_tl) curselection]
2285  set name [$widgets(themes_tl) cellcget $selected,name -text]
2286 
2287  # Confirm with the user
2288  if {[tk_messageBox -parent .prefwin -type yesno -default no -message [format "%s %s %s?" [msgcat::mc "Delete"] $name [msgcat::mc "theme"]]] eq "no"} {
2289  return
2290  }
2291 
2292  # Delete the theme
2293  themes::delete_theme $name
2294 
2295  # Remove the theme from the hidden list so that we don't confuse the user if they reload the
2296  # theme.
2297  if {[set index [lsearch -exact $prefs(Appearance/HiddenThemes) $name]] != -1} {
2298  set prefs(Appearance/HiddentThemes) [lreplace $prefs(Appearance/HiddenThemes) $index $index]
2299  }
2300 
2301  # Update the themes table
2303 
2304  }

§ themes_edit()

pref_ui::themes_edit

Definition at line 2308 of file pref_ui.tcl.

2308  proc themes_edit {} {
2309 
2310  variable widgets
2311 
2312  # Get the selected theme
2313  set selected [$widgets(themes_tl) curselection]
2314 
2315  # Make sure that the theme editor is opened
2316  themer::preview_theme [$widgets(themes_tl) cellcget $selected,name -text]
2317 
2318  }

§ themes_format_date()

pref_ui::themes_format_date   value  

Definition at line 2164 of file pref_ui.tcl.

2164  proc themes_format_date {value} {
2165 
2166  if {$value ne ""} {
2167  return [clock format $value -format "%D"]
2168  }
2169 
2170  return ""
2171 
2172  }

§ themes_format_imported()

pref_ui::themes_format_imported   value  

Definition at line 2156 of file pref_ui.tcl.

2156  proc themes_format_imported {value} {
2157 
2158  return ""
2159 
2160  }

§ themes_format_visible()

pref_ui::themes_format_visible   value  

Definition at line 2148 of file pref_ui.tcl.

2148  proc themes_format_visible {value} {
2149 
2150  return ""
2151 
2152  }

§ themes_get_more()

pref_ui::themes_get_more

Definition at line 2322 of file pref_ui.tcl.

2322  proc themes_get_more {} {
2323 
2324  utils::open_file_externally "http://tke.sourceforge.net/themes.html"
2325 
2326  }

§ themes_left_click()

pref_ui::themes_left_click   W x y  

Definition at line 2237 of file pref_ui.tcl.

2237  proc themes_left_click {W x y} {
2238 
2239  variable prefs
2240 
2241  lassign [tablelist::convEventFields $W $x $y] tbl x y
2242  lassign [split [$tbl containingcell $x $y] ,] row col
2243 
2244  if {$row != -1} {
2245  if {[$tbl columncget $col -name] eq "visible"} {
2246  set name [$tbl cellcget $row,name -text]
2247  set value [$tbl cellcget $row,visible -text]
2248  if {$value} {
2249  $tbl cellconfigure $row,visible -text 0 -image pref_unchecked
2250  lappend prefs(Appearance/HiddenThemes) $name
2251  } else {
2252  $tbl cellconfigure $row,visible -text 1 -image pref_checked
2253  if {[set index [lsearch -exact $prefs(Appearance/HiddenThemes) $name]] != -1} {
2254  set prefs(Appearance/HiddenThemes) [lreplace $prefs(Appearance/HiddenThemes) $index $index]
2255  }
2256  }
2257  }
2258  }
2259 
2260  }

§ themes_populate_table()

pref_ui::themes_populate_table

Definition at line 2176 of file pref_ui.tcl.

2176  proc themes_populate_table {} {
2177 
2178  variable widgets
2179 
2180  # If the preference window is not currently being shown, return immediately
2181  if {![info exists widgets(themes_tl)] || ![winfo exists $widgets(themes_tl)]} {
2182  return
2183  }
2184 
2185  # Clear the table
2186  $widgets(themes_tl) delete 0 end
2187 
2188  # Add the current themes to the table
2189  foreach name [themes::get_all_themes] {
2190  set visible [expr [lsearch [themes::get_visible_themes] $name] != -1]
2191  set imported [themes::get_imported $name]
2192  array set attrs [themes::get_attributions $name]
2193  set row [$widgets(themes_tl) insert end [list $name $visible $imported $attrs(creator) $attrs(date)]]
2194  if {$visible} {
2195  $widgets(themes_tl) cellconfigure $row,visible -image pref_checked
2196  } else {
2197  $widgets(themes_tl) cellconfigure $row,visible -image pref_unchecked
2198  }
2199  if {$imported} {
2200  $widgets(themes_tl) cellconfigure $row,imported -image pref_check
2201  }
2202  }
2203 
2204  # Make sure that the state of the disable button is disabled since nothing will be selected
2205  $widgets(themes_del) configure -state disabled
2206 
2207  }

§ themes_selected()

pref_ui::themes_selected

Definition at line 2211 of file pref_ui.tcl.

2211  proc themes_selected {} {
2212 
2213  variable widgets
2214 
2215  # Update the state of the deletion button
2216  if {([set selected [$widgets(themes_tl) curselection]] eq "") || \
2217  ([$widgets(themes_tl) cellcget $selected,imported -text] == 0) || \
2218  ([$widgets(themes_tl) cellcget $selected,name -text] eq [theme::get_current_theme])} {
2219  $widgets(themes_del) configure -state disabled
2220  } else {
2221  $widgets(themes_del) configure -state normal
2222  }
2223 
2224  # Update the state of the edit button
2225  if {$selected eq ""} {
2226  $widgets(themes_edit) configure -state disabled
2227  } else {
2228  $widgets(themes_edit) configure -state normal
2229  }
2230 
2231  }

§ update_theme()

pref_ui::update_theme   txt  

Definition at line 4768 of file pref_ui.tcl.

4768  proc update_theme {txt} {
4769 
4770  gui::update_theme $txt
4771 
4772  }

§ var_edit_end_command()

pref_ui::var_edit_end_command   tbl row col value  

Definition at line 1789 of file pref_ui.tcl.

1789  proc var_edit_end_command {tbl row col value} {
1790 
1791  after 1 [list pref_ui::gather_var_table]
1792 
1793  return $value
1794 
1795  }