TKE  3.6
Advanced code editor for programmers
menus Namespace Reference

Functions

 get_menu menu_path
 
 get_menu_index mnu tail
 
 set_pane_sync_indicator value
 
 invoke mnu index
 
 set_state state
 
 text_only cmd args
 
 main_only cmd args
 
 handle_development_mode ?name1? ?name2? ?op?
 
 create
 
 make_menu w args
 
 handle_menu_shift_click w y
 
 make_menu_cmd mnu lbl
 
 add_file mb
 
 file_posting mb
 
 file_recent_posting mb
 
 clear_last_opened
 
 file_favorites_posting mb
 
 file_export_posting mb
 
 file_eol_posting mb
 
 new_window_command
 
 new_file_command
 
 new_file_from_template
 
 open_command
 
 open_dir_command
 
 open_remote_command
 
 change_working_directory
 
 show_file_diff
 
 save_command
 
 save_as_command
 
 save_as_remote_command
 
 save_selection_as_command
 
 export_command
 
 rename_command
 
 duplicate_command
 
 delete_command
 
 move_to_trash_command
 
 lock_command mb
 
 unlock_command mb
 
 favorite_command mb
 
 unfavorite_command mb
 
 close_command
 
 close_all_command
 
 exit_cleanup
 
 exit_command
 
 add_edit mb
 
 edit_posting mb
 
 edit_select_posting mb
 
 edit_indent_posting mb
 
 edit_cursor_posting mb
 
 edit_insert_posting mb
 
 edit_transform_posting mb
 
 edit_format_posting mb
 
 edit_preferences_posting mb
 
 edit_snippets_posting mb
 
 edit_templates_posting mb
 
 edit_emmet_posting mb
 
 select_mode
 
 indent_command
 
 unindent_command
 
 edit_cursor_move modifier args
 
 edit_cursor_move_by_page dir
 
 edit_cursors_move modifier
 
 edit_insert_line_above
 
 edit_insert_line_below
 
 edit_insert_file_after_current_line
 
 edit_insert_command_after_current_line
 
 edit_transform_toggle_case
 
 edit_transform_to_lower_case
 
 edit_transform_to_upper_case
 
 edit_transform_to_title_case
 
 edit_transform_join_lines
 
 edit_transform_bubble_up
 
 edit_transform_bubble_down
 
 edit_format type
 
 edit_format_remove
 
 edit_user_global
 
 edit_user_language
 
 delete_user_language
 
 edit_session_global
 
 edit_session_language
 
 delete_session_language
 
 add_new_snippet language
 
 add_find mb
 
 find_posting mb
 
 find_marker_posting mb
 
 find_next_command
 
 find_prev_command
 
 find_select_current_command
 
 find_select_all_command
 
 jump_to_line
 
 add_view mb
 
 view_posting mb
 
 view_tabs_posting mb
 
 view_fold_posting mb
 
 show_sidebar_view mb
 
 hide_sidebar_view mb
 
 show_console_view mb
 
 hide_console_view mb
 
 show_tab_view mb
 
 hide_tab_view mb
 
 show_status_view mb
 
 hide_status_view mb
 
 show_line_numbers mb
 
 hide_line_numbers mb
 
 set_line_numbering type
 
 set_line_wrapping
 
 show_marker_map mb
 
 hide_marker_map mb
 
 show_meta_chars mb
 
 hide_meta_chars mb
 
 display_text_info
 
 sync_panes
 
 set_code_folding ?value?
 
 add_fold_from_selection
 
 delete_folds type
 
 close_folds type ?depth?
 
 open_folds type ?depth?
 
 jump_to_fold dir
 
 add_tools mb
 
 tools_posting mb
 
 theme_edit_command
 
 start_profiling_command mb
 
 stop_profiling_command mb show_report
 
 show_last_profiling_report
 
 generate_profile_report
 
 run_bist
 
 restart_command
 
 add_sessions mb
 
 sessions_posting mb
 
 sessions_switch_launcher
 
 sessions_close_current
 
 sessions_save_current
 
 sessions_save_as
 
 sessions_delete_launcher
 
 add_plugins mb
 
 plugins_posting mb
 
 add_help mb
 
 help_posting mb
 
 help_lang_ref_posting mb
 
 help_user_guide
 
 help_devel_guide
 
 help_tips_tricks
 
 check_for_update
 
 help_feedback_command
 
 help_submit_report
 
 launcher
 

Function Documentation

§ add_edit()

menus::add_edit   mb  

Definition at line 1109 of file menus.tcl.

1109  proc add_edit {mb} {
1110 
1111  # Add edit menu commands
1112  $mb add command -label [msgcat::mc "Undo"] -underline 0 -command [list menus::text_only gui::undo]
1113  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Undo"]] [list menus::text_only gui::undo]
1114 
1115  $mb add command -label [msgcat::mc "Redo"] -underline 0 -command [list menus::text_only gui::redo]
1116  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Redo"]] [list menus::text_only gui::redo]
1117 
1118  $mb add separator
1119 
1120  $mb add command -label [msgcat::mc "Cut"] -underline 0 -command [list menus::text_only gui::cut]
1121  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Cut text"]] [list menus::text_only gui::cut]
1122 
1123  $mb add command -label [msgcat::mc "Copy"] -underline 1 -command [list menus::text_only gui::copy]
1124  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Copy text"]] [list menus::text_only gui::copy]
1125 
1126  $mb add command -label [msgcat::mc "Paste"] -underline 0 -command [list menus::text_only gui::paste]
1127  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Paste text from clipboard"]] [list menus::text_only gui::paste]
1128 
1129  $mb add command -label [msgcat::mc "Paste and Format"] -underline 10 -command [list menus::text_only gui::paste_and_format]
1130  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Paste and format text from clipboard"]] [list menus::text_only gui::paste_and_format]
1131 
1132  $mb add separator
1133 
1134  $mb add cascade -label [msgcat::mc "Select"] -underline 0 -menu [make_menu $mb.selectPopup -tearoff 0 -postcommand [list menus::edit_select_posting $mb.selectPopup]]
1135 
1136  $mb add command -label [msgcat::mc "Select Mode"] -underline 7 -command [list menus::text_only menus::select_mode]
1137  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Enter selection mode"]] [list menus::text_only menus::select_mode]
1138 
1139  $mb add separator
1140 
1141  $mb add checkbutton -label [msgcat::mc "Vim Mode"] -underline 0 -variable preferences::prefs(Editor/VimMode) -command [list menus::main_only vim::set_vim_mode_all]
1142  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Enable Vim mode"]] [list menus::main_only vim::set_vim_mode_all 1]
1143  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Disable Vim mode"]] [list menus::main_only vim::set_vim_mode_all 0]
1144 
1145  $mb add separator
1146 
1147  $mb add command -label [msgcat::mc "Toggle Comment"] -underline 0 -command [list menus::text_only edit::comment_toggle]
1148  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Toggle comment"]] [list menus::text_only edit::comment_toggle]
1149 
1150  $mb add cascade -label [msgcat::mc "Indentation"] -underline 0 -menu [make_menu $mb.indentPopup -tearoff 0 -postcommand [list menus::edit_indent_posting $mb.indentPopup]]
1151  $mb add cascade -label [msgcat::mc "Cursor"] -underline 1 -menu [make_menu $mb.cursorPopup -tearoff 0 -postcommand [list menus::edit_cursor_posting $mb.cursorPopup]]
1152 
1153  $mb add separator
1154 
1155  $mb add cascade -label [msgcat::mc "Insert"] -menu [make_menu $mb.insertPopup -tearoff 0 -postcommand [list menus::edit_insert_posting $mb.insertPopup]]
1156  $mb add cascade -label [msgcat::mc "Transform"] -menu [make_menu $mb.transformPopup -tearoff 0 -postcommand [list menus::edit_transform_posting $mb.transformPopup]]
1157  $mb add cascade -label [msgcat::mc "Format"] -menu [make_menu $mb.formatPopup -tearoff 0 -postcommand [list menus::edit_format_posting $mb.formatPopup]]
1158 
1159  $mb add separator
1160 
1161  $mb add cascade -label [msgcat::mc "Snippets"] -menu [make_menu $mb.snipPopup -tearoff 0 -postcommand [list menus::edit_snippets_posting $mb.snipPopup]]
1162  $mb add cascade -label [msgcat::mc "Templates"] -menu [make_menu $mb.tempPopup -tearoff 0 -postcommand [list menus::edit_templates_posting $mb.tempPopup]]
1163  $mb add cascade -label "Emmet" -menu [make_menu $mb.emmetPopup -tearoff 0 -postcommand [list menus::edit_emmet_posting $mb.emmetPopup]]
1164 
1165  $mb add separator
1166 
1167  $mb add cascade -label [msgcat::mc "Preferences"] -menu [make_menu $mb.prefPopup -tearoff 0 -postcommand [list menus::edit_preferences_posting $mb.prefPopup]]
1168 
1169  #########################
1170  # Populate selection menu
1171  #########################
1172 
1173  $mb.selectPopup add command -label [msgcat::mc "All"] -underline 0 -command [list menus::text_only select::quick_select all]
1174  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select all text"]] [list menus::text_only select::quick_select all]
1175 
1176  $mb.selectPopup add command -label [msgcat::mc "Current Line"] -underline 8 -command [list menus::text_only select::quick_select line]
1177  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select current line"]] [list menus::text_only select::quick_select line]
1178 
1179  $mb.selectPopup add command -label [msgcat::mc "Current Word"] -underline 8 -command [list menus::text_only select::quick_select word]
1180  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select current word"]] [list menus::text_only select::quick_select word]
1181 
1182  $mb.selectPopup add command -label [msgcat::mc "Current Sentence"] -underline 8 -command [list menus::text_only select::quick_select sentence]
1183  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select current sentence"]] [list menus::text_only select::quick_select sentence]
1184 
1185  $mb.selectPopup add command -label [msgcat::mc "Current Paragraph"] -underline 8 -command [list menus::text_only select::quick_select paragraph]
1186  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select current paragraph"]] [list menus::text_only select::quick_select paragraph]
1187 
1188  $mb.selectPopup add command -label [msgcat::mc "Current Bounded Text"] -underline 8 -command [list menus::text_only select::quick_select bracket]
1189  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select current bracketed text, strings or comment block"]] [list menus::text_only select::quick_select bracket]
1190 
1191  $mb.selectPopup add separator
1192 
1193  $mb.selectPopup add command -label [msgcat::mc "Add Next Line"] -underline 4 -command [list menus::text_only select::quick_add_line next]
1194  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Add next line to selection"]] [list menus::text_only select::quick_add_line next]
1195 
1196  $mb.selectPopup add command -label [msgcat::mc "Add Previous Line"] -underline 5 -command [list menus::text_only select::quick_add_line prev]
1197  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Add previous line to selection"]] [list menus::text_only select::quick_add_line prev]
1198 
1199  ###########################
1200  # Populate indentation menu
1201  ###########################
1202 
1203  $mb.indentPopup add command -label [msgcat::mc "Indent"] -underline 0 -command [list menus::text_only menus::indent_command]
1204  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Indent selected text"]] [list menus::text_only menus::indent_command]
1205 
1206  $mb.indentPopup add command -label [msgcat::mc "Unindent"] -underline 1 -command [list menus::text_only menus::unindent_command]
1207  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Unindent selected text"]] [list menus::text_only menus::unindent_command]
1208 
1209  $mb.indentPopup add separator
1210 
1211  $mb.indentPopup add command -label [msgcat::mc "Format Text"] -command [list menus::text_only gui::format_text]
1212  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Format indentation for text"]] [list menus::text_only gui::format_text]
1213 
1214  $mb.indentPopup add separator
1215 
1216  $mb.indentPopup add radiobutton -label [msgcat::mc "Indent Off"] -variable menus::indent_mode -value "OFF" -command [list menus::text_only indent::set_current_indent_mode OFF]
1217  launcher::register [make_menu_cmd "Edit" [format "%s %s" [msgcat::mc "Set indent mode to"] "OFF"]] [list menus::text_only indent::set_current_indent_mode OFF]
1218 
1219  $mb.indentPopup add radiobutton -label [msgcat::mc "Auto-Indent"] -variable menus::indent_mode -value "IND" -command [list menus::text_only indent::set_current_indent_mode IND]
1220  launcher::register [make_menu_cmd "Edit" [format "%s %s" [msgcat::mc "Set indent mode to"] "IND"]] [list menus::text_only indent::set_current_indent_mode IND]
1221 
1222  $mb.indentPopup add radiobutton -label [msgcat::mc "Smart Indent"] -variable menus::indent_mode -value "IND+" -command [list menus::text_only indent::set_current_indent_mode IND+]
1223  launcher::register [make_menu_cmd "Edit" [format "%s %s" [msgcat::mc "Set indent mode to"] "IND+"]] [list menus::text_only indent::set_current_indent_mode IND+]
1224 
1225  ######################
1226  # Populate cursor menu
1227  ######################
1228 
1229  $mb.cursorPopup add command -label [msgcat::mc "Move to First Line"] -command [list menus::text_only menus::edit_cursor_move first]
1230  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to first line"]] [list menus::text_only menus::edit_cursor_move first]
1231 
1232  $mb.cursorPopup add command -label [msgcat::mc "Move to Last Line"] -command [list menus::text_only menus::edit_cursor_move last]
1233  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to last line"]] [list menus::text_only menus::edit_cursor_move last]
1234 
1235  $mb.cursorPopup add command -label [msgcat::mc "Move to Next Page"] -command [list menus::text_only menus::edit_cursor_move_by_page next]
1236  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to next page"]] [list menus::text_only menus::edit_cursor_move_by_page next]
1237 
1238  $mb.cursorPopup add command -label [msgcat::mc "Move to Previous Page"] -command [list menus::text_only menus::edit_cursor_move_by_page prior]
1239  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to previous page"]] [list menus::text_only menus::edit_cursor_move_by_page prior]
1240 
1241  $mb.cursorPopup add separator
1242 
1243  $mb.cursorPopup add command -label [msgcat::mc "Move to Screen Top"] -command [list menus::text_only menus::edit_cursor_move screentop]
1244  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to top of screen"]] [list menus::text_only menus::edit_cursor_move screentop]
1245 
1246  $mb.cursorPopup add command -label [msgcat::mc "Move to Screen Middle"] -command [list menus::text_only menus::edit_cursor_move screenmid]
1247  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to middle of screen"]] [list menus::text_only menus::edit_cursor_move screenmid]
1248 
1249  $mb.cursorPopup add command -label [msgcat::mc "Move to Screen Bottom"] -command [list menus::text_only menus::edit_cursor_move screenbot]
1250  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to bottom of screen"]] [list menus::text_only menus::edit_cursor_move screenbot]
1251 
1252  $mb.cursorPopup add separator
1253 
1254  $mb.cursorPopup add command -label [msgcat::mc "Move to Line Start"] -command [list menus::text_only menus::edit_cursor_move linestart]
1255  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to start of current line"]] [list menus::text_only menus::edit_cursor_move linestart]
1256 
1257  $mb.cursorPopup add command -label [msgcat::mc "Move to Line End"] -command [list menus::text_only menus::edit_cursor_move lineend]
1258  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to end of current line"]] [list menus::text_only menus::edit_cursor_move lineend]
1259 
1260  $mb.cursorPopup add command -label [msgcat::mc "Move to Next Word"] -command [list menus::text_only menus::edit_cursor_move wordstart -dir next]
1261  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to next word"]] [list menus::text_only menus::edit_cursor_move wordstart -dir next]
1262 
1263  $mb.cursorPopup add command -label [msgcat::mc "Move to Previous Word"] -command [list menus::text_only menus::edit_cursor_move wordstart -dir prev]
1264  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move cursor to previous word"]] [list menus::text_only menus::edit_cursor_move wordstart -dir prev]
1265 
1266  $mb.cursorPopup add separator
1267 
1268  $mb.cursorPopup add command -label [msgcat::mc "Move Cursors Up"] -command [list menus::text_only menus::edit_cursors_move up]
1269  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move multicursors up one line"]] [list menus::text_only menus::edit_cursors_move up]
1270 
1271  $mb.cursorPopup add command -label [msgcat::mc "Move Cursors Down"] -command [list menus::text_only menus::edit_cursors_move down]
1272  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move multicursors down one line"]] [list menus::text_only menus::edit_cursors_move down]
1273 
1274  $mb.cursorPopup add command -label [msgcat::mc "Move Cursors Left"] -command [list menus::text_only menus::edit_cursors_move left]
1275  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move multicursors left one line"]] [list menus::text_only menus::edit_cursors_move left]
1276 
1277  $mb.cursorPopup add command -label [msgcat::mc "Move Cursors Right"] -command [list menus::text_only menus::edit_cursors_move right]
1278  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Move multicursors right one line"]] [list menus::text_only menus::edit_cursors_move right]
1279 
1280  $mb.cursorPopup add separator
1281 
1282  $mb.cursorPopup add command -label [msgcat::mc "Align Cursors Only"] -command [list menus::text_only edit::align_cursors]
1283  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Align cursors only"]] [list menus::text_only edit::align_cursors]
1284 
1285  $mb.cursorPopup add command -label [msgcat::mc "Align Cursors and Text"] -command [list menus::text_only edit::align_cursors_and_text]
1286  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Align cursors and text"]] [list menus::text_only edit::align_cursors_and_text]
1287 
1288  #########################
1289  # Populate insertion menu
1290  #########################
1291 
1292  $mb.insertPopup add command -label [msgcat::mc "Line Above Current"] -command [list menus::text_only menus::edit_insert_line_above]
1293  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert line above current line"]] [list menus::text_only menus::edit_insert_line_above]
1294 
1295  $mb.insertPopup add command -label [msgcat::mc "Line Below Current"] -command [list menus::text_only menus::edit_insert_line_below]
1296  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert line below current line"]] [list menus::text_only menus::edit_insert_line_below]
1297 
1298  $mb.insertPopup add separator
1299 
1300  $mb.insertPopup add command -label [msgcat::mc "File Contents"] -command [list menus::text_only menus::edit_insert_file_after_current_line]
1301  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert file contents after current line"]] [list menus::text_only menus::edit_insert_file_after_current_line]
1302 
1303  $mb.insertPopup add command -label [msgcat::mc "Command Result"] -command [list menus::text_only menus::edit_insert_command_after_current_line]
1304  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert command result after current line"]] [list menus::text_only menus::edit_insert_command_after_current_line]
1305 
1306  $mb.insertPopup add separator
1307 
1308  $mb.insertPopup add command -label [msgcat::mc "From Clipboard"] -command [list menus::text_only cliphist::show_cliphist]
1309  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert from clipboard"]] [list menus::text_only cliphist::show_cliphist]
1310 
1311  $mb.insertPopup add command -label [msgcat::mc "Snippet"] -command [list menus::text_only snippets::show_snippets]
1312  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert snippet"]] [list menus::text_only snippets::show_snippets]
1313 
1314  $mb.insertPopup add separator
1315 
1316  $mb.insertPopup add command -label [msgcat::mc "Enumeration"] -underline 7 -command [list menus::text_only edit::insert_enumeration]
1317  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert enumeration"]] [list menus::text_only edit::insert_enumeration]
1318 
1319  #########################
1320  # Populate transform menu
1321  #########################
1322 
1323  $mb.transformPopup add command -label [msgcat::mc "Toggle Case"] -command [list menus::text_only menus::edit_transform_toggle_case]
1324  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Toggle case of current character"]] [list menus::text_only menus::edit_transform_toggle_case]
1325 
1326  $mb.transformPopup add command -label [msgcat::mc "Lower Case"] -command [list menus::text_only menus::edit_transform_to_lower_case]
1327  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Convert case to lower"]] [list menus::text_only menus::edit_transform_to_lower_case]
1328 
1329  $mb.transformPopup add command -label [msgcat::mc "Upper Case"] -command [list menus::text_only menus::edit_transform_to_upper_case]
1330  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Convert case to upper"]] [list menus::text_only menus::edit_transform_to_upper_case]
1331 
1332  $mb.transformPopup add command -label [msgcat::mc "Title Case"] -command [list menus::text_only menus::edit_transform_to_title_case]
1333  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Convert case to title"]] [list menus::text_only menus::edit_transform_to_title_case]
1334 
1335  $mb.transformPopup add separator
1336 
1337  $mb.transformPopup add command -label [msgcat::mc "Join Lines"] -command [list menus::text_only menus::edit_transform_join_lines]
1338  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Join lines"]] [list menus::text_only menus::edit_transform_join_lines]
1339 
1340  $mb.transformPopup add separator
1341 
1342  $mb.transformPopup add command -label [msgcat::mc "Bubble Up"] -command [list menus::text_only menus::edit_transform_bubble_up]
1343  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Bubble lines up one line"]] [list menus::text_only menus::edit_transform_bubble_up]
1344 
1345  $mb.transformPopup add command -label [msgcat::mc "Bubble Down"] -command [list menus::text_only menus::edit_transform_bubble_down]
1346  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Bubble lines down one line"]] [list menus::text_only menus::edit_transform_bubble_down]
1347 
1348  $mb.transformPopup add separator
1349 
1350  $mb.transformPopup add command -label [msgcat::mc "Replace Line With Script"] -command [list menus::text_only edit::replace_line_with_script]
1351  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Replace line with script"]] [list menus::text_only edit::replace_line_with_script]
1352 
1353  ##########################
1354  # Populate formatting menu
1355  ##########################
1356 
1357  set fmtstr [msgcat::mc "formatting"]
1358 
1359  $mb.formatPopup add command -label [msgcat::mc "Bold"] -command [list menus::text_only menus::edit_format bold]
1360  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert bold formatting"]] [list menus::text_only menus::edit_format bold]
1361 
1362  $mb.formatPopup add command -label [msgcat::mc "Italics"] -command [list menus::text_only menus::edit_format italics]
1363  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert italics formatting"]] [list menus::text_only menus::edit_format italics]
1364 
1365  $mb.formatPopup add command -label [msgcat::mc "Underline"] -command [list menus::text_only menus::edit_format underline]
1366  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert underline formatting"]] [list menus::text_only menus::edit_format underline]
1367 
1368  $mb.formatPopup add command -label [msgcat::mc "Strikethrough"] -command [list menus::text_only menus::edit_format strikethrough]
1369  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert strikethrough formatting"]] [list menus::text_only menus::edit_format strikethrough]
1370 
1371  $mb.formatPopup add command -label [msgcat::mc "Highlight"] -command [list menus::text_only menus::edit_format highlight]
1372  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert highlight formatting"]] [list menus::text_only menus::edit_format highlight]
1373 
1374  $mb.formatPopup add command -label [msgcat::mc "Superscript"] -command [list menus::text_only menus::edit_format superscript]
1375  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert superscript formatting"]] [list menus::text_only menus::edit_format superscript]
1376 
1377  $mb.formatPopup add command -label [msgcat::mc "Subscript"] -command [list menus::text_only menus::edit_format subscript]
1378  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert subscript formatting"]] [list menus::text_only menus::edit_format subscript]
1379 
1380  $mb.formatPopup add command -label [msgcat::mc "Code"] -command [list menus::text_only menus::edit_format code]
1381  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert code formatting"]] [list menus::text_only menus::edit_format code]
1382 
1383  $mb.formatPopup add separator
1384 
1385  $mb.formatPopup add command -label [format "%s 1" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header1]
1386  launcher::register [make_menu_cmd "Edit" [format "%s 1 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header1]
1387 
1388  $mb.formatPopup add command -label [format "%s 2" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header2]
1389  launcher::register [make_menu_cmd "Edit" [format "%s 2 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header2]
1390 
1391  $mb.formatPopup add command -label [format "%s 3" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header3]
1392  launcher::register [make_menu_cmd "Edit" [format "%s 3 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header3]
1393 
1394  $mb.formatPopup add command -label [format "%s 4" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header4]
1395  launcher::register [make_menu_cmd "Edit" [format "%s 4 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header4]
1396 
1397  $mb.formatPopup add command -label [format "%s 5" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header5]
1398  launcher::register [make_menu_cmd "Edit" [format "%s 5 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header5]
1399 
1400  $mb.formatPopup add command -label [format "%s 6" [msgcat::mc "Header"]] -command [list menus::text_only menus::edit_format header6]
1401  launcher::register [make_menu_cmd "Edit" [format "%s 6 %s" [msgcat::mc "Insert header style"] $fmtstr]] [list menus::text_only menus::edit_format header6]
1402 
1403  $mb.formatPopup add separator
1404 
1405  $mb.formatPopup add command -label [msgcat::mc "Unordered Bullet"] -command [list menus::text_only menus::edit_format unordered]
1406  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert unordered list formatting"]] [list menus::text_only menus::edit_format unordered]
1407 
1408  $mb.formatPopup add command -label [msgcat::mc "Ordered Bullet"] -command [list menus::text_only menus::edit_format ordered]
1409  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert ordered list formatting"]] [list menus::text_only menus::edit_format ordered]
1410 
1411  $mb.formatPopup add command -label [msgcat::mc "Checkbox"] -command [list menus::text_only menus::edit_format checkbox]
1412  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert checklist formatting"]] [list menus::text_only menus::edit_format checkbox]
1413 
1414  $mb.formatPopup add separator
1415 
1416  $mb.formatPopup add command -label [msgcat::mc "Link"] -command [list menus::text_only menus::edit_format link]
1417  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert link formatting"]] [list menus::text_only menus::edit_format link]
1418 
1419  $mb.formatPopup add command -label [msgcat::mc "Image"] -command [list menus::text_only menus::edit_format image]
1420  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Insert image formatting"]] [list menus::text_only menus::edit_format image]
1421 
1422  $mb.formatPopup add separator
1423 
1424  $mb.formatPopup add command -label [msgcat::mc "Remove Formatting"] -command [list menus::text_only menus::edit_format_remove]
1425  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Remove formatting from selected text"]] [list menus::text_only menus::edit_format_remove]
1426 
1427  ###########################
1428  # Populate preferences menu
1429  ###########################
1430 
1431  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Edit User"] [msgcat::mc "Global"]] -command [list menus::edit_user_global]
1432  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit user global preferences"]] [list menus::edit_user_global]
1433 
1434  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Edit User"] [msgcat::mc "Language"]] -command [list menus::edit_user_language]
1435  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit user current language preferences"]] [list menus::edit_user_language]
1436 
1437  $mb.prefPopup add separator
1438 
1439  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Delete User"] [msgcat::mc "Language"]] -command [list menus::delete_user_language]
1440 
1441  $mb.prefPopup add separator
1442 
1443  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Global"]] -command [list menus::edit_session_global]
1444  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit session global preferences"]] [list menus::edit_session_global]
1445 
1446  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Language"]] -command [list menus::edit_session_language]
1447  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit session current language preferences"]] [list menus::edit_session_language]
1448 
1449  $mb.prefPopup add separator
1450 
1451  $mb.prefPopup add command -label [format "%s - %s" [msgcat::mc "Delete Session"] [msgcat::mc "Language"]] -command [list menus::delete_session_language]
1452 
1453  ########################
1454  # Populate snippets menu
1455  ########################
1456 
1457  $mb.snipPopup add command -label [msgcat::mc "Edit User"] -command [list menus::main_only menus::add_new_snippet user]
1458  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit user snippets"]] [list menus::main_only menus::add_new_snippet user]
1459 
1460  $mb.snipPopup add command -label [msgcat::mc "Edit Language"] -command [list menus::main_only menus::add_new_snippet lang]
1461  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit language snippets"]] [list menus::main_only menus::add_new_snippet lang]
1462 
1463  $mb.snipPopup add separator
1464 
1465  $mb.snipPopup add command -label [msgcat::mc "Reload"] -command [list menus::main_only snippets::reload_snippets]
1466  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Reload snippets"]] [list menus::main_only snippets::reload_snippets]
1467 
1468  #########################
1469  # Populate templates menu
1470  #########################
1471 
1472  $mb.tempPopup add command -label [msgcat::mc "Edit"] -command [list menus::main_only templates::show_templates edit]
1473  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit template"]] [list menus::main_only templates::show_templates edit]
1474 
1475  $mb.tempPopup add command -label [msgcat::mc "Delete"] -command [list menus::main_only templates::show_templates delete]
1476  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Delete template"]] [list menus::main_only templates::show_templates delete]
1477 
1478  $mb.tempPopup add separator
1479 
1480  $mb.tempPopup add command -label [msgcat::mc "Reload"] -command [list menus::main_only templates::preload]
1481  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Reload template information"]] [list menus::main_only templates::preload]
1482 
1483  #####################
1484  # Populate Emmet menu
1485  #####################
1486 
1487  $mb.emmetPopup add command -label [msgcat::mc "Expand Abbreviation"] -command [list menus::text_only emmet::expand_abbreviation]
1488  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Expand Emmet abbreviation"]] [list menus::text_only emmet::expand_abbreviation]
1489 
1490  $mb.emmetPopup add command -label [msgcat::mc "Wrap With Abbreviation"] -command [list menus::text_only emmet::wrap_with_abbreviation]
1491  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Wrap tag with Emmet abbreviation"]] [list menus::text_only emmet::wrap_with_abbreviation]
1492 
1493  $mb.emmetPopup add separator
1494 
1495  $mb.emmetPopup add command -label [msgcat::mc "Balance Outward"] -command [list menus::text_only emmet::balance_outward]
1496  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Balance tag pair moving outward"]] [list menus::text_only emmet::balance_outward]
1497 
1498  $mb.emmetPopup add command -label [msgcat::mc "Balance Inward"] -command [list menus::text_only emmet::balance_inward]
1499  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Balance tag pair moving inward"]] [list menus::text_only emmet::balance_inward]
1500 
1501  $mb.emmetPopup add command -label [msgcat::mc "Go to Matching Pair"] -command [list menus::text_only emmet::go_to_matching_pair]
1502  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Go to matching tag pair"]] [list menus::text_only emmet::go_to_matching_pair]
1503 
1504  $mb.emmetPopup add separator
1505 
1506  $mb.emmetPopup add command -label [msgcat::mc "Toggle Comment"] -command [list menus::text_only emmet::toggle_comment]
1507  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Toggle tag/rule comment"]] [list menus::text_only emmet::toggle_comment]
1508 
1509  $mb.emmetPopup add command -label [msgcat::mc "Split/Join Tag"] -command [list menus::text_only emmet::split_join_tag]
1510  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Split/Join tag"]] [list menus::text_only emmet::split_join_tag]
1511 
1512  $mb.emmetPopup add command -label [msgcat::mc "Remove Tag"] -command [list menus::text_only emmet::remove_tag]
1513  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Remove tag"]] [list menus::text_only emmet::remove_tag]
1514 
1515  $mb.emmetPopup add command -label [msgcat::mc "Merge Lines"] -command [list menus::text_only emmet::merge_lines]
1516  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Merge Lines"]] [list menus::text_only emmet::merge_lines]
1517 
1518  $mb.emmetPopup add command -label [msgcat::mc "Update Image Size"] -command [list menus::text_only emmet::update_image_size]
1519  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Update img tag width and height attributes"]] [list menus::text_only emmet::update_image_size]
1520 
1521  $mb.emmetPopup add command -label [msgcat::mc "Encode/Decode Image to Data:URL"] -command [list menus::text_only emmet::encode_decode_image_to_data_url]
1522  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Encode/Decode image to data:URL"]] [list menus::text_only emmet::encode_decode_image_to_data_url]
1523 
1524  $mb.emmetPopup add command -label [msgcat::mc "Reflect CSS Value"] -command [list menus::text_only emmet_css::reflect_css_value]
1525  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Reflect current CSS value"]] [list menus::text_only emmet_css::reflect_css_value]
1526 
1527  $mb.emmetPopup add separator
1528 
1529  $mb.emmetPopup add command -label [msgcat::mc "Next Edit Point"] -command [list menus::text_only emmet::go_to_edit_point next]
1530  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Go to next edit point"]] [list menus::text_only emmet::go_to_edit_point next]
1531 
1532  $mb.emmetPopup add command -label [msgcat::mc "Previous Edit Point"] -command [list menus::text_only emmet::go_to_edit_point prev]
1533  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Go to previous edit point"]] [list menus::text_only emmet::go_to_edit_point prev]
1534 
1535  $mb.emmetPopup add separator
1536 
1537  $mb.emmetPopup add command -label [msgcat::mc "Select Next Item"] -command [list menus::text_only emmet::select_item next]
1538  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select next tag item"]] [list menus::text_only emmet::select_item next]
1539 
1540  $mb.emmetPopup add command -label [msgcat::mc "Select Previous Item"] -command [list menus::text_only emmet::select_item prev]
1541  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Select previous tag item"]] [list menus::text_only emmet::select_item prev]
1542 
1543  $mb.emmetPopup add separator
1544 
1545  $mb.emmetPopup add command -label [msgcat::mc "Evaluate Math Expression"] -command [list menus::text_only emmet::evaluate_math_expression]
1546  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Evaluate the current math expression"]] [list menus::text_only emmet::evaluate_math_expression]
1547 
1548  $mb.emmetPopup add separator
1549 
1550  $mb.emmetPopup add command -label [msgcat::mc "Increment by 10"] -command [list menus::text_only emmet::change_number 10]
1551  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Increment number by 10"]] [list menus::text_only emmet::change_number 10]
1552 
1553  $mb.emmetPopup add command -label [msgcat::mc "Increment by 1"] -command [list menus::text_only emmet::change_number 1]
1554  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Increment number by 1"]] [list menus::text_only emmet::change_number 1]
1555 
1556  $mb.emmetPopup add command -label [msgcat::mc "Increment by 0.1"] -command [list menus::text_only emmet::change_number 0.1]
1557  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Increment number by 0.1"]] [list menus::text_only emmet::change_number 0.1]
1558 
1559  $mb.emmetPopup add command -label [msgcat::mc "Decrement by 10"] -command [list menus::text_only emmet::change_number -10]
1560  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Decrement number by 10"]] [list menus::text_only emmet::change_number -10]
1561 
1562  $mb.emmetPopup add command -label [msgcat::mc "Decrement by 1"] -command [list menus::text_only emmet::change_number -1]
1563  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Decrement number by 1"]] [list menus::text_only emmet::change_number -1]
1564 
1565  $mb.emmetPopup add command -label [msgcat::mc "Decrement by 0.1"] -command [list menus::text_only emmet::change_number -0.1]
1566  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Decrement number by 0.1"]] [list menus::text_only emmet::change_number -0.1]
1567 
1568  $mb.emmetPopup add separator
1569 
1570  $mb.emmetPopup add command -label [msgcat::mc "Edit Custom Abbreviations"] -command [list menus::main_only emmet::edit_abbreviations]
1571  launcher::register [make_menu_cmd "Edit" [msgcat::mc "Edit custom Emmet abbreviations"]] [list menus::main_only emmet::edit_abbreviations]
1572 
1573  $mb.emmetPopup add separator
1574 
1575  $mb.emmetPopup add command -label [msgcat::mc "View Emmet Reference Guide"] -command [list menus::main_only emmet::view_reference]
1576  launcher::register [make_menu_cmd "Edit" [msgcat::mc "View the Emmet reference guide"]] [list menus::main_only emmet::view_reference]
1577 
1578  }

§ add_file()

menus::add_file   mb  

Definition at line 361 of file menus.tcl.

361  proc add_file {mb} {
362 
363  $mb delete 0 end
364 
365  $mb add command -label [msgcat::mc "New Window"] -underline 4 -command [list menus::main_only menus::new_window_command]
366  launcher::register [make_menu_cmd "File" [msgcat::mc "New window"]] [list menus::main_only menus::new_window_command]
367 
368  $mb add command -label [msgcat::mc "New File"] -underline 0 -command [list menus::main_only menus::new_file_command]
369  launcher::register [make_menu_cmd "File" [msgcat::mc "New file"]] [list menus::main_only menus::new_file_command]
370 
371  $mb add command -label [format "%s..." [msgcat::mc "New From Template"]] -underline 9 -command [list menus::main_only templates::show_templates load_abs]
372  launcher::register [make_menu_cmd "File" [msgcat::mc "New file from template"]] [list menus::main_only templates::show_templates load_abs]
373 
374  $mb add separator
375 
376  $mb add command -label [format "%s..." [msgcat::mc "Open File"]] -underline 0 -command [list menus::main_only menus::open_command]
377  launcher::register [make_menu_cmd "File" [msgcat::mc "Open file"]] [list menus::main_only menus::open_command]
378 
379  $mb add command -label [format "%s..." [msgcat::mc "Open Directory"]] -underline 5 -command [list menus::main_only menus::open_dir_command]
380  launcher::register [make_menu_cmd "File" [msgcat::mc "Open directory"]] [list menus::main_only menus::open_dir_command]
381 
382  $mb add command -label [format "%s..." [msgcat::mc "Open Remote"]] -underline 0 -command [list menus::main_only menus::open_remote_command]
383  launcher::register [make_menu_cmd "File" [msgcat::mc "Open remote file or directory"]] [list menus::main_only menus::open_remote_command]
384 
385  $mb add cascade -label [msgcat::mc "Open Recent"] -menu [make_menu $mb.recent -tearoff false -postcommand [list menus::file_recent_posting $mb.recent]]
386  launcher::register [make_menu_cmd "File" [msgcat::mc "Open Recent"]] [list menus::launcher]
387 
388  $mb add cascade -label [msgcat::mc "Open Favorite"] -menu [make_menu $mb.favorites -tearoff false -postcommand [list menus::file_favorites_posting $mb.favorites]]
389  launcher::register [make_menu_cmd "File" [msgcat::mc "Open Favorite"]] [list favorites::launcher]
390 
391  $mb add command -label [msgcat::mc "Reopen File"] -underline 0 -command [list menus::main_only gui::update_current]
392  launcher::register [make_menu_cmd "File" [msgcat::mc "Reopen current file"]] [list menus::main_only gui::update_current]
393 
394  $mb add separator
395 
396  $mb add command -label [msgcat::mc "Change Working Directory"] -underline 0 -command [list menus::main_only menus::change_working_directory]
397  launcher::register [make_menu_cmd "File" [msgcat::mc "Change working directory"]] [list menus::main_only menus::change_working_directory]
398 
399  $mb add separator
400 
401  $mb add command -label [msgcat::mc "Show File Difference"] -underline 3 -command [list menus::text_only menus::show_file_diff]
402  launcher::register [make_menu_cmd "File" [msgcat::mc "Show file difference"]] [list menus::text_only menus::show_file_diff]
403 
404  $mb add separator
405 
406  $mb add command -label [msgcat::mc "Save"] -underline 0 -command [list menus::text_only menus::save_command]
407  launcher::register [make_menu_cmd "File" [msgcat::mc "Save file"]] [list menus::text_only menus::save_command]
408 
409  $mb add command -label [format "%s..." [msgcat::mc "Save As"]] -underline 5 -command [list menus::text_only menus::save_as_command]
410  launcher::register [make_menu_cmd "File" [msgcat::mc "Save file as"]] [list menus::text_only menus::save_as_command]
411 
412  $mb add command -label [format "%s..." [msgcat::mc "Save As Remote"]] -command [list menus::text_only menus::save_as_remote_command]
413  launcher::register [make_menu_cmd "File" [msgcat::mc "Save file as remote file"]] [list menus::text_only menus::save_as_remote_command]
414 
415  $mb add command -label [format "%s..." [msgcat::mc "Save As Template"]] -command [list menus::text_only templates::save_as]
416  launcher::register [make_menu_cmd "File" [msgcat::mc "Save file as template"]] [list menus::text_only templates::save_as]
417 
418  $mb add command -label [format "%s..." [msgcat::mc "Save Selection As"]] -underline 7 -command [list menus::text_only menus::save_selection_as_command]
419  launcher::register [make_menu_cmd "File" [msgcat::mc "Save selected lines"]] [list menus::text_only menus::save_selection_as_command]
420 
421  $mb add command -label [msgcat::mc "Save All"] -underline 6 -command [list menus::main_only gui::save_all]
422  launcher::register [make_menu_cmd "File" [msgcat::mc "Save all files"]] [list menus::main_only gui::save_all]
423 
424  $mb add separator
425 
426  # Populate the export menu
427  $mb add command -label [format "%s..." [msgcat::mc "Export"]] -command [list menus::text_only menus::export_command]
428  launcher::register [make_menu_cmd "File" [msgcat::mc "Export file contents"]] [list menus::text_only menus::export_command]
429 
430  $mb add separator
431 
432  $mb add cascade -label [msgcat::mc "Encoding"] -menu [gui::create_encoding_menu $mb.encode]
433  $mb add cascade -label [msgcat::mc "Line Ending"] -menu [make_menu $mb.eolPopup -tearoff 0 -postcommand [list menus::file_eol_posting $mb.eolPopup]]
434 
435  $mb add separator
436 
437  $mb add command -label [msgcat::mc "Rename"] -underline 4 -command [list menus::text_only menus::rename_command]
438  launcher::register [make_menu_cmd "File" [msgcat::mc "Rename current file"]] [list menus::text_only menus::rename_command]
439 
440  $mb add command -label [msgcat::mc "Duplicate"] -underline 1 -command [list menus::text_only menus::duplicate_command]
441  launcher::register [make_menu_cmd "File" [msgcat::mc "Duplicate current file"]] [list menus::text_only menus::duplicate_command]
442 
443  $mb add command -label [msgcat::mc "Delete"] -underline 0 -command [list menus::text_only menus::delete_command]
444  launcher::register [make_menu_cmd "File" [msgcat::mc "Delete current file"]] [list menus::text_only menus::delete_command]
445 
446  $mb add separator
447 
448  $mb add command -label [msgcat::mc "Lock"] -underline 0 -command [list menus::text_only menus::lock_command $mb]
449  launcher::register [make_menu_cmd "File" [msgcat::mc "Lock file"]] [list menus::text_only menus::lock_command $mb]
450  launcher::register [make_menu_cmd "File" [msgcat::mc "Unlock file"]] [list menus::text_only menus::unlock_command $mb]
451 
452  $mb add command -label [msgcat::mc "Favorite"] -underline 0 -command [list menus::text_only menus::favorite_command $mb]
453  launcher::register [make_menu_cmd "File" [msgcat::mc "Favorite file"]] [list menus::text_only menus::favorite_command $mb]
454  launcher::register [make_menu_cmd "File" [msgcat::mc "Unfavorite file"]] [list menus::text_only menus::unfavorite_command $mb]
455 
456  $mb add separator
457 
458  $mb add command -label [msgcat::mc "Close"] -underline 0 -command [list menus::text_only menus::close_command]
459  launcher::register [make_menu_cmd "File" [msgcat::mc "Close current tab"]] [list menus::text_only menus::close_command]
460 
461  $mb add command -label [msgcat::mc "Close All"] -underline 6 -command [list menus::main_only menus::close_all_command]
462  launcher::register [make_menu_cmd "File" [msgcat::mc "Close all tabs"]] [list menus::main_only menus::close_all_command]
463 
464  # Only add the quit menu to File if we are not running in aqua
465  if {[tk windowingsystem] ne "aqua"} {
466  $mb add separator
467  $mb add command -label [msgcat::mc "Quit"] -underline 0 -command [list menus::exit_command]
468  }
469  launcher::register [make_menu_cmd "File" [msgcat::mc "Quit application"]] [list menus::exit_command]
470 
471  # Populate the end-of-line menu
472  $mb.eolPopup add radiobutton -label "Windows" -variable menus::line_ending -value "crlf" -command [list menus::text_only gui::set_current_eol_translation crlf]
473  launcher::register [make_menu_cmd "File" [msgcat::mc "Set current file line ending to CRLF for Windows"]] [list menus::text_only gui::set_current_eol_translation crlf]
474 
475  $mb.eolPopup add radiobutton -label "Unix" -variable menus::line_ending -value "lf" -command [list menus::text_only gui::set_current_eol_translation lf]
476  launcher::register [make_menu_cmd "File" [msgcat::mc "Set current file line ending to LF for Unix"]] [list menus::text_only gui::set_current_eol_translation lf]
477 
478  $mb.eolPopup add radiobutton -label [msgcat::mc "Classic Mac"] -variable menus::line_ending -value "cr" -command [list menus::text_only gui::set_current_eol_translation cr]
479  launcher::register [make_menu_cmd "File" [msgcat::mc "Set current file line ending to CR for Classic Mac"]] [list menus::text_only gui::set_current_eol_translation cr]
480 
481  }

§ add_find()

menus::add_find   mb  

Definition at line 2240 of file menus.tcl.

2240  proc add_find {mb} {
2241 
2242  # Add find menu commands
2243  $mb add command -label [msgcat::mc "Find"] -underline 0 -command [list menus::text_only gui::search]
2244  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find"]] [list menus::text_only gui::search]
2245 
2246  $mb add command -label [msgcat::mc "Find Next"] -underline 7 -command [list menus::text_only menus::find_next_command]
2247  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find next occurrence"]] [list menus::text_only menus::find_next_command]
2248 
2249  $mb add command -label [msgcat::mc "Find Previous"] -underline 7 -command [list menus::text_only menus::find_prev_command]
2250  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find previous occurrence"]] [list menus::text_only menus::find_prev_command]
2251 
2252  $mb add separator
2253 
2254  $mb add command -label [msgcat::mc "Select Current Match"] -underline 1 -command [list menus::text_only menus::find_select_current_command]
2255  launcher::register [make_menu_cmd "Find" [msgcat::mc "Append current find text to selection"]] [list menus::text_only menus::find_select_current_command]
2256 
2257  $mb add command -label [msgcat::mc "Select All Matches"] -underline 7 -command [list menus::text_only menus::find_select_all_command]
2258  launcher::register [make_menu_cmd "Find" [msgcat::mc "Select all find matches"]] [list menus::text_only menus::find_select_all_command]
2259 
2260  $mb add separator
2261 
2262  $mb add command -label [msgcat::mc "Find and Replace"] -underline 9 -command [list menus::text_only gui::search_and_replace]
2263  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find and Replace"]] [list menus::text_only gui::search_and_replace]
2264 
2265  $mb add separator
2266 
2267  $mb add command -label [msgcat::mc "Jump Backward"] -underline 5 -command [list menus::text_only gui::jump_to_cursor -1 1]
2268  launcher::register [make_menu_cmd "Find" [msgcat::mc "Jump backward"]] [list menus::text_only gui::jump_to_cursor -1 1]
2269 
2270  $mb add command -label [msgcat::mc "Jump Forward"] -underline 5 -command [list menus::text_only gui::jump_to_cursor 1 1]
2271  launcher::register [make_menu_cmd "Find" [msgcat::mc "Jump forward"]] [list menus::text_only gui::jump_to_cursor 1 1]
2272 
2273  $mb add command -label [msgcat::mc "Jump To Line"] -underline 8 -command [list menus::text_only menus::jump_to_line]
2274  launcher::register [make_menu_cmd "Find" [msgcat::mc "Jump to line"]] [list menus::text_only menus::jump_to_line]
2275 
2276  $mb add separator
2277 
2278  $mb add command -label [msgcat::mc "Next Difference"] -underline 0 -command [list menus::text_only gui::jump_to_difference 1 1]
2279  launcher::register [make_menu_cmd "Find" [msgcat::mc "Goto next difference"]] [list menus::text_only gui::jump_to_difference 1 1]
2280 
2281  $mb add command -label [msgcat::mc "Previous Difference"] -underline 0 -command [list menus::text_only gui::jump_to_difference -1 1]
2282  launcher::register [make_menu_cmd "Find" [msgcat::mc "Goto previous difference"]] [list menus::text_only gui::jump_to_difference -1 1]
2283 
2284  $mb add command -label [msgcat::mc "Show Selected Line Change"] -underline 19 -command [list menus::text_only gui::show_difference_line_change 1]
2285  launcher::register [make_menu_cmd "Find" [msgcat::mc "Show selected line change"]] [list menus::text_only gui::show_difference_line_change 1]
2286 
2287  $mb add separator
2288 
2289  $mb add cascade -label [msgcat::mc "Markers"] -underline 5 -menu [make_menu $mb.markerPopup -tearoff 0 -postcommand [list menus::find_marker_posting $mb.markerPopup]]
2290 
2291  $mb add separator
2292 
2293  $mb add command -label [msgcat::mc "Find Matching Bracket"] -underline 5 -command [list menus::text_only gui::show_match_pair]
2294  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find matching character pair"]] [list menus::text_only gui::show_match_pair]
2295 
2296  $mb add separator
2297 
2298  $mb add command -label [msgcat::mc "Find Next Bracket Mismatch"] -command [list menus::text_only gui::goto_mismatch next]
2299  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find next mismatching bracket"]] [list menus::text_only gui::goto_mismatch next]
2300 
2301  $mb add command -label [msgcat::mc "Find Previous Bracket Mismatch"] -command [list menus::text_only gui::goto_mismatch prev]
2302  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find previous mismatching bracket"]] [list menus::text_only gui::goto_mismatch prev]
2303 
2304  $mb add separator
2305 
2306  $mb add command -label [msgcat::mc "Find In Files"] -underline 5 -command [list menus::main_only search::fif_start]
2307  launcher::register [make_menu_cmd "Find" [msgcat::mc "Find in files"]] [list menus::main_only search::fif_start]
2308 
2309  # Add marker popup launchers
2310  launcher::register [make_menu_cmd "Find" [msgcat::mc "Create marker at current line"]] [list menus::text_only gui::create_current_marker]
2311  launcher::register [make_menu_cmd "Find" [msgcat::mc "Remove marker from current line"]] [list menus::text_only gui::remove_current_marker]
2312  launcher::register [make_menu_cmd "Find" [msgcat::mc "Remove all markers from current buffer"]] [list menus::text_only gui::remove_current_markers]
2313  launcher::register [make_menu_cmd "Find" [msgcat::mc "Remove all markers"]] [list gui::remove_all_markers]
2314 
2315  }

§ add_fold_from_selection()

menus::add_fold_from_selection

Definition at line 3024 of file menus.tcl.

3024  proc add_fold_from_selection {} {
3025 
3027 
3028  }

§ add_help()

menus::add_help   mb  

Definition at line 3492 of file menus.tcl.

3492  proc add_help {mb} {
3493 
3494  $mb add command -label [msgcat::mc "User Guide"] -underline 0 -command [list menus::help_user_guide]
3495  launcher::register [make_menu_cmd "Help" [msgcat::mc "View user guide"]] [list menus::help_user_guide]
3496 
3497  $mb add command -label [msgcat::mc "Tips & Tricks"] -underline 0 -command [list menus::help_tips_tricks]
3498  launcher::register [make_menu_cmd "Help" [msgcat::mc "View tips & tricks articles"]] [list menus::help_tips_tricks]
3499 
3500  $mb add separator
3501 
3502  $mb add cascade -label [msgcat::mc "Language Documentation"] -menu [make_menu $mb.refPopup -tearoff 0 -postcommand [list menus::help_lang_ref_posting $mb.refPopup]]
3503  $mb add command -label [msgcat::mc "Search References"] -underline 0 -command [list menus::main_only search::search_documentation]
3504  launcher::register [make_menu_cmd "Help" [msgcat::mc "Search reference documentation"]] [list menus::main_only search::search_documentation]
3505 
3506  if {![string match *Win* $::tcl_platform(os)]} {
3507  $mb add separator
3508  $mb add command -label [msgcat::mc "Check for Update"] -underline 0 -command [list menus::check_for_update]
3509  launcher::register [make_menu_cmd "Help" [msgcat::mc "Check for update"]] [list menus::check_for_update]
3510  }
3511 
3512  $mb add separator
3513 
3514  $mb add command -label [msgcat::mc "Send Feedback"] -underline 5 -command [list menus::help_feedback_command]
3515  launcher::register [make_menu_cmd "Help" [msgcat::mc "Send feedback"]] [list menus::help_feedback_command]
3516 
3517  $mb add command -label [msgcat::mc "Send Bug Report"] -underline 5 -command [list menus::help_submit_report]
3518  launcher::register [make_menu_cmd "Help" [msgcat::mc "Send bug report"]] [list menus::help_submit_report]
3519 
3520  if {[tk windowingsystem] ne "aqua"} {
3521  $mb add separator
3522  $mb add command -label [format "%s %s" [msgcat::mc "About"] "TKE"] -underline 0 -command [list gui::show_about]
3523  launcher::register [make_menu_cmd "Help" [format "%s %s" [msgcat::mc "About"] "TKE"]] [list gui::show_about]
3524  }
3525 
3526  # Create search popup menu
3527  menu $mb.refPopup.searchPopup -tearoff 0
3528 
3529  launcher::register [make_menu_cmd "Help" [msgcat::mc "Search language reference documentation"]] [list gui::search_documentation]
3530 
3531  }

§ add_new_snippet()

menus::add_new_snippet   language  

Definition at line 2228 of file menus.tcl.

2228  proc add_new_snippet {language} {
2229 
2230  if {$language eq "user"} {
2231  pref_ui::create "" "" snippets
2232  } else {
2234  }
2235 
2236  }

§ add_plugins()

menus::add_plugins   mb  

Definition at line 3457 of file menus.tcl.

3457  proc add_plugins {mb} {
3458 
3459  # Add plugins menu commands
3460  $mb add command -label [format "%s..." [msgcat::mc "Install"]] -underline 0 -command [list plugins::install]
3461  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Install plugin"]] [list plugins::install]
3462 
3463  $mb add command -label [format "%s..." [msgcat::mc "Uninstall"]] -underline 0 -command [list plugins::uninstall]
3464  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Uninstall plugin"]] [list plugins::uninstall]
3465 
3466  $mb add command -label [format "%s..." [msgcat::mc "Show Installed"]] -underline 0 -command [list plugins::show_installed]
3467  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Show installed plugins"]] [list plugins::show_installed]
3468 
3469  $mb add command -label [format "%s..." [msgcat::mc "Import"]] -underline 0 -command [list plugins::import]
3470  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Import plugin bundle"]] [list plugins::import]
3471 
3472  $mb add command -label [msgcat::mc "Reload"] -underline 0 -command [list plugins::reload]
3473  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Reload all plugins"]] [list plugins::reload]
3474 
3475  # Allow the plugin architecture to add menu items
3477 
3478  }

§ add_sessions()

menus::add_sessions   mb  

Definition at line 3335 of file menus.tcl.

3335  proc add_sessions {mb} {
3336 
3337  # Add sessions menu commands
3338  $mb add cascade -label [msgcat::mc "Switch To"] -menu [make_menu $mb.switch -tearoff false]
3339  launcher::register [make_menu_cmd "Sessions" [msgcat::mc "Switch to session"]] [list menus::sessions_switch_launcher]
3340 
3341  $mb add separator
3342 
3343  $mb add command -label [msgcat::mc "Close Current"] -underline 0 -command [list menus::main_only menus::sessions_close_current]
3344  launcher::register [make_menu_cmd "Sessions" [msgcat::mc "Close current session"]] [list menus::main_only menus::sessions_close_current]
3345 
3346  $mb add separator
3347 
3348  $mb add command -label [msgcat::mc "Save Current"] -underline 0 -command [list menus::main_only menus::sessions_save_current]
3349  launcher::register [make_menu_cmd "Sessions" [msgcat::mc "Save current session"]] [list menus::main_only menus::sessions_save_current]
3350 
3351  $mb add command -label [msgcat::mc "Save As"] -underline 5 -command [list menus::main_only menus::sessions_save_as]
3352  launcher::register [make_menu_cmd "Sessions" [msgcat::mc "Save sessions as"]] [list menus::main_only menus::sessions_save_as]
3353 
3354  $mb add separator
3355 
3356  $mb add cascade -label [msgcat::mc "Delete"] -menu [make_menu $mb.delete -tearoff false]
3357  launcher::register [make_menu_cmd "Sessions" [msgcat::mc "Delete session"]] [list menus::main_only menus::sessions_delete_launcher]
3358 
3359  }

§ add_tools()

menus::add_tools   mb  

Definition at line 3113 of file menus.tcl.

3113  proc add_tools {mb} {
3114 
3115  # Add tools menu commands
3116  $mb add command -label [msgcat::mc "Launcher"] -underline 0 -command [list menus::main_only launcher::launch]
3117 
3118  $mb add command -label [msgcat::mc "Theme Editor"] -underline 0 -command [list menus::theme_edit_command]
3119  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Run theme editor"]] [list menus::theme_edit_command]
3120 
3121  }

§ add_view()

menus::add_view   mb  

Definition at line 2449 of file menus.tcl.

2449  proc add_view {mb} {
2450 
2451  if {[preferences::get View/ShowSidebar]} {
2452  $mb add command -label [msgcat::mc "Hide Sidebar"] -underline 5 -command [list menus::main_only menus::hide_sidebar_view $mb]
2453  } else {
2454  $mb add command -label [msgcat::mc "Show Sidebar"] -underline 5 -command [list menus::main_only menus::show_sidebar_view $mb]
2455  }
2456  launcher::register [make_menu_cmd "View" [msgcat::mc "Show sidebar"]] [list menus::main_only menus::show_sidebar_view $mb]
2457  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide sidebar"]] [list menus::main_only menus::hide_sidebar_view $mb]
2458 
2459  if {[preferences::get View/ShowTabBar]} {
2460  $mb add command -label [msgcat::mc "Hide Tab Bar"] -underline 5 -command [list menus::main_only menus::hide_tab_view $mb]
2461  } else {
2462  $mb add command -label [msgcat::mc "Show Tab Bar"] -underline 5 -command [list menus::main_only menus::show_tab_view $mb]
2463  }
2464  launcher::register [make_menu_cmd "View" [msgcat::mc "Show tab bar"]] [list menus::main_only menus::show_tab_view $mb]
2465  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide tab bar"]] [list menus::main_only menus::hide_tab_view $mb]
2466 
2467  if {[preferences::get View/ShowStatusBar]} {
2468  $mb add command -label [msgcat::mc "Hide Status Bar"] -underline 12 -command [list menus::main_only menus::hide_status_view $mb]
2469  } else {
2470  $mb add command -label [msgcat::mc "Show Status Bar"] -underline 12 -command [list menus::main_only menus::show_status_view $mb]
2471  }
2472  launcher::register [make_menu_cmd "View" [msgcat::mc "Show status bar"]] [list menus::main_only menus::show_status_view $mb]
2473  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide status bar"]] [list menus::main_only menus::hide_status_view $mb]
2474 
2475  $mb add separator
2476 
2477  if {[preferences::get View/ShowLineNumbers]} {
2478  $mb add command -label [msgcat::mc "Hide Line Numbers"] -underline 5 -command [list menus::main_only menus::hide_line_numbers $mb]
2479  } else {
2480  $mb add command -label [msgcat::mc "Show Line Numbers"] -underline 5 -command [list menus::main_only menus::show_line_numbers $mb]
2481  }
2482  launcher::register [make_menu_cmd "View" [msgcat::mc "Show line numbers"]] [list menus::main_only menus::show_line_numbers $mb]
2483  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide line numbers"]] [list menus::main_only menus::hide_line_numbers $mb]
2484 
2485  $mb add cascade -label [msgcat::mc "Line Numbering"] -menu [make_menu $mb.numPopup -tearoff 0]
2486  $mb add checkbutton -label [msgcat::mc "Line Wrapping"] -underline 5 -variable menus::line_wrapping -command [list menus::main_only menus::set_line_wrapping]
2487 
2488  $mb add separator
2489 
2490  if {[preferences::get View/ShowMarkerMap]} {
2491  $mb add command -label [msgcat::mc "Hide Marker Map"] -underline 8 -command [list menus::main_only menus::hide_marker_map $mb]
2492  } else {
2493  $mb add command -label [msgcat::mc "Show Marker Map"] -underline 8 -command [list menus::main_only menus::show_marker_map $mb]
2494  }
2495  launcher::register [make_menu_cmd "View" [msgcat::mc "Show marker map"]] [list menus::main_only menus::show_marker_map $mb]
2496  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide marker map"]] [list menus::main_only menus::hide_marker_map $mb]
2497 
2498  $mb add command -label [msgcat::mc "Hide Meta Characters"] -underline 5 -command [list menus::main_only menus::hide_meta_chars $mb]
2499  launcher::register [make_menu_cmd "View" [msgcat::mc "Show meta characters"]] [list menus::main_only menus::show_meta_chars $mb]
2500  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide meta characters"]] [list menus::main_only menus::hide_meta_chars $mb]
2501 
2502  $mb add separator
2503 
2504  $mb add command -label [msgcat::mc "Display Text Info"] -underline 13 -command [list menus::main_only menus::display_text_info]
2505  launcher::register [make_menu_cmd "View" [msgcat::mc "Display text information"]] [list menus::main_only menus::display_text_info]
2506 
2507  $mb add separator
2508 
2509  $mb add checkbutton -label [msgcat::mc "Split View"] -underline 6 -variable menus::show_split_pane -command [list menus::main_only gui::toggle_split_pane]
2510  launcher::register [make_menu_cmd "View" [msgcat::mc "Toggle split view mode"]] [list menus::main_only gui::toggle_split_pane]
2511 
2512  $mb add checkbutton -label [msgcat::mc "Bird's Eye View"] -underline 0 -variable menus::show_birdseye -command [list menus::main_only gui::toggle_birdseye]
2513  launcher::register [make_menu_cmd "View" [msgcat::mc "Toggle bird's eye view mode"]] [list menus::main_only gui::toggle_birdseye]
2514 
2515  $mb add command -label [msgcat::mc "Move to Other Pane"] -underline 0 -command [list menus::main_only gui::move_to_pane]
2516  launcher::register [make_menu_cmd "View" [msgcat::mc "Move to other pane"]] [list menus::main_only gui::move_to_pane]
2517 
2518  $mb add separator
2519 
2520  $mb add cascade -label [msgcat::mc "Panes"] -underline 0 -menu [make_menu $mb.panePopup -tearoff 0]
2521  $mb add cascade -label [msgcat::mc "Tabs"] -underline 0 -menu [make_menu $mb.tabPopup -tearoff 0 -postcommand "menus::view_tabs_posting $mb.tabPopup"]
2522  $mb add cascade -label [msgcat::mc "Folding"] -underline 0 -menu [make_menu $mb.foldPopup -tearoff 0 -postcommand "menus::view_fold_posting $mb.foldPopup"]
2523 
2524  $mb add separator
2525 
2526  $mb add cascade -label [msgcat::mc "Set Syntax"] -underline 9 -menu [syntax::create_menu $mb.syntax]
2527  $mb add cascade -label [msgcat::mc "Set Theme"] -underline 7 -menu [make_menu $mb.themeMenu -tearoff 0 -postcommand "themes::populate_theme_menu $mb.themeMenu"]
2528 
2529  # Setup the line numbering popup menu
2530  $mb.numPopup add radiobutton -label [msgcat::mc "Absolute"] -variable menus::line_numbering -value absolute -command [list menus::main_only menus::set_line_numbering absolute]
2531  launcher::register [make_menu_cmd "View" [msgcat::mc "Absolute line numbering"]] [list menus::main_only menus::set_line_numbering absolute]
2532 
2533  $mb.numPopup add radiobutton -label [msgcat::mc "Relative"] -variable menus::line_numbering -value relative -command [list menus::main_only menus::set_line_numbering relative]
2534  launcher::register [make_menu_cmd "View" [msgcat::mc "Relative line numbering"]] [list menus::main_only menus::set_line_numbering relative]
2535 
2536  # Setup the pane popup menu
2537  $mb.panePopup add checkbutton -label [msgcat::mc "Enable Synchronized Scrolling"] -variable menus::sync_panes -command [list menus::main_only menus::sync_panes]
2538  launcher::register [make_menu_cmd "View" [msgcat::mc "Enable two-pane scrolling synchronization"]] [list menus::main_only gui::set_pane_sync 1]
2539  launcher::register [make_menu_cmd "View" [msgcat::mc "Disable two-pane scrolling Synchronization"]] [list menus::main_only gui::set_pane_sync 0]
2540 
2541  $mb.panePopup add command -label [msgcat::mc "Align Panes"] -command [list menus::main_only gui::align_panes]
2542  launcher::register [make_menu_cmd "View" [msgcat::mc "Align current lines in both panes"]] [list menus::main_only gui::align_panes]
2543 
2544  $mb.panePopup add separator
2545 
2546  $mb.panePopup add command -label [msgcat::mc "Merge Panes"] -underline 3 -command [list menus::main_only gui::merge_panes]
2547  launcher::register [make_menu_cmd "View" [msgcat::mc "Merge panes"]] [list menus::main_only gui::merge_panes]
2548 
2549  # Setup the tab popup menu
2550  $mb.tabPopup add command -label [msgcat::mc "Goto Next Tab"] -underline 5 -command [list menus::main_only gui::next_tab]
2551  launcher::register [make_menu_cmd "View" [msgcat::mc "Goto next tab"]] [list menus::main_only gui::next_tab]
2552 
2553  $mb.tabPopup add command -label [msgcat::mc "Goto Previous Tab"] -underline 5 -command [list menus::main_only gui::previous_tab]
2554  launcher::register [make_menu_cmd "View" [msgcat::mc "Goto previous tab"]] [list menus::main_only gui::previous_tab]
2555 
2556  $mb.tabPopup add command -label [msgcat::mc "Goto Last Tab"] -underline 5 -command [list menus::main_only gui::last_tab]
2557  launcher::register [make_menu_cmd "View" [msgcat::mc "Goto last tab"]] [list menus::main_only gui::last_tab]
2558 
2559  $mb.tabPopup add command -label [msgcat::mc "Goto Other Pane"] -underline 11 -command [list menus::main_only gui::next_pane]
2560  launcher::register [make_menu_cmd "View" [msgcat::mc "Goto other pane"]] [list menus::main_only gui::next_pane]
2561 
2562  $mb.tabPopup add separator
2563 
2564  $mb.tabPopup add command -label [msgcat::mc "Sort Tabs"] -underline 0 -command [list menus::main_only gui::sort_tabs]
2565  launcher::register [make_menu_cmd "View" [msgcat::mc "Sort tabs"]] [list menus::main_only gui::sort_tabs]
2566 
2567  $mb.tabPopup add separator
2568 
2569  $mb.tabPopup add command -label [msgcat::mc "Hide Current Tab"] -underline 5 -command [list menus::main_only gui::hide_current]
2570  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide Current Tab"]] [list menus::main_only gui::hide_current]
2571 
2572  $mb.tabPopup add command -label [msgcat::mc "Hide All Tabs"] -underline 5 -command [list menus::main_only gui::hide_all]
2573  launcher::register [make_menu_cmd "View" [msgcat::mc "Hide All Tabs"]] [list menus::main_only gui::hide_all]
2574 
2575  $mb.tabPopup add command -label [msgcat::mc "Show All Tabs"] -underline 0 -command [list menus::main_only gui::show_all]
2576  launcher::register [make_menu_cmd "View" [msgcat::mc "Show All Tabs"]] [list menus::main_only gui::show_all]
2577 
2578  # Setup the folding popup menu
2579  $mb.foldPopup add checkbutton -label [msgcat::mc "Enable Code Folding"] -variable menus::code_folding -command [list menus::main_only menus::set_code_folding]
2580  launcher::register [make_menu_cmd "View" [msgcat::mc "Enable code folding"]] [list menus::main_only menus::set_code_folding 1]
2581  launcher::register [make_menu_cmd "View" [msgcat::mc "Disable code folding"]] [list menus::main_only menus::set_code_folding 0]
2582 
2583  $mb.foldPopup add separator
2584 
2585  $mb.foldPopup add command -label [msgcat::mc "Create Fold From Selection"] -command [list menus::text_only menus::add_fold_from_selection]
2586  launcher::register [make_menu_cmd "View" [msgcat::mc "Create fold from selection"]] [list menus::text_only menus::add_fold_from_selection]
2587 
2588  $mb.foldPopup add separator
2589 
2590  $mb.foldPopup add command -label [msgcat::mc "Delete Current Fold"] -command [list menus::text_only menus::delete_folds current]
2591  launcher::register [make_menu_cmd "View" [msgcat::mc "Delete fold at current line"]] [list menus::text_only menus::delete_folds current]
2592 
2593  $mb.foldPopup add command -label [msgcat::mc "Delete Selected Folds"] -command [list menus::text_only menus::delete_folds selected]
2594  launcher::register [make_menu_cmd "View" [msgcat::mc "Delete all selected folds"]] [list menus::text_only menus::delete_folds selected]
2595 
2596  $mb.foldPopup add command -label [msgcat::mc "Delete All Folds"] -command [list menus::text_only menus::delete_folds all]
2597  launcher::register [make_menu_cmd "View" [msgcat::mc "Delete all folds"]] [list menus::text_only menus::delete_folds all]
2598 
2599  $mb.foldPopup add separator
2600 
2601  $mb.foldPopup add cascade -label [msgcat::mc "Close Current Fold"] -menu [make_menu $mb.fcloseCurrPopup -tearoff 0]
2602 
2603  $mb.foldPopup add cascade -label [msgcat::mc "Close Selected Folds"] -menu [make_menu $mb.fcloseSelPopup -tearoff 0]
2604 
2605  $mb.foldPopup add command -label [msgcat::mc "Close All Folds"] -command [list menus::text_only menus::close_folds all]
2606  launcher::register [make_menu_cmd "View" [msgcat::mc "Close all folds"]] [list menus::text_only menus::close_folds all]
2607 
2608  $mb.foldPopup add separator
2609 
2610  $mb.foldPopup add cascade -label [msgcat::mc "Open Current Fold"] -menu [make_menu $mb.fopenCurrPopup -tearoff 0]
2611 
2612  $mb.foldPopup add cascade -label [msgcat::mc "Open Selected Folds"] -menu [make_menu $mb.fopenSelPopup -tearoff 0]
2613 
2614  $mb.foldPopup add command -label [msgcat::mc "Open All Folds"] -command [list menus::text_only menus::open_folds all]
2615  launcher::register [make_menu_cmd "View" [msgcat::mc "Open all folds"]] [list menus::text_only menus::open_folds all]
2616 
2617  $mb.foldPopup add separator
2618 
2619  $mb.foldPopup add command -label [msgcat::mc "Show Cursor"] -command [list menus::text_only menus::open_folds show]
2620  launcher::register [make_menu_cmd "View" [msgcat::mc "Open folds to show cursor"]] [list menus::text_only menus::open_folds show]
2621 
2622  $mb.foldPopup add separator
2623 
2624  $mb.foldPopup add command -label [msgcat::mc "Jump to Next Fold Mark"] -command [list menus::text_only menus::jump_to_fold next]
2625  launcher::register [make_menu_cmd "View" [msgcat::mc "Jump to the next fold indicator"]] [list menus::text_only menus::jump_to_fold next]
2626 
2627  $mb.foldPopup add command -label [msgcat::mc "Jump to Previous Fold Mark"] -command [list menus::text_only menus::jump_to_fold prev]
2628  launcher::register [make_menu_cmd "View" [msgcat::mc "Jump to the previous fold indicator"]] [list menus::text_only menus::jump_to_fold prev]
2629 
2630  # Setup the folding close current popup menu
2631  $mb.fcloseCurrPopup add command -label [msgcat::mc "One Level"] -command [list menus::text_only menus::close_folds current 1]
2632  $mb.fcloseCurrPopup add command -label [msgcat::mc "All Levels"] -command [list menus::text_only menus::close_folds current 0]
2633 
2634  launcher::register [make_menu_cmd "View" [msgcat::mc "Close fold at current line - one level"]] [list menus::text_only menus::close_folds current 1]
2635  launcher::register [make_menu_cmd "View" [msgcat::mc "Close fold at current line - all levels"]] [list menus::text_only menus::close_folds current 0]
2636 
2637  # Setup the folding close selected popup menu
2638  $mb.fcloseSelPopup add command -label [msgcat::mc "One Level"] -command [list menus::text_only menus::close_folds selected 1]
2639  $mb.fcloseSelPopup add command -label [msgcat::mc "All Levels"] -command [list menus::text_only menus::close_folds selected 0]
2640 
2641  launcher::register [make_menu_cmd "View" [msgcat::mc "Close selected folds - one level"]] [list menus::text_only menus::close_folds selected 1]
2642  launcher::register [make_menu_cmd "View" [msgcat::mc "Close selected folds - all levels"]] [list menus::text_only menus::close_folds selected 0]
2643 
2644  # Setup the folding open current popup menu
2645  $mb.fopenCurrPopup add command -label [msgcat::mc "One Level"] -command [list menus::text_only menus::open_folds current 1]
2646  $mb.fopenCurrPopup add command -label [msgcat::mc "All Levels"] -command [list menus::text_only menus::open_folds current 0]
2647 
2648  launcher::register [make_menu_cmd "View" [msgcat::mc "Open fold at current line - one level"]] [list menus::text_only menus::open_folds current 1]
2649  launcher::register [make_menu_cmd "View" [msgcat::mc "Open fold at current line - all levels"]] [list menus::text_only menus::open_folds current 0]
2650 
2651  # Setup the folding open selected popup menu
2652  $mb.fopenSelPopup add command -label [msgcat::mc "One Level"] -command [list menus::text_only menus::open_folds selected 1]
2653  $mb.fopenSelPopup add command -label [msgcat::mc "All Levels"] -command [list menus::text_only menus::open_folds selected 0]
2654 
2655  launcher::register [make_menu_cmd "View" [msgcat::mc "Open selected folds - one level"]] [list menus::text_only menus::open_folds selected 1]
2656  launcher::register [make_menu_cmd "View" [msgcat::mc "Open selected folds - all levels"]] [list menus::text_only menus::open_folds selected 0]
2657 
2658  }

§ change_working_directory()

menus::change_working_directory

Definition at line 752 of file menus.tcl.

752  proc change_working_directory {} {
753 
754  if {[set dir [tk_chooseDirectory -parent . -initialdir [gui::get_browse_directory] -mustexist 1]] ne ""} {
756  }
757 
758  }

§ check_for_update()

menus::check_for_update

Definition at line 3611 of file menus.tcl.

3611  proc check_for_update {} {
3612 
3613  if {[preferences::get General/UpdateReleaseType] eq "devel"} {
3614  specl::check_for_update 0 [expr $specl::RTYPE_STABLE | $specl::RTYPE_DEVEL] -title [msgcat::mc "TKE Updater"] -cleanup_script menus::exit_cleanup
3615  } else {
3616  specl::check_for_update 0 $specl::RTYPE_STABLE -title [msgcat::mc "TKE Updater"] -cleanup_script menus::exit_cleanup
3617  }
3618 
3619  }

§ clear_last_opened()

menus::clear_last_opened

Definition at line 630 of file menus.tcl.

630  proc clear_last_opened {} {
631 
634 
635  }

§ close_all_command()

menus::close_all_command

Definition at line 1049 of file menus.tcl.

1049  proc close_all_command {} {
1050 
1051  gui::close_all -force 1
1052 
1053  }

§ close_command()

menus::close_command

Definition at line 1041 of file menus.tcl.

1041  proc close_command {} {
1042 
1044 
1045  }

§ close_folds()

menus::close_folds   type ?depth?  

Definition at line 3059 of file menus.tcl.

3059  proc close_folds {type {depth 0}} {
3060 
3061  set txt [gui::current_txt]
3062 
3063  switch $type {
3064  current { folding::close_fold $depth $txt [lindex [split [$txt index insert] .] 0]}
3065  all { folding::close_all_folds $txt}
3066  selected {
3067  foreach {startpos endpos} [$txt tag ranges sel] {
3068  set startline [lindex [split $startpos .] 0]
3069  set endline [lindex [split $endpos .] 0]
3070  folding::close_folds_in_range $txt $startline $endline $depth
3071  }
3072  }
3073  }
3074 
3075  }

§ create()

menus::create

Definition at line 250 of file menus.tcl.

250  proc create {} {
251 
252  set foreground [utils::get_default_foreground]
253  set background [utils::get_default_background]
254 
255  set mb [menu .menubar -foreground $foreground -background $background -relief flat -tearoff false]
256 
257  # Add the file menu
258  $mb add cascade -label [msgcat::mc "File"] -menu [make_menu $mb.file -tearoff false -postcommand "menus::file_posting $mb.file"]
259  add_file $mb.file
260 
261  # Add the edit menu
262  $mb add cascade -label [msgcat::mc "Edit"] -menu [make_menu $mb.edit -tearoff false -postcommand "menus::edit_posting $mb.edit"]
263  add_edit $mb.edit
264 
265  # Add the find menu
266  $mb add cascade -label [msgcat::mc "Find"] -menu [make_menu $mb.find -tearoff false -postcommand "menus::find_posting $mb.find"]
267  add_find $mb.find
268 
269  # Add the view menu
270  $mb add cascade -label [msgcat::mc "View"] -menu [make_menu $mb.view -tearoff false -postcommand "menus::view_posting $mb.view"]
271  add_view $mb.view
272 
273  # Add the tools menu
274  $mb add cascade -label [msgcat::mc "Tools"] -menu [make_menu $mb.tools -tearoff false -postcommand "menus::tools_posting $mb.tools"]
275  add_tools $mb.tools
276 
277  # Add the sessions menu
278  $mb add cascade -label [msgcat::mc "Sessions"] -menu [make_menu $mb.sessions -tearoff false -postcommand "menus::sessions_posting $mb.sessions"]
279  add_sessions $mb.sessions
280 
281  # Add the plugins menu
282  $mb add cascade -label [msgcat::mc "Plugins"] -menu [make_menu $mb.plugins -tearoff false -postcommand "menus::plugins_posting $mb.plugins"]
283  add_plugins $mb.plugins
284 
285  # If we are running on Mac OS X, add the window menu with the windowlist package
286  if {[tk windowingsystem] eq "aqua"} {
287 
288  # Add the window menu with the windowlist package
290 
291  # Add the launcher command to show the about window
292  launcher::register [make_menu_cmd "Help" [format "%s %s" [msgcat::mc "About"] "TKE"]] gui::show_about
293 
294  }
295 
296  # Add the help menu
297  $mb add cascade -label [msgcat::mc "Help"] -menu [make_menu $mb.help -tearoff false -postcommand "menus::help_posting $mb.help"]
298  add_help $mb.help
299 
300  if {([tk windowingsystem] eq "aqua") || [preferences::get View/ShowMenubar]} {
301  . configure -menu $mb
302  }
303 
304  # Handle the default development mode
306 
307  # Load and apply the menu bindings
309 
310  # Register the menubar for theming purposes if we are running on MacOSX
311  if {[tk windowingsystem] ne "aqua"} {
312  theme::register_widget $mb menus
313  }
314 
315  }

§ delete_command()

menus::delete_command

Definition at line 926 of file menus.tcl.

926  proc delete_command {} {
927 
928  # Get the full pathname
929  gui::get_info {} current fname remote
930 
931  # Get confirmation from the user
932  if {[tk_messageBox -parent . -type yesno -default yes -message [format "%s %s?" [msgcat::mc "Delete"] $fname]] eq "yes"} {
933 
934  # Delete the file
935  if {[catch { files::delete_file $fname $remote} rc]} {
936  gui::set_error_message [msgcat::mc "Unable to delete file"] $rc
937  return
938  }
939 
940  # Update the old directory
941  if {[set sidebar_index [sidebar::get_index [file dirname $fname] $remote]] ne ""} {
942  sidebar::update_directory $sidebar_index
943  }
944 
945  }
946 
947  }

§ delete_folds()

menus::delete_folds   type  

Definition at line 3035 of file menus.tcl.

3035  proc delete_folds {type} {
3036 
3037  set txt [gui::current_txt]
3038 
3039  switch $type {
3040  current { folding::delete_fold $txt [lindex [split [$txt index insert] .] 0]}
3041  all { folding::delete_all_folds $txt}
3042  selected {
3043  foreach {startpos endpos} [$txt tag ranges sel] {
3044  set startline [lindex [split $startpos .] 0]
3045  set endline [lindex [split $endpos .] 0]
3046  folding::delete_folds_in_range $txt $startline $endline
3047  }
3048  }
3049  }
3050 
3051  }

§ delete_session_language()

menus::delete_session_language

Definition at line 2215 of file menus.tcl.

2215  proc delete_session_language {} {
2216 
2217  set message [msgcat::mc "Delete session language preferences?"]
2218  set detail [msgcat::mc "All language-specific settings for the current session will be removed and the global settings will be applied for the specified language."]
2219 
2220  if {[tk_messageBox -parent . -type yesno -default no -message $message -detail $detail] eq "yes"} {
2222  }
2223 
2224  }

§ delete_user_language()

menus::delete_user_language

Definition at line 2186 of file menus.tcl.

2186  proc delete_user_language {} {
2187 
2188  set message [msgcat::mc "Delete language preferences?"]
2189  set detail [msgcat::mc "All language-specific settings will be removed and the global settings will be applied for the specified language."]
2190 
2191  if {[tk_messageBox -parent . -type yesno -default no -message $message -detail $detail] eq "yes"} {
2193  }
2194 
2195  }

§ display_text_info()

menus::display_text_info

Definition at line 2988 of file menus.tcl.

2988  proc display_text_info {} {
2989 
2991 
2992  }

§ duplicate_command()

menus::duplicate_command

Definition at line 902 of file menus.tcl.

902  proc duplicate_command {} {
903 
904  # Get the filename of the current selection
905  gui::get_info {} current fname remote
906 
907  # Create the default name of the duplicate file
908  if {[catch { files::duplicate_file $fname $remote} dup_fname]} {
909  gui::set_error_message "Unable to duplicate file" $dup_fname
910  return
911  }
912 
913  # Add the file to the editor
914  gui::add_file end $dup_fname -remote $remote
915 
916  # Update the old directory
917  if {[set sidebar_index [sidebar::get_index [file dirname $dup_fname] $remote]] ne ""} {
918  sidebar::update_directory $sidebar_index
919  }
920 
921  }

§ edit_cursor_move()

menus::edit_cursor_move   modifier args  

Definition at line 1979 of file menus.tcl.

1979  proc edit_cursor_move {modifier args} {
1980 
1981  # Get the current text widget
1982  set txtt [gui::current_txt].t
1983 
1984  # Move the cursor if we are not in multicursor mode
1985  if {![multicursor::enabled $txtt]} {
1986  edit::move_cursor $txtt $modifier {*}$args
1987  }
1988 
1989  }

§ edit_cursor_move_by_page()

menus::edit_cursor_move_by_page   dir  

Definition at line 1994 of file menus.tcl.

1994  proc edit_cursor_move_by_page {dir} {
1995 
1996  # Get the current text widget
1997  set txtt [gui::current_txt].t
1998 
1999  # Move the cursor if we are not in multicursor mode
2000  if {![multicursor::enabled $txtt]} {
2001  edit::move_cursor_by_page $txtt $dir
2002  }
2003 
2004  }

§ edit_cursor_posting()

menus::edit_cursor_posting   mb  

Definition at line 1692 of file menus.tcl.

1692  proc edit_cursor_posting {mb} {
1693 
1694  set mstate "disabled"
1695  set sstate "disabled"
1696 
1697  # Get the current text widget
1698  if {[set txt [gui::current_txt]] ne ""} {
1699  if {[multicursor::enabled $txt]} {
1700  set mstate "normal"
1701  } else {
1702  set sstate "normal"
1703  }
1704  }
1705 
1706  $mb entryconfigure [msgcat::mc "Move to First Line"] -state $sstate
1707  $mb entryconfigure [msgcat::mc "Move to Last Line"] -state $sstate
1708  $mb entryconfigure [msgcat::mc "Move to Next Page"] -state $sstate
1709  $mb entryconfigure [msgcat::mc "Move to Previous Page"] -state $sstate
1710  $mb entryconfigure [msgcat::mc "Move to Screen Top"] -state $sstate
1711  $mb entryconfigure [msgcat::mc "Move to Screen Middle"] -state $sstate
1712  $mb entryconfigure [msgcat::mc "Move to Screen Bottom"] -state $sstate
1713  $mb entryconfigure [msgcat::mc "Move to Line Start"] -state $sstate
1714  $mb entryconfigure [msgcat::mc "Move to Line End"] -state $sstate
1715  $mb entryconfigure [msgcat::mc "Move to Next Word"] -state $sstate
1716  $mb entryconfigure [msgcat::mc "Move to Previous Word"] -state $sstate
1717 
1718  $mb entryconfigure [msgcat::mc "Move Cursors Up"] -state $mstate
1719  $mb entryconfigure [msgcat::mc "Move Cursors Down"] -state $mstate
1720  $mb entryconfigure [msgcat::mc "Move Cursors Left"] -state $mstate
1721  $mb entryconfigure [msgcat::mc "Move Cursors Right"] -state $mstate
1722  $mb entryconfigure [msgcat::mc "Align Cursors Only"] -state $mstate
1723  $mb entryconfigure [msgcat::mc "Align Cursors and Text"] -state $mstate
1724 
1725  }

§ edit_cursors_move()

menus::edit_cursors_move   modifier  

Definition at line 2008 of file menus.tcl.

2008  proc edit_cursors_move {modifier} {
2009 
2010  # Get the current text widget
2011  set txtt [gui::current_txt].t
2012 
2013  # If we are in multicursor mode, move the cursors in the direction given by modifier
2014  if {[multicursor::enabled $txtt]} {
2015  edit::move_cursors $txtt $modifier
2016  }
2017 
2018  }

§ edit_emmet_posting()

menus::edit_emmet_posting   mb  

Definition at line 1882 of file menus.tcl.

1882  proc edit_emmet_posting {mb} {
1883 
1884  if {[catch { gui::get_info {} current txt lang}]} {
1885 
1886  $mb entryconfigure [msgcat::mc "Expand Abbreviation"] -state disabled
1887  $mb entryconfigure [msgcat::mc "Wrap With Abbreviation"] -state disabled
1888  $mb entryconfigure [msgcat::mc "Balance Outward"] -state disabled
1889  $mb entryconfigure [msgcat::mc "Balance Inward"] -state disabled
1890  $mb entryconfigure [msgcat::mc "Go to Matching Pair"] -state disabled
1891  $mb entryconfigure [msgcat::mc "Toggle Comment"] -state disabled
1892  $mb entryconfigure [msgcat::mc "Split/Join Tag"] -state disabled
1893  $mb entryconfigure [msgcat::mc "Remove Tag"] -state disabled
1894  $mb entryconfigure [msgcat::mc "Merge Lines"] -state disabled
1895  $mb entryconfigure [msgcat::mc "Update Image Size"] -state disabled
1896  $mb entryconfigure [msgcat::mc "Encode/Decode Image to Data:URL"] -state disabled
1897  $mb entryconfigure [msgcat::mc "Reflect CSS Value"] -state disabled
1898  $mb entryconfigure [msgcat::mc "Next Edit Point"] -state disabled
1899  $mb entryconfigure [msgcat::mc "Previous Edit Point"] -state disabled
1900  $mb entryconfigure [msgcat::mc "Select Next Item"] -state disabled
1901  $mb entryconfigure [msgcat::mc "Select Previous Item"] -state disabled
1902  $mb entryconfigure [msgcat::mc "Evaluate Math Expression"] -state disabled
1903  $mb entryconfigure [msgcat::mc "Increment by 10"] -state disabled
1904  $mb entryconfigure [msgcat::mc "Increment by 1"] -state disabled
1905  $mb entryconfigure [msgcat::mc "Increment by 0.1"] -state disabled
1906  $mb entryconfigure [msgcat::mc "Decrement by 10"] -state disabled
1907  $mb entryconfigure [msgcat::mc "Decrement by 1"] -state disabled
1908  $mb entryconfigure [msgcat::mc "Decrement by 0.1"] -state disabled
1909 
1910  } else {
1911 
1912  set intag [emmet::inside_tag $txt -allow010 1]
1913  set innode [emmet::get_node_range $txt]
1914  set inurl [emmet_css::in_url $txt]
1915  set intag_mode [expr {($intag eq "") ? "disabled" : "normal"}]
1916  set innode_mode [expr {($innode eq "") ? "disabled" : "normal"}]
1917  set inurl_mode [expr {$inurl ? "normal" : "disabled"}]
1918  set sel_mode [expr {([llength [$txt tag ranges sel]] == 2) ? "normal" : $intag_mode}]
1919  set html_mode [expr {($lang eq "HTML") ? "normal" : "disabled"}]
1920  set css_mode [expr {($lang eq "CSS") ? "normal" : "disabled"}]
1921  set html_or_css [expr {(($lang eq "HTML") || ($lang eq "CSS")) ? "normal" : "disabled"}]
1922  set url_mode [expr {($lang eq "HTML") ? $intag_mode : $inurl_mode}]
1923 
1924  $mb entryconfigure [msgcat::mc "Expand Abbreviation"] -state normal
1925  $mb entryconfigure [msgcat::mc "Wrap With Abbreviation"] -state $sel_mode
1926  $mb entryconfigure [msgcat::mc "Balance Outward"] -state $intag_mode
1927  $mb entryconfigure [msgcat::mc "Balance Inward"] -state $intag_mode
1928  $mb entryconfigure [msgcat::mc "Go to Matching Pair"] -state $intag_mode
1929  $mb entryconfigure [msgcat::mc "Toggle Comment"] -state $html_or_css
1930  $mb entryconfigure [msgcat::mc "Split/Join Tag"] -state $innode_mode
1931  $mb entryconfigure [msgcat::mc "Remove Tag"] -state $intag_mode
1932  $mb entryconfigure [msgcat::mc "Merge Lines"] -state $innode_mode
1933  $mb entryconfigure [msgcat::mc "Update Image Size"] -state $url_mode
1934  $mb entryconfigure [msgcat::mc "Encode/Decode Image to Data:URL"] -state $url_mode
1935  $mb entryconfigure [msgcat::mc "Reflect CSS Value"] -state $css_mode
1936  $mb entryconfigure [msgcat::mc "Next Edit Point"] -state $html_mode
1937  $mb entryconfigure [msgcat::mc "Previous Edit Point"] -state $html_mode
1938  $mb entryconfigure [msgcat::mc "Select Next Item"] -state $html_or_css
1939  $mb entryconfigure [msgcat::mc "Select Previous Item"] -state $html_or_css
1940  $mb entryconfigure [msgcat::mc "Evaluate Math Expression"] -state normal
1941  $mb entryconfigure [msgcat::mc "Increment by 10"] -state normal
1942  $mb entryconfigure [msgcat::mc "Increment by 1"] -state normal
1943  $mb entryconfigure [msgcat::mc "Increment by 0.1"] -state normal
1944  $mb entryconfigure [msgcat::mc "Decrement by 10"] -state normal
1945  $mb entryconfigure [msgcat::mc "Decrement by 1"] -state normal
1946  $mb entryconfigure [msgcat::mc "Decrement by 0.1"] -state normal
1947 
1948  }
1949 
1950  }

§ edit_format()

menus::edit_format   type  

Definition at line 2151 of file menus.tcl.

2151  proc edit_format {type} {
2152 
2153  # Perform the editing
2154  edit::format [gui::current_txt].t $type
2155 
2156  }

§ edit_format_posting()

menus::edit_format_posting   mb  

Definition at line 1789 of file menus.tcl.

1789  proc edit_format_posting {mb} {
1790 
1791  set txt [gui::get_info {} current txt]
1792 
1793  # Place the contents of the formatting information in the array
1794  array set formatting [syntax::get_formatting $txt]
1795 
1796  $mb entryconfigure [msgcat::mc "Bold"] -state [expr {[info exists formatting(bold)] ? "normal" : "disabled"}]
1797  $mb entryconfigure [msgcat::mc "Italics"] -state [expr {[info exists formatting(italics)] ? "normal" : "disabled"}]
1798  $mb entryconfigure [msgcat::mc "Underline"] -state [expr {[info exists formatting(underline)] ? "normal" : "disabled"}]
1799  $mb entryconfigure [msgcat::mc "Strikethrough"] -state [expr {[info exists formatting(strikethrough)] ? "normal" : "disabled"}]
1800  $mb entryconfigure [msgcat::mc "Highlight"] -state [expr {[info exists formatting(highlight)] ? "normal" : "disabled"}]
1801  $mb entryconfigure [msgcat::mc "Superscript"] -state [expr {[info exists formatting(superscript)] ? "normal" : "disabled"}]
1802  $mb entryconfigure [msgcat::mc "Subscript"] -state [expr {[info exists formatting(subscript)] ? "normal" : "disabled"}]
1803  $mb entryconfigure [msgcat::mc "Code"] -state [expr {[info exists formatting(code)] ? "normal" : "disabled"}]
1804  $mb entryconfigure [format "%s 1" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header1)] ? "normal" : "disabled"}]
1805  $mb entryconfigure [format "%s 2" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header2)] ? "normal" : "disabled"}]
1806  $mb entryconfigure [format "%s 3" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header3)] ? "normal" : "disabled"}]
1807  $mb entryconfigure [format "%s 4" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header4)] ? "normal" : "disabled"}]
1808  $mb entryconfigure [format "%s 5" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header5)] ? "normal" : "disabled"}]
1809  $mb entryconfigure [format "%s 6" [msgcat::mc "Header"]] -state [expr {[info exists formatting(header6)] ? "normal" : "disabled"}]
1810  $mb entryconfigure [msgcat::mc "Unordered Bullet"] -state [expr {[info exists formatting(unordered)] ? "normal" : "disabled"}]
1811  $mb entryconfigure [msgcat::mc "Ordered Bullet"] -state [expr {[info exists formatting(ordered)] ? "normal" : "disabled"}]
1812  $mb entryconfigure [msgcat::mc "Checkbox"] -state [expr {[info exists formatting(checkbox)] ? "normal" : "disabled"}]
1813  $mb entryconfigure [msgcat::mc "Link"] -state [expr {[info exists formatting(link)] ? "normal" : "disabled"}]
1814  $mb entryconfigure [msgcat::mc "Image"] -state [expr {[info exists formatting(image)] ? "normal" : "disabled"}]
1815 
1816  }

§ edit_format_remove()

menus::edit_format_remove

Definition at line 2160 of file menus.tcl.

2160  proc edit_format_remove {} {
2161 
2162  # Unapply any formatting found in the selected text
2164 
2165  }

§ edit_indent_posting()

menus::edit_indent_posting   mb  

Definition at line 1669 of file menus.tcl.

1669  proc edit_indent_posting {mb} {
1670 
1671  variable indent_mode
1672 
1673  set state "disabled"
1674 
1675  # Set the indentation mode for the current editor
1676  if {[set txt [gui::current_txt]] ne ""} {
1677  set indent_mode [indent::get_indent_mode $txt]
1678  set state "normal"
1679  }
1680 
1681  $mb entryconfigure [msgcat::mc "Unindent"] -state $state
1682  $mb entryconfigure [msgcat::mc "Indent"] -state $state
1683  $mb entryconfigure [msgcat::mc "Indent Off"] -state $state
1684  $mb entryconfigure [msgcat::mc "Auto-Indent"] -state $state
1685  $mb entryconfigure [msgcat::mc "Smart Indent"] -state $state
1686 
1687  }

§ edit_insert_command_after_current_line()

menus::edit_insert_command_after_current_line

Definition at line 2051 of file menus.tcl.

2051  proc edit_insert_command_after_current_line {} {
2052 
2053  set cmd ""
2054 
2055  if {[gui::get_user_response [format "%s:" [msgcat::mc "Command"]] cmd -allow_vars 1]} {
2057  }
2058 
2059  }

§ edit_insert_file_after_current_line()

menus::edit_insert_file_after_current_line

Definition at line 2039 of file menus.tcl.

2039  proc edit_insert_file_after_current_line {} {
2040 
2041  if {[set fname [tk_getOpenFile -parent . -initialdir [gui::get_browse_directory] -multiple 1]] ne ""} {
2044  }
2045 
2046  }

§ edit_insert_line_above()

menus::edit_insert_line_above

Definition at line 2022 of file menus.tcl.

2022  proc edit_insert_line_above {} {
2023 
2025 
2026  }

§ edit_insert_line_below()

menus::edit_insert_line_below

Definition at line 2030 of file menus.tcl.

2030  proc edit_insert_line_below {} {
2031 
2033 
2034  }

§ edit_insert_posting()

menus::edit_insert_posting   mb  

Definition at line 1730 of file menus.tcl.

1730  proc edit_insert_posting {mb} {
1731 
1732  set tstate "disabled"
1733  set mstate "disabled"
1734 
1735  if {[set txt [gui::current_txt]] ne ""} {
1736  set tstate "normal"
1737  if {[multicursor::enabled $txt]} {
1738  set mstate "normal"
1739  }
1740  }
1741 
1742  $mb entryconfigure [msgcat::mc "Line Above Current"] -state $tstate
1743  $mb entryconfigure [msgcat::mc "Line Below Current"] -state $tstate
1744  $mb entryconfigure [msgcat::mc "File Contents"] -state $tstate
1745  $mb entryconfigure [msgcat::mc "Command Result"] -state $tstate
1746 
1747  if {[llength [cliphist::get_history]] > 0} {
1748  $mb entryconfigure [msgcat::mc "From Clipboard"] -state normal
1749  } else {
1750  $mb entryconfigure [msgcat::mc "From Clipboard"] -state disabled
1751  }
1752 
1753  if {[llength [snippets::get_current_snippets]] > 0} {
1754  $mb entryconfigure [msgcat::mc "Snippet"] -state normal
1755  } else {
1756  $mb entryconfigure [msgcat::mc "Snippet"] -state disabled
1757  }
1758 
1759  $mb entryconfigure [msgcat::mc "Enumeration"] -state $mstate
1760 
1761  }

§ edit_posting()

menus::edit_posting   mb  

Definition at line 1583 of file menus.tcl.

1583  proc edit_posting {mb} {
1584 
1585  if {[catch { gui::get_info {} current txt readonly diff}]} {
1586  $mb entryconfigure [msgcat::mc "Undo"] -state disabled
1587  $mb entryconfigure [msgcat::mc "Redo"] -state disabled
1588  $mb entryconfigure [msgcat::mc "Cut"] -state disabled
1589  $mb entryconfigure [msgcat::mc "Copy"] -state disabled
1590  $mb entryconfigure [msgcat::mc "Paste"] -state disabled
1591  $mb entryconfigure [msgcat::mc "Paste and Format"] -state disabled
1592  $mb entryconfigure [msgcat::mc "Select Mode"] -state disabled
1593  $mb entryconfigure [msgcat::mc "Vim Mode"] -state disabled
1594  $mb entryconfigure [msgcat::mc "Toggle Comment"] -state disabled
1595  $mb entryconfigure [msgcat::mc "Indentation"] -state disabled
1596  $mb entryconfigure [msgcat::mc "Cursor"] -state disabled
1597  $mb entryconfigure [msgcat::mc "Insert"] -state disabled
1598  $mb entryconfigure [msgcat::mc "Transform"] -state disabled
1599  $mb entryconfigure [msgcat::mc "Format"] -state disabled
1600  } else {
1601  set readonly_state [expr {($readonly || $diff) ? "disabled" : "normal"}]
1602  if {[gui::undoable]} {
1603  $mb entryconfigure [msgcat::mc "Undo"] -state $readonly_state
1604  } else {
1605  $mb entryconfigure [msgcat::mc "Undo"] -state disabled
1606  }
1607  if {[gui::redoable]} {
1608  $mb entryconfigure [msgcat::mc "Redo"] -state $readonly_state
1609  } else {
1610  $mb entryconfigure [msgcat::mc "Redo"] -state disabled
1611  }
1612  $mb entryconfigure [msgcat::mc "Cut"] -state $readonly_state
1613  $mb entryconfigure [msgcat::mc "Copy"] -state normal
1614  if {[gui::pastable]} {
1615  $mb entryconfigure [msgcat::mc "Paste"] -state $readonly_state
1616  $mb entryconfigure [msgcat::mc "Paste and Format"] -state $readonly_state
1617  } else {
1618  $mb entryconfigure [msgcat::mc "Paste"] -state disabled
1619  $mb entryconfigure [msgcat::mc "Paste and Format"] -state disabled
1620  }
1621  $mb entryconfigure [msgcat::mc "Select Mode"] -state normal
1622  $mb entryconfigure [msgcat::mc "Vim Mode"] -state $readonly_state
1623  if {[lindex [syntax::get_comments [gui::current_txt]] 0] eq ""} {
1624  $mb entryconfigure [msgcat::mc "Toggle Comment"] -state disabled
1625  } else {
1626  $mb entryconfigure [msgcat::mc "Toggle Comment"] -state $readonly_state
1627  }
1628  $mb entryconfigure [msgcat::mc "Indentation"] -state $readonly_state
1629  $mb entryconfigure [msgcat::mc "Cursor"] -state $readonly_state
1630  if {[gui::editable]} {
1631  $mb entryconfigure [msgcat::mc "Insert"] -state $readonly_state
1632  $mb entryconfigure [msgcat::mc "Transform"] -state $readonly_state
1633  } else {
1634  $mb entryconfigure [msgcat::mc "Insert"] -state disabled
1635  $mb entryconfigure [msgcat::mc "Transform"] -state disabled
1636  }
1637  if {[gui::editable] && ([llength [syntax::get_formatting $txt]] > 0)} {
1638  $mb entryconfigure [msgcat::mc "Format"] -state $readonly_state
1639  } else {
1640  $mb entryconfigure [msgcat::mc "Format"] -state disabled
1641  }
1642  }
1643 
1644  }

§ edit_preferences_posting()

menus::edit_preferences_posting   mb  

Definition at line 1821 of file menus.tcl.

1821  proc edit_preferences_posting {mb} {
1822 
1823  if {[set txt [gui::current_txt]] eq ""} {
1824  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit User"] [msgcat::mc "Language"]] -state disabled
1825  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete User"] [msgcat::mc "Language"]] -state disabled
1826  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Language"]] -state disabled
1827  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete Session"] [msgcat::mc "Language"]] -state disabled
1828  } else {
1829  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit User"] [msgcat::mc "Language"]] -state normal
1831  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete User"] [msgcat::mc "Language"]] -state normal
1832  } else {
1833  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete User"] [msgcat::mc "Language"]] -state disabled
1834  }
1835  if {[set session [sessions::current]] eq ""} {
1836  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Global"]] -state disabled
1837  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Language"]] -state disabled
1838  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete Session"] [msgcat::mc "Language"]] -state disabled
1839  } else {
1840  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Global"]] -state normal
1841  $mb entryconfigure [format "%s - %s" [msgcat::mc "Edit Session"] [msgcat::mc "Language"]] -state normal
1842  if {[preferences::language_exists $session [syntax::get_language $txt]]} {
1843  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete Session"] [msgcat::mc "Language"]] -state normal
1844  } else {
1845  $mb entryconfigure [format "%s - %s" [msgcat::mc "Delete Session"] [msgcat::mc "Language"]] -state disabled
1846  }
1847  }
1848  }
1849 
1850  }

§ edit_select_posting()

menus::edit_select_posting   mb  

Definition at line 1649 of file menus.tcl.

1649  proc edit_select_posting {mb} {
1650 
1651  set txt [gui::current_txt]
1652  set state [expr {($txt eq "") ? "disabled" : "normal"}]
1653  set sel_state [expr {(($txt eq "") || ([$txt tag ranges sel] eq "")) ? "disabled" : "normal"}]
1654 
1655  $mb entryconfigure [msgcat::mc "All"] -state $state
1656  $mb entryconfigure [msgcat::mc "Current Line"] -state $state
1657  $mb entryconfigure [msgcat::mc "Current Word"] -state $state
1658  $mb entryconfigure [msgcat::mc "Current Sentence"] -state $state
1659  $mb entryconfigure [msgcat::mc "Current Paragraph"] -state $state
1660  $mb entryconfigure [msgcat::mc "Current Bounded Text"] -state $state
1661  $mb entryconfigure [msgcat::mc "Add Next Line"] -state $sel_state
1662  $mb entryconfigure [msgcat::mc "Add Previous Line"] -state $sel_state
1663 
1664  }

§ edit_session_global()

menus::edit_session_global

Definition at line 2199 of file menus.tcl.

2199  proc edit_session_global {} {
2200 
2202 
2203  }

§ edit_session_language()

menus::edit_session_language

Definition at line 2207 of file menus.tcl.

2207  proc edit_session_language {} {
2208 
2210 
2211  }

§ edit_snippets_posting()

menus::edit_snippets_posting   mb  

Definition at line 1855 of file menus.tcl.

1855  proc edit_snippets_posting {mb} {
1856 
1857  $mb entryconfigure [msgcat::mc "Edit User"] -state normal
1858 
1859  if {[gui::current_txt] eq ""} {
1860  $mb entryconfigure [msgcat::mc "Edit Language"] -state disabled
1861  } else {
1862  $mb entryconfigure [msgcat::mc "Edit Language"] -state normal
1863  }
1864 
1865  }

§ edit_templates_posting()

menus::edit_templates_posting   mb  

Definition at line 1870 of file menus.tcl.

1870  proc edit_templates_posting {mb} {
1871 
1872  set state [expr {[templates::valid] ? "normal" : "disabled"}]
1873 
1874  $mb entryconfigure [msgcat::mc "Edit"] -state $state
1875  $mb entryconfigure [msgcat::mc "Delete"] -state $state
1876 
1877  }

§ edit_transform_bubble_down()

menus::edit_transform_bubble_down

Definition at line 2143 of file menus.tcl.

2143  proc edit_transform_bubble_down {} {
2144 
2146 
2147  }

§ edit_transform_bubble_up()

menus::edit_transform_bubble_up

Definition at line 2135 of file menus.tcl.

2135  proc edit_transform_bubble_up {} {
2136 
2138 
2139  }

§ edit_transform_join_lines()

menus::edit_transform_join_lines

Definition at line 2127 of file menus.tcl.

2127  proc edit_transform_join_lines {} {
2128 
2130 
2131  }

§ edit_transform_posting()

menus::edit_transform_posting   mb  

Definition at line 1766 of file menus.tcl.

1766  proc edit_transform_posting {mb} {
1767 
1768  # Get the state
1769  set state [expr {([gui::current_txt] eq "") ? "disabled" : "normal"}]
1770 
1771  $mb entryconfigure [msgcat::mc "Toggle Case"] -state $state
1772  $mb entryconfigure [msgcat::mc "Lower Case"] -state $state
1773  $mb entryconfigure [msgcat::mc "Upper Case"] -state $state
1774  $mb entryconfigure [msgcat::mc "Title Case"] -state $state
1775  $mb entryconfigure [msgcat::mc "Join Lines"] -state $state
1776  $mb entryconfigure [msgcat::mc "Bubble Up"] -state $state
1777  $mb entryconfigure [msgcat::mc "Bubble Down"] -state $state
1778  $mb entryconfigure [msgcat::mc "Replace Line With Script"] -state $state
1779 
1780  if {[edit::current_line_empty]} {
1781  $mb entryconfigure [msgcat::mc "Replace Line With Script"] -state disabled
1782  }
1783 
1784  }

§ edit_transform_to_lower_case()

menus::edit_transform_to_lower_case

Definition at line 2079 of file menus.tcl.

2079  proc edit_transform_to_lower_case {} {
2080 
2081  set txtt [gui::current_txt].t
2082 
2083  if {[catch { $txtt tag ranges sel} sel]} {
2084  foreach {startpos endpos} $sel {
2085  edit::transform_to_lower_case $txtt $startpos $endpos
2086  }
2087  } else {
2088  edit::transform_to_lower_case $txtt insert "insert+1c"
2089  }
2090 
2091  }

§ edit_transform_to_title_case()

menus::edit_transform_to_title_case

Definition at line 2111 of file menus.tcl.

2111  proc edit_transform_to_title_case {} {
2112 
2113  set txtt [gui::current_txt].t
2114 
2115  if {[catch { $txtt tag ranges sel} sel]} {
2116  foreach {startpos endpos} $sel {
2117  edit::transform_to_title_case $txtt $startpos $endpos
2118  }
2119  } else {
2120  edit::transform_to_title_case $txtt insert "insert+1c"
2121  }
2122 
2123  }

§ edit_transform_to_upper_case()

menus::edit_transform_to_upper_case

Definition at line 2095 of file menus.tcl.

2095  proc edit_transform_to_upper_case {} {
2096 
2097  set txtt [gui::current_txt].t
2098 
2099  if {[catch { $txtt tag ranges sel} sel]} {
2100  foreach {startpos endpos} $sel {
2101  edit::transform_to_upper_case $txtt $startpos $endpos
2102  }
2103  } else {
2104  edit::transform_to_upper_case $txtt insert "insert+1c"
2105  }
2106 
2107  }

§ edit_transform_toggle_case()

menus::edit_transform_toggle_case

Definition at line 2063 of file menus.tcl.

2063  proc edit_transform_toggle_case {} {
2064 
2065  set txtt [gui::current_txt].t
2066 
2067  if {[catch { $txtt tag ranges sel} sel]} {
2068  foreach {startpos endpos} $sel {
2069  edit::transform_toggle_case $txtt $startpos $endpos
2070  }
2071  } else {
2072  edit::transform_toggle_case $txtt insert "insert+1c"
2073  }
2074 
2075  }

§ edit_user_global()

menus::edit_user_global

Definition at line 2169 of file menus.tcl.

2169  proc edit_user_global {} {
2170 
2171  # preferences::edit_global
2172  pref_ui::create "" ""
2173 
2174  }

§ edit_user_language()

menus::edit_user_language

Definition at line 2178 of file menus.tcl.

2178  proc edit_user_language {} {
2179 
2181 
2182  }

§ exit_cleanup()

menus::exit_cleanup

Definition at line 1057 of file menus.tcl.

1057  proc exit_cleanup {} {
1058 
1059  # Close the themer if it is open
1061 
1062  # Save the session information if we are not told to exit on close
1063  sessions::save "last"
1064 
1065  # Close all of the tabs
1066  gui::close_all -exiting 1
1067 
1068  # Force any panels that are waiting to stop waiting
1069  set gui::user_exit_status 0
1070 
1071  # Save the clipboard history
1073 
1074  # Close the opened remote connections
1076 
1077  # Handle on_quit plugins
1079 
1080  # Turn off profiling (if it was turned on)
1081  if {[::tke_development]} {
1082  stop_profiling_command .menubar.tools 0
1083  }
1084 
1085  # Stop the logger
1087 
1088  }

§ exit_command()

menus::exit_command

Definition at line 1092 of file menus.tcl.

1092  proc exit_command {} {
1093 
1094  # Clean up the application (if there are any errors, ignore them)
1095  catch { exit_cleanup}
1096 
1097  # If we are doing code coverage, call cleanup directly
1098  if {[namespace exists ::_instrument_]} {
1099  ::_instrument_::cleanup
1100  }
1101 
1102  # Destroy the interface
1103  destroy .
1104 
1105  }

§ export_command()

menus::export_command

Definition at line 825 of file menus.tcl.

825  proc export_command {} {
826 
827  # Get the directory of the current file
828  set dirname [gui::get_browse_directory]
829 
830  # Get the current editing buffer
831  set txt [gui::current_txt]
832 
833  # Get the current editing buffer language
834  set lang [syntax::get_language $txt]
835 
836  # Create additional options to the getSaveFile call
837  set opts [list]
838  if {$lang eq "Markdown"} {
839  if {[set ext [preferences::get General/DefaultMarkdownExportExtension]] ne ""} {
840  set ext ".$ext"
841  }
842  lappend opts -initialfile [file rootname [file tail [gui::get_info $txt txt fname]]]$ext
843  }
844 
845  # Get the name of the file to output
846  if {[set fname [tk_getSaveFile -parent . -title [msgcat::mc "Export As"] -initialdir $dirname {*}$opts]] eq ""} {
847  return
848  }
849 
850  # Get the scrubbed contents of the current buffer
851  set contents [gui::scrub_text $txt]
852 
853  # Export the string contents
854  if {[catch { utils::export $contents $lang $fname} rc]} {
855  gui::set_error_message [msgcat::mc "Unable to write export file"]
856  return
857  }
858 
859  # Let the user know that the operation has completed
860  gui::set_info_message [msgcat::mc "Export complete"]
861 
862  }

§ favorite_command()

menus::favorite_command   mb  

Definition at line 998 of file menus.tcl.

998  proc favorite_command {mb} {
999 
1000  # Get current file information
1001  gui::get_info {} current fileindex fname
1002 
1003  # Get the current file index (if one exists)
1004  if {$fileindex != -1} {
1005 
1006  # Add the file as a favorite
1007  if {[favorites::add $fname]} {
1008 
1009  # Set the menu up to display the unfavorite file menu option
1010  $mb entryconfigure [msgcat::mc "Favorite"] -label [msgcat::mc "Unfavorite"] -command [list menus::text_only menus::unfavorite_command $mb]
1011 
1012  }
1013 
1014  }
1015 
1016  }

§ file_eol_posting()

menus::file_eol_posting   mb  

Definition at line 665 of file menus.tcl.

665  proc file_eol_posting {mb} {
666 
667  variable line_ending
668 
669  # Set the line_ending to the current line ending to use
670  set line_ending [gui::get_info {} current eol]
671 
672  }

§ file_export_posting()

menus::file_export_posting   mb  

Definition at line 657 of file menus.tcl.

657  proc file_export_posting {mb} {
658 
659  # TBD
660 
661  }

§ file_favorites_posting()

menus::file_favorites_posting   mb  

Definition at line 639 of file menus.tcl.

639  proc file_favorites_posting {mb} {
640 
641  # Clear the menu
642  $mb delete 0 end
643 
644  # Populate the menu with the filenames from the favorite list
645  foreach path [favorites::get_list] {
646  if {[file isdirectory $path]} {
647  $mb add command -label " $path" -command "sidebar::add_directory $path"
648  } else {
649  $mb add command -label " $path" -command "gui::add_file end $path"
650  }
651  }
652 
653  }

§ file_posting()

menus::file_posting   mb  

Definition at line 485 of file menus.tcl.

485  proc file_posting {mb} {
486 
487  # Get information for current file
488  if {![catch { gui::get_info {} current fileindex fname readonly lock diff buffer modified remote}]} {
489 
490  # Get state if the file is a buffer
491  set buffer_state [expr {($buffer || $diff) ? "disabled" : "normal"}]
492 
493  # Get the state if the current editing buffer is a difference buffer
494  set diff_state [expr {$diff ? "disabled" : "normal"}]
495 
496  # Get the state for items that are not valid for remote files
497  set no_remote_state [expr {($remote eq "") ? $buffer_state : "disabled"}]
498 
499  # Get the current favorite status
500  set favorite [favorites::is_favorite $fname]
501 
502  # Configure the Lock/Unlock menu item
503  if {$lock} {
504  if {![catch { $mb index [msgcat::mc "Lock"]} index]} {
505  $mb entryconfigure $index -label [msgcat::mc "Unlock"] -state $diff_state -command [list menus::text_only menus::unlock_command $mb]
506  }
507  $mb entryconfigure [msgcat::mc "Unlock"] -state [expr {$readonly ? "disabled" : $diff_state}]
508  } else {
509  if {![catch { $mb index [msgcat::mc "Unlock"]} index]} {
510  $mb entryconfigure $index -label [msgcat::mc "Lock"] -state $diff_state -command [list menus::text_only menus::lock_command $mb]
511  }
512  $mb entryconfigure [msgcat::mc "Lock"] -state [expr {$readonly ? "disabled" : $diff_state}]
513  }
514 
515  # Configure the Favorite/Unfavorite menu item
516  if {$favorite} {
517  if {![catch { $mb index [msgcat::mc "Favorite"]} index]} {
518  $mb entryconfigure $index -label [msgcat::mc "Unfavorite"] -command [list menus::text_only menus::unfavorite_command $mb]
519  }
520  $mb entryconfigure [msgcat::mc "Unfavorite"] -state [expr {(($fname ne "") && !$diff) ? $no_remote_state : "disabled"}]
521  } else {
522  if {![catch { $mb index [msgcat::mc "Unfavorite"]} index]} {
523  $mb entryconfigure $index -label [msgcat::mc "Favorite"] -command [list menus::text_only menus::favorite_command $mb]
524  }
525  $mb entryconfigure [msgcat::mc "Favorite"] -state [expr {(($fname ne "") && !$diff) ? $no_remote_state : "disabled"}]
526  }
527 
528  # Configure the Delete/Move To Trash
529  if {($remote eq "") && [preferences::get General/UseMoveToTrash]} {
530  if {![catch { $mb index [msgcat::mc "Delete"]} index]} {
531  $mb entryconfigure $index -label [msgcat::mc "Move To Trash"] -command [list menus::text_only menus::move_to_trash_command]
532  }
533  $mb entryconfigure [msgcat::mc "Move To Trash"] -state $buffer_state
534  } else {
535  if {![catch { $mb index [msgcat::mc "Move To Trash"]} index]} {
536  $mb entryconfigure $index -label [msgcat::mc "Delete"] -command [list menus::text_only menus::delete_command]
537  }
538  $mb entryconfigure [msgcat::mc "Delete"] -state $buffer_state
539  }
540 
541  # Make sure that the file-specific items are enabled
542  $mb entryconfigure [msgcat::mc "Reopen File"] -state $buffer_state
543  $mb entryconfigure [msgcat::mc "Show File Difference"] -state $no_remote_state
544  $mb entryconfigure [msgcat::mc "Save"] -state [expr {$modified ? $diff_state : "disabled"}]
545  $mb entryconfigure [format "%s..." [msgcat::mc "Save As"]] -state $diff_state
546  $mb entryconfigure [format "%s..." [msgcat::mc "Save As Remote"]] -state $diff_state
547  $mb entryconfigure [format "%s..." [msgcat::mc "Save As Template"]] -state $diff_state
548  $mb entryconfigure [format "%s..." [msgcat::mc "Save Selection As"]] -state [expr {[gui::selected] ? "normal" : "disabled"}]
549  $mb entryconfigure [msgcat::mc "Save All"] -state normal
550  $mb entryconfigure [format "%s..." [msgcat::mc "Export"]] -state $diff_state
551  $mb entryconfigure [msgcat::mc "Line Ending"] -state $diff_state
552  $mb entryconfigure [msgcat::mc "Rename"] -state $buffer_state
553  $mb entryconfigure [msgcat::mc "Duplicate"] -state $buffer_state
554  $mb entryconfigure [msgcat::mc "Close"] -state normal
555  $mb entryconfigure [msgcat::mc "Close All"] -state normal
556 
557  } else {
558 
559  # Disable file menu items associated with current tab (since one doesn't currently exist)
560  $mb entryconfigure [msgcat::mc "Reopen File"] -state disabled
561  $mb entryconfigure [msgcat::mc "Show File Difference"] -state disabled
562  $mb entryconfigure [msgcat::mc "Save"] -state disabled
563  $mb entryconfigure [format "%s..." [msgcat::mc "Save As"]] -state disabled
564  $mb entryconfigure [format "%s..." [msgcat::mc "Save As Remote"]] -state disabled
565  $mb entryconfigure [format "%s..." [msgcat::mc "Save As Template"]] -state disabled
566  $mb entryconfigure [format "%s..." [msgcat::mc "Save Selection As"]] -state disabled
567  $mb entryconfigure [msgcat::mc "Save All"] -state disabled
568  $mb entryconfigure [format "%s..." [msgcat::mc "Export"]] -state disabled
569  $mb entryconfigure [msgcat::mc "Line Ending"] -state disabled
570  $mb entryconfigure [msgcat::mc "Rename"] -state disabled
571  $mb entryconfigure [msgcat::mc "Duplicate"] -state disabled
572  $mb entryconfigure [msgcat::mc "Delete"] -state disabled
573  $mb entryconfigure [msgcat::mc "Lock"] -state disabled
574  $mb entryconfigure [msgcat::mc "Favorite"] -state disabled
575  $mb entryconfigure [msgcat::mc "Close"] -state disabled
576  $mb entryconfigure [msgcat::mc "Close All"] -state disabled
577 
578  }
579 
580  $mb entryconfigure [format "%s..." [msgcat::mc "New From Template"]] -state [expr {[templates::valid] ? "normal" : "disabled"}]
581 
582  # Configure the Open Recent menu
583  if {([preferences::get View/ShowRecentlyOpened] == 0) || (([llength [gui::get_last_opened]] == 0) && ([llength [sidebar::get_last_opened]] == 0))} {
584  $mb entryconfigure [msgcat::mc "Open Recent"] -state disabled
585  } else {
586  $mb entryconfigure [msgcat::mc "Open Recent"] -state normal
587  }
588 
589  # Configure the Open Favorite menu
590  if {[llength [favorites::get_list]] == 0} {
591  $mb entryconfigure [msgcat::mc "Open Favorite"] -state disabled
592  } else {
593  $mb entryconfigure [msgcat::mc "Open Favorite"] -state normal
594  }
595 
596  }

§ file_recent_posting()

menus::file_recent_posting   mb  

Definition at line 600 of file menus.tcl.

600  proc file_recent_posting {mb} {
601 
602  # Clear the menu
603  $mb delete 0 end
604 
605  # Populate the menu with the directories
606  if {[llength [set sdirs [sidebar::get_last_opened]]] > 0} {
607  $mb add command -label [msgcat::mc "Recent Directories"] -state disabled
608  foreach sdir [lrange $sdirs 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
609  $mb add command -label [format " %s" $sdir] -command [list sidebar::add_directory $sdir]
610  }
611  $mb add separator
612  }
613 
614  # Populate the menu with the filenames
615  if {[llength [set fnames [gui::get_last_opened]]] > 0} {
616  $mb add command -label [msgcat::mc "Recent Files"] -state disabled
617  foreach fname [lrange $fnames 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
618  $mb add command -label [format " %s" $fname] -command [list gui::add_file end $fname]
619  }
620  $mb add separator
621  }
622 
623  # Add "Clear All" menu option
624  $mb add command -label [msgcat::mc "Clear All"] -command [list menus::main_only menus::clear_last_opened]
625 
626  }

§ find_marker_posting()

menus::find_marker_posting   mb  

Definition at line 2369 of file menus.tcl.

2369  proc find_marker_posting {mb} {
2370 
2371  gui::get_info {} current tab txt
2372 
2373  set line_exists [markers::exists_at_line $tab [lindex [split [$txt index insert] .] 0]]
2374  set create_state [expr {$line_exists ? "disabled" : "normal"}]
2375  set remove_state [expr {$line_exists ? "normal" : "disabled"}]
2376  set tab_state [expr {[markers::exists $tab] ? "normal" : "disabled"}]
2377  set all_state [expr {[markers::exists *] ? "normal" : "disabled"}]
2378 
2379  # Clear the menu
2380  $mb delete 0 end
2381 
2382  # Populate the markerPopup menu
2383  $mb add command -label [msgcat::mc "Create at Current Line"] -underline 0 -command [list menus::text_only gui::create_current_marker] -state $create_state
2384  $mb add separator
2385  $mb add command -label [msgcat::mc "Remove From Current Line"] -underline 0 -command [list menus::text_only gui::remove_current_marker] -state $remove_state
2386  $mb add command -label [msgcat::mc "Remove All From Current Buffer"] -underline 24 -command [list menus::text_only gui::remove_current_markers] -state $tab_state
2387  $mb add command -label [msgcat::mc "Remove All Markers"] -underline 7 -command [list menus::main_only gui::remove_all_markers] -state $all_state
2388 
2389  if {[llength [set markers [gui::get_marker_list]]] > 0} {
2390  $mb add separator
2391  $mb add command -label [msgcat::mc "Markers"] -state disabled
2392  foreach marker $markers {
2393  lassign $marker name txt mname
2394  $mb add command -label " $name" -command [list gui::jump_to_marker $txt $mname]
2395  }
2396  }
2397 
2398  }

§ find_next_command()

menus::find_next_command

Definition at line 2403 of file menus.tcl.

2403  proc find_next_command {} {
2404 
2406 
2407  }

§ find_posting()

menus::find_posting   mb  

Definition at line 2320 of file menus.tcl.

2320  proc find_posting {mb} {
2321 
2322  if {[catch { gui::get_info {} current txt readonly diff}]} {
2323  $mb entryconfigure [msgcat::mc "Find"] -state disabled
2324  $mb entryconfigure [msgcat::mc "Find and Replace"] -state disabled
2325  $mb entryconfigure [msgcat::mc "Find Next"] -state disabled
2326  $mb entryconfigure [msgcat::mc "Find Previous"] -state disabled
2327  $mb entryconfigure [msgcat::mc "Select Current Match"] -state disabled
2328  $mb entryconfigure [msgcat::mc "Select All Matches"] -state disabled
2329  $mb entryconfigure [msgcat::mc "Jump Backward"] -state disabled
2330  $mb entryconfigure [msgcat::mc "Jump Forward"] -state disabled
2331  $mb entryconfigure [msgcat::mc "Next Difference"] -state disabled
2332  $mb entryconfigure [msgcat::mc "Previous Difference"] -state disabled
2333  $mb entryconfigure [msgcat::mc "Show Selected Line Change"] -state disabled
2334  $mb entryconfigure [msgcat::mc "Markers"] -state disabled
2335  $mb entryconfigure [msgcat::mc "Find Matching Bracket"] -state disabled
2336  $mb entryconfigure [msgcat::mc "Find Next Bracket Mismatch"] -state disabled
2337  $mb entryconfigure [msgcat::mc "Find Previous Bracket Mismatch"] -state disabled
2338  } else {
2339  set readonly_state [expr {($readonly || $diff) ? "disabled" : "normal"}]
2340  set found_state [expr {[search::enable_find_view $txt] ? "normal" : "disabled"}]
2341  set sel_curr_state [expr {[search::enable_select_current $txt] ? "normal" : "disabled"}]
2342  set jump_forw_state [expr {[gui::jump_to_cursor -1 0] ? "normal" : "disabled"}]
2343  set jump_back_state [expr {[gui::jump_to_cursor 1 0] ? "normal" : "disabled"}]
2344  set jump_diff_state [expr {[gui::jump_to_difference 1 0] ? "normal" : "disabled"}]
2345  set show_line_state [expr {[gui::show_difference_line_change 0] ? "normal" : "disabled"}]
2346  set next_mism_state [expr {[gui::goto_mismatch next -check 1] ? "normal" : "disabled"}]
2347  set prev_mism_state [expr {[gui::goto_mismatch prev -check 1] ? "normal" : "disabled"}]
2348  $mb entryconfigure [msgcat::mc "Find"] -state normal
2349  $mb entryconfigure [msgcat::mc "Find and Replace"] -state $readonly_state
2350  $mb entryconfigure [msgcat::mc "Find Next"] -state $found_state
2351  $mb entryconfigure [msgcat::mc "Find Previous"] -state $found_state
2352  $mb entryconfigure [msgcat::mc "Select Current Match"] -state $sel_curr_state
2353  $mb entryconfigure [msgcat::mc "Select All Matches"] -state $found_state
2354  $mb entryconfigure [msgcat::mc "Jump Backward"] -state $jump_back_state
2355  $mb entryconfigure [msgcat::mc "Jump Forward"] -state $jump_forw_state
2356  $mb entryconfigure [msgcat::mc "Next Difference"] -state $jump_diff_state
2357  $mb entryconfigure [msgcat::mc "Previous Difference"] -state $jump_diff_state
2358  $mb entryconfigure [msgcat::mc "Show Selected Line Change"] -state $show_line_state
2359  $mb entryconfigure [msgcat::mc "Find Matching Bracket"] -state $readonly_state
2360  $mb entryconfigure [msgcat::mc "Find Next Bracket Mismatch"] -state $next_mism_state
2361  $mb entryconfigure [msgcat::mc "Find Previous Bracket Mismatch"] -state $prev_mism_state
2362  $mb entryconfigure [msgcat::mc "Markers"] -state normal
2363  }
2364 
2365  }

§ find_prev_command()

menus::find_prev_command

Definition at line 2412 of file menus.tcl.

2412  proc find_prev_command {} {
2413 
2415 
2416  }

§ find_select_all_command()

menus::find_select_all_command

Definition at line 2428 of file menus.tcl.

2428  proc find_select_all_command {} {
2429 
2431 
2432  }

§ find_select_current_command()

menus::find_select_current_command

Definition at line 2420 of file menus.tcl.

2420  proc find_select_current_command {} {
2421 
2423 
2424  }

§ generate_profile_report()

menus::generate_profile_report

Definition at line 3233 of file menus.tcl.

3233  proc generate_profile_report {} {
3234 
3235  variable profile_report
3236  variable profiling_info
3237 
3238  # Recollect the data
3239  set info_list [list]
3240  foreach info [array names profiling_info] {
3241 
3242  set name [lindex $info 0]
3243 
3244  # If the name matches anything that we don't want to profile,
3245  # skip to the next iteration now
3246  if {[regexp {^(((::)?(tk::|tcl::|ttk::|tablelist::|mwutil::))|<global>|::\w+$)} $name]} {
3247  continue
3248  }
3249 
3250  set calls [lindex $profiling_info($info) 0]
3251  set real [lindex $profiling_info($info) 1]
3252  set cpu [lindex $profiling_info($info) 2]
3253 
3254  if {[set index [lsearch -index 0 $info_list [lindex $info 0]]] == -1} {
3255  lappend info_list [list [lindex $info 0] $calls $real $cpu 0.0 0.0]
3256  } else {
3257  set info_entry [lindex $info_list $index]
3258  lset info_list $index 1 [expr [lindex $info_entry 1] + $calls]
3259  lset info_list $index 2 [expr [lindex $info_entry 2] + $real]
3260  lset info_list $index 3 [expr [lindex $info_entry 3] + $cpu]
3261  }
3262 
3263  }
3264 
3265  # Calculate the real/call and cpu/call values
3266  for {set i 0} {$i < [llength $info_list]} {incr i} {
3267  set info_entry [lindex $info_list $i]
3268  if {[lindex $info_entry 1] > 0} {
3269  lset info_list $i 4 [expr [lindex $info_entry 2].0 / [lindex $info_entry 1]]
3270  lset info_list $i 5 [expr [lindex $info_entry 3].0 / [lindex $info_entry 1]]
3271  }
3272  }
3273 
3274  # Sort the information
3275  switch [preferences::get Tools/ProfileReportSortby] {
3276  "calls" { set info_list [lsort -decreasing -integer -index 1 $info_list]}
3277  "real" { set info_list [lsort -decreasing -integer -index 2 $info_list]}
3278  "cpu" { set info_list [lsort -decreasing -integer -index 3 $info_list]}
3279  "real_per_call" { set info_list [lsort -decreasing -real -index 4 $info_list]}
3280  "cpu_per_call" { set info_list [lsort -decreasing -real -index 5 $info_list]}
3281  default { set info_list [lsort -index 0 $info_list]}
3282  }
3283 
3284  # Create the report file
3285  if {![catch "open $profile_report w" rc]} {
3286 
3287  puts $rc "=============================================================================================================="
3288  puts $rc [format " %s (%s)" [msgcat::mc "Profiling Report Sorted By"] [preferences::get Tools/ProfileReportSortby]]
3289  puts $rc "=============================================================================================================="
3290  puts $rc [format "%-50s %10s %10s %10s %10s %10s" "Procedure" "Calls" "Real" "CPU" "Real/Calls" "CPU/Calls"]
3291  puts $rc "=============================================================================================================="
3292 
3293  foreach info $info_list {
3294  puts $rc [format "%-50s %10d %10d %10d %10.3f %10.3f" {*}$info]
3295  }
3296 
3297  close $rc
3298 
3299  }
3300 
3301  }

§ get_menu()

menus::get_menu   menu_path  

Definition at line 50 of file menus.tcl.

50  proc get_menu {menu_path} {
51 
52  set parent .menubar
53 
54  foreach mnu $menu_path {
55  if {([set mnu_index [$parent index [msgcat::mc $mnu]]] eq "none") || ([$parent type $mnu_index] ne "cascade")} {
56  return -code error "Invalid menu path specified"
57  }
58  set parent [$parent entrycget $mnu_index -menu]
59  }
60 
61  return $parent
62 
63  }

§ get_menu_index()

menus::get_menu_index   mnu tail  

Definition at line 68 of file menus.tcl.

68  proc get_menu_index {mnu tail} {
69 
70  if {[string range $tail end-2 end] eq "..."} {
71  set tail [msgcat::mc [string range $tail 0 end-3]]...
72  } else {
73  set tail [msgcat::mc $tail]
74  }
75 
76  return [$mnu index $tail]
77 
78  }

§ handle_development_mode()

menus::handle_development_mode   ?name1? ?name2? ?op?  

Definition at line 149 of file menus.tcl.

149  proc handle_development_mode {{name1 ""} {name2 ""} {op ""}} {
150 
151  variable last_devel_mode
152 
153  # If the menubar does not exist, we have nothing further to do
154  if {![winfo exists .menubar]} {
155  return
156  }
157 
158  # Get the development mode
159  if {[set devel_mode [::tke_development]] ne $last_devel_mode} {
160 
161  # Delete the development tools if they exist but we are no longer in development mode
162  if {$devel_mode} {
163 
164  set mb ".menubar.tools"
165  $mb add separator
166  $mb add command -label [msgcat::mc "Export Custom Themes"] -command [list themes::export_custom]
167  $mb add separator
168  $mb add command -label [msgcat::mc "Start Profiling"] -underline 0 -command [list menus::start_profiling_command $mb]
169  $mb add command -label [msgcat::mc "Stop Profiling"] -underline 1 -command [list menus::stop_profiling_command $mb 1] -state disabled
170  $mb add command -label [msgcat::mc "Show Last Profiling Report"] -underline 5 -command [list menus::show_last_profiling_report]
171  $mb add separator
172  $mb add command -label [msgcat::mc "Show Diagnostic Logfile"] -underline 5 -command "logger::view_log"
173  if {[preferences::get View/ShowConsole]} {
174  $mb add command -label [msgcat::mc "Hide Tcl Console"] -underline 5 -command [list menus::hide_console_view $mb]
175  } else {
176  $mb add command -label [msgcat::mc "Show Tcl Console"] -underline 5 -command [list menus::show_console_view $mb]
177  }
178  $mb add separator
179  $mb add command -label [format "%s %s" [msgcat::mc "Run"] "BIST"] -underline 4 -command "menus::run_bist"
180  $mb add separator
181  $mb add command -label [format "%s %s" [msgcat::mc "Restart"] "TKE"] -underline 0 -command "menus::restart_command"
182 
183  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Export Custom Themes"]] [list themes::export_custom]
184  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Start profiling"]] [list menus::start_profiling_command $mb]
185  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Stop profiling"]] [list menus::stop_profiling_command $mb 1]
186  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Show last profiling report"]] [list menus::show_last_profiling_report]
187  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Show diagnostic logfile"]] [list logger::view_log]
188  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Show Tcl console"]] [list menus::show_console_view $mb]
189  launcher::register [make_menu_cmd "Tools" [msgcat::mc "Hide Tcl console"]] [list menus::hide_console_view $mb]
190  launcher::register [make_menu_cmd "Tools" [format "%s %s" [msgcat::mc "Run"] "BIST"]] [list menus::run_bist]
191  launcher::register [make_menu_cmd "Tools" [format "%s %s" [msgcat::mc "Restart"] "TKE"]] [list menus::restart_command]
192 
193  # If profiling was enabled at startup, disable start and enable stop
194  if {$::cl_profile} {
195  $mb entryconfigure [msgcat::mc "Start Profiling"] -state disabled
196  $mb entryconfigure [msgcat::mc "Stop Profiling"] -state normal
197  }
198 
199  set mb ".menubar.plugins"
200  $mb insert 3 separator
201  $mb insert 4 command -label [format "%s..." [msgcat::mc "Create"]] -underline 0 -command [list menus::main_only plugins::create_new_plugin]
202  $mb insert 6 command -label [format "%s..." [msgcat::mc "Export"]] -underline 0 -command [list menus::main_only plugins::export]
203  $mb insert 7 command -label [msgcat::mc "Show plugins directory in sidebar"] -command [list menus::main_only plugins::show_iplugins]
204 
205  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Create new plugin"]] [list menus::main_only plugins::create_new_plugin]
206  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Export current plugin"]] [list menus::main_only plugins::export]
207  launcher::register [make_menu_cmd "Plugins" [msgcat::mc "Show plugin source directory in sidebar"]] [list menus::main_only plugins::show_iplugins]]
208 
209  set mb ".menubar.help"
210  $mb insert 2 separator
211  $mb insert 3 command -label [msgcat::mc "Plugin Developer Guide"] -underline 0 -command [list menus::main_only menus::help_devel_guide]
212 
213  launcher::register [make_menu_cmd "Help" [msgcat::mc "Show plugin developer guide"]] [list menus::main_only menus::help_devel_guide]
214 
215  } elseif {$last_devel_mode ne ""} {
216 
217  set mb ".menubar.tools"
218  set index [$mb index [msgcat::mc "Start Profiling"]]
219  $mb delete [expr $index - 1] end
220  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Start profiling"]] * *
221  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Stop profiling"]] * *
222  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Show last profiling report"]] * *
223  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Show diagnostic logfile"]] * *
224  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Show Tcl console"]] * *
225  launcher::unregister [make_menu_cmd "Tools" [msgcat::mc "Hide Tcl console"]] * *
226  launcher::unregister [make_menu_cmd "Tools" [format "%s %s" [msgcat::mc "Run"] "BIST"]] * *
227  launcher::unregister [make_menu_cmd "Tools" [format "%s %s" [msgcat::mc "Restart"] "TKE"]] * *
228 
229  set mb ".menubar.plugins"
230  $mb delete 6
231  $mb delete 3 4
232  launcher::unregister [make_menu_cmd "Plugins" [msgcat::mc "Create new plugin"]] * *
233  launcher::unregister [make_menu_cmd "Plugins" [msgcat::mc "Export current plugin"]] * *
234 
235  set mb ".menubar.help"
236  $mb delete 2 3
237  launcher::unregister [make_menu_cmd "Help" [msgcat::mc "Show plugin developer guide"]] * *
238 
239  }
240 
241  # Store the development mode
242  set last_devel_mode $devel_mode
243 
244  }
245 
246  }

§ handle_menu_shift_click()

menus::handle_menu_shift_click   w y  

Definition at line 341 of file menus.tcl.

341  proc handle_menu_shift_click {w y} {
342 
343  # Unpost the menu (and all of its ancestors)
344  catch { tk::MenuUnpost $w}
345 
346  pref_ui::create "" "" shortcuts
347  pref_ui::shortcut_edit_item [string map {# .} [lindex [split $w .] end]] [$w entrycget @$y -label]
348 
349  }

§ help_devel_guide()

menus::help_devel_guide

Definition at line 3595 of file menus.tcl.

3595  proc help_devel_guide {} {
3596 
3597  utils::open_file_externally [file join $::tke_dir doc DeveloperGuide.html] 1
3598 
3599  }

§ help_feedback_command()

menus::help_feedback_command

Definition at line 3623 of file menus.tcl.

3623  proc help_feedback_command {} {
3624 
3625  utils::open_file_externally "mailto:phase1geo@gmail.com?subject=Feedback for TKE" 1
3626 
3627  }

§ help_lang_ref_posting()

menus::help_lang_ref_posting   mb  

Definition at line 3556 of file menus.tcl.

3556  proc help_lang_ref_posting {mb} {
3557 
3558  gui::get_info {} current lang
3559 
3560  # Get the documentation elements to add
3561  set syntax [lsearch -index 1 -inline -all -not [syntax::get_references $lang] "*{query}*"]
3562  set user [lsearch -index 1 -inline -all -not [preferences::get Documentation/References] "*{query}*"]
3563 
3564  # Clean the menu
3565  $mb delete 0 end
3566 
3567  # Add the syntax items
3568  foreach item $syntax {
3569  lassign $item name url
3570  $mb add command -label " $name" -command [list utils::open_file_externally $url 1]
3571  }
3572 
3573  if {([llength $syntax] > 0) && ([llength $user] > 0)} {
3574  $mb add separator
3575  }
3576 
3577  # Add the user documentation
3578  foreach item $user {
3579  lassign $item name url
3580  $mb add command -label " $name" -command [list utils::open_file_externally $url 1]
3581  }
3582 
3583  }

§ help_posting()

menus::help_posting   mb  

Definition at line 3536 of file menus.tcl.

3536  proc help_posting {mb} {
3537 
3538  set docs [list {*}[syntax::get_references [gui::get_info {} current lang]] {*}[preferences::get Documentation/References]]
3539 
3540  if {[lsearch -index 1 -not $docs "*{query}*"] == -1} {
3541  $mb entryconfigure [msgcat::mc "Language Documentation"] -state disabled
3542  } else {
3543  $mb entryconfigure [msgcat::mc "Language Documentation"] -state normal
3544  }
3545 
3546  if {[lsearch -index 1 $docs "*{query}*"] == -1} {
3547  $mb entryconfigure [msgcat::mc "Search References"] -state disabled
3548  } else {
3549  $mb entryconfigure [msgcat::mc "Search References"] -state normal
3550  }
3551 
3552  }

§ help_submit_report()

menus::help_submit_report

Definition at line 3632 of file menus.tcl.

3632  proc help_submit_report {} {
3633 
3634  # Retrieve the contents of the diagnostic logfile
3635  set log_content [logger::get_log]
3636 
3637  # Create the message body
3638  set body "Add bug description:\n\n\n\n\n$log_content"
3639 
3640  # Send an e-mail with the logfile contents
3641  utils::open_file_externally "mailto:phase1geo@gmail.com?subject=Bug Report for TKE&body=$body" 1
3642 
3643  }

§ help_tips_tricks()

menus::help_tips_tricks

Definition at line 3603 of file menus.tcl.

3603  proc help_tips_tricks {} {
3604 
3605  utils::open_file_externally "http://tkeeditor.wordpress.com"
3606 
3607  }

§ help_user_guide()

menus::help_user_guide

Definition at line 3587 of file menus.tcl.

3587  proc help_user_guide {} {
3588 
3589  utils::open_file_externally [file join $::tke_dir doc UserGuide.html] 1
3590 
3591  }

§ hide_console_view()

menus::hide_console_view   mb  

Definition at line 2854 of file menus.tcl.

2854  proc hide_console_view {mb} {
2855 
2856  # Convert the menu command into the show console command
2857  if {![catch {$mb entryconfigure [msgcat::mc "Hide Tcl Console"] -label [msgcat::mc "Show Tcl Console"] -command [list menus::main_only menus::show_console_view $mb]}]} {
2859  }
2860 
2861  }

§ hide_line_numbers()

menus::hide_line_numbers   mb  

Definition at line 2920 of file menus.tcl.

2920  proc hide_line_numbers {mb} {
2921 
2922  # Convert the menu command into the hide line numbers command
2923  if {![catch {$mb entryconfigure [msgcat::mc "Hide Line Numbers"] -label [msgcat::mc "Show Line Numbers"] -command [list menus::main_only menus::show_line_numbers $mb]}]} {
2925  }
2926 
2927  }

§ hide_marker_map()

menus::hide_marker_map   mb  

Definition at line 2961 of file menus.tcl.

2961  proc hide_marker_map {mb} {
2962 
2963  # Convert the menu command into the show marker map command
2964  if {![catch {$mb entryconfigure [msgcat::mc "Hide Marker Map"] -label [msgcat::mc "Show Marker Map"] -command [list menus::main_only menus::show_marker_map $mb]}]} {
2965  [winfo parent [gui::current_txt]].vb configure -markhide1 1
2966  }
2967 
2968  }

§ hide_meta_chars()

menus::hide_meta_chars   mb  

Definition at line 2980 of file menus.tcl.

2980  proc hide_meta_chars {mb} {
2981 
2982  [gui::current_txt] configure -hidemeta 1
2983 
2984  }

§ hide_sidebar_view()

menus::hide_sidebar_view   mb  

Definition at line 2832 of file menus.tcl.

2832  proc hide_sidebar_view {mb} {
2833 
2834  # Convert the menu command into the hide sidebar command
2835  if {![catch {$mb entryconfigure [msgcat::mc "Hide Sidebar"] -label [msgcat::mc "Show Sidebar"] -command [list menus::main_only menus::show_sidebar_view $mb]}]} {
2837  }
2838 
2839  }

§ hide_status_view()

menus::hide_status_view   mb  

Definition at line 2898 of file menus.tcl.

2898  proc hide_status_view {mb} {
2899 
2900  # Convert the menu command into the show status bar command
2901  if {![catch {$mb entryconfigure [msgcat::mc "Hide Status Bar"] -label [msgcat::mc "Show Status Bar"] -command [list menus::main_only menus::show_status_view $mb]}]} {
2903  }
2904 
2905  }

§ hide_tab_view()

menus::hide_tab_view   mb  

Definition at line 2876 of file menus.tcl.

2876  proc hide_tab_view {mb} {
2877 
2878  # Convert the menu command into the show tab bar command
2879  if {![catch {$mb entryconfigure [msgcat::mc "Hide Tab Bar"] -label [msgcat::mc "Show Tab Bar"] -command [list menus::main_only menus::show_tab_view $mb]}]} {
2881  }
2882 
2883  }

§ indent_command()

menus::indent_command

Definition at line 1962 of file menus.tcl.

1962  proc indent_command {} {
1963 
1965 
1966  }

§ invoke()

menus::invoke   mnu index  

Definition at line 93 of file menus.tcl.

93  proc invoke {mnu index} {
94 
95  # If the menubar is disabled, don't allow any menu invocations
96  if {[.menubar entrycget 0 -state] eq "disabled"} {
97  return
98  }
99 
100  # If the menu contains a postcommand, execute it first
101  if {[$mnu cget -postcommand] ne ""} {
102  eval [$mnu cget -postcommand]
103  }
104 
105  # Next, invoke the menu
106  $mnu invoke $index
107 
108  }

§ jump_to_fold()

menus::jump_to_fold   dir  

Definition at line 3105 of file menus.tcl.

3105  proc jump_to_fold {dir} {
3106 
3108 
3109  }

§ jump_to_line()

menus::jump_to_line

Definition at line 2436 of file menus.tcl.

2436  proc jump_to_line {} {
2437 
2438  set linenum ""
2439 
2440  # Get the line number from the user
2441  if {[gui::get_user_response [format "%s:" [msgcat::mc "Line Number"]] linenum] && [string is integer $linenum]} {
2442  edit::jump_to_line [gui::current_txt].t $linenum.0
2443  }
2444 
2445  }

§ launcher()

menus::launcher

Definition at line 3647 of file menus.tcl.

3647  proc launcher {} {
3648 
3649  # Add recent directories to launcher
3650  foreach sdir [lrange [sidebar::get_last_opened] 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
3651  launcher::register_temp "`RECENT:$sdir" [list sidebar::add_directory $sdir] $sdir
3652  }
3653 
3654  # Add recent files to launcher
3655  foreach fname [lrange [gui::get_last_opened] 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
3656  launcher::register_temp "`RECENT:$fname" [list gui::add_file end $fname] $fname
3657  }
3658 
3659  # Display the launcher in RECENT: mode
3660  launcher::launch "`RECENT:"
3661 
3662  # Unregister the recents
3663  foreach sdir [lrange [sidebar::get_last_opened] 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
3664  launcher::unregister "`RECENT:$sdir"
3665  }
3666  foreach fname [lrange [gui::get_last_opened] 0 [expr [preferences::get View/ShowRecentlyOpened] - 1]] {
3667  launcher::unregister "`RECENT:$fname"
3668  }
3669 
3670  }

§ lock_command()

menus::lock_command   mb  

Definition at line 970 of file menus.tcl.

970  proc lock_command {mb} {
971 
972  # Lock the current file
973  if {[gui::set_current_file_lock 1]} {
974 
975  # Set the menu up to display the unlock file menu option
976  $mb entryconfigure [msgcat::mc "Lock"] -label [msgcat::mc "Unlock"] -command [list menus::text_only menus::unlock_command $mb]
977 
978  }
979 
980  }

§ main_only()

menus::main_only   cmd args  

Definition at line 139 of file menus.tcl.

139  proc main_only {cmd args} {
140 
141  if {[focus] ne ""} {
142  uplevel #0 [list $cmd {*}$args]
143  }
144 
145  }

§ make_menu()

menus::make_menu   w args  

Definition at line 323 of file menus.tcl.

323  proc make_menu {w args} {
324 
325  # Create the menu
326  set mnu [menu $w {*}$args]
327 
328  # Create menu binding that will allow us to Shift click menu items to
329  # edit their shortcuts in the preferences window.
330  bind $mnu <Control-Button-1> { menus::handle_menu_shift_click %W %y; break }
331  bind $mnu <Control-ButtonRelease-1> { break }
332 
333  return $mnu
334 
335  }

§ make_menu_cmd()

menus::make_menu_cmd   mnu lbl  

Definition at line 353 of file menus.tcl.

353  proc make_menu_cmd {mnu lbl} {
354 
355  return [format "%s %s: %s" [msgcat::mc $mnu] [msgcat::mc "Menu"] $lbl]
356 
357  }

§ move_to_trash_command()

menus::move_to_trash_command

Definition at line 951 of file menus.tcl.

951  proc move_to_trash_command {} {
952 
953  # Get the full pathname
954  gui::get_info {} current fname
955 
956  # Move the file to the trash
957  if {[catch { files::move_to_trash $fname 0}]} {
958  return
959  }
960 
961  # Update the old directory
962  if {[set sidebar_index [sidebar::get_index [file dirname $fname] ""]] ne ""} {
963  sidebar::update_directory $sidebar_index
964  }
965 
966  }

§ new_file_command()

menus::new_file_command

Definition at line 690 of file menus.tcl.

690  proc new_file_command {} {
691 
692  gui::add_new_file end -sidebar 1
693 
694  }

§ new_file_from_template()

menus::new_file_from_template

Definition at line 698 of file menus.tcl.

698  proc new_file_from_template {} {
699 
701 
702  }

§ new_window_command()

menus::new_window_command

Definition at line 676 of file menus.tcl.

676  proc new_window_command {} {
677 
678  # Execute the restart command
679  if {[file tail [info nameofexecutable]] eq "tke.exe"} {
680  exec -ignorestderr [info nameofexecutable] -n &
681  } else {
682  array set frame [info frame 1]
683  exec -ignorestderr [info nameofexecutable] $::argv0 -- -n &
684  }
685 
686  }

§ open_command()

menus::open_command

Definition at line 706 of file menus.tcl.

706  proc open_command {} {
707 
708  # Get the directory of the current file
709  set dirname [gui::get_browse_directory]
710 
711  if {[set ofiles [tk_getOpenFile -parent . -initialdir $dirname -filetypes [syntax::get_filetypes] -defaultextension .tcl -multiple 1]] ne ""} {
712  foreach ofile $ofiles {
713  gui::add_file end $ofile
714  }
715  }
716 
717  }

§ open_dir_command()

menus::open_dir_command

Definition at line 721 of file menus.tcl.

721  proc open_dir_command {} {
722 
723  # Get the directory of the current file
724  set dirname [gui::get_browse_directory]
725 
726  if {[set odir [tk_chooseDirectory -parent . -initialdir $dirname -mustexist 1]] ne ""} {
728  }
729 
730  }

§ open_folds()

menus::open_folds   type ?depth?  

Definition at line 3083 of file menus.tcl.

3083  proc open_folds {type {depth 0}} {
3084 
3085  set txt [gui::current_txt]
3086 
3087  switch $type {
3088  current { folding::open_fold $depth $txt [lindex [split [$txt index insert] .] 0]}
3089  all { folding::open_all_folds $txt}
3090  show { folding::show_line $txt [lindex [split [$txt index insert] .] 0]}
3091  selected {
3092  foreach {startpos endpos} [$txt tag ranges sel] {
3093  set startline [lindex [split $startpos .] 0]
3094  set endline [lindex [split $endpos .] 0]
3095  folding::open_folds_in_range $txt $startline $endline $depth
3096  }
3097  }
3098  }
3099 
3100  }

§ open_remote_command()

menus::open_remote_command

Definition at line 734 of file menus.tcl.

734  proc open_remote_command {} {
735 
736  # Get the directory or file
737  lassign [remote::create open] conn_name ofiles
738 
739  # Add the files to the editing area
740  foreach ofile $ofiles {
741  if {[lassign $ofile fname]} {
742  sidebar::add_directory $fname -remote $conn_name
743  } else {
744  gui::add_file end $fname -remote $conn_name
745  }
746  }
747 
748  }

§ plugins_posting()

menus::plugins_posting   mb  

Definition at line 3482 of file menus.tcl.

3482  proc plugins_posting {mb} {
3483 
3484  if {[::tke_development]} {
3485  $mb entryconfigure [format "%s..." [msgcat::mc "Export"]] -state [expr {[plugins::export_available] ? "normal" : "disabled"}]
3486  }
3487 
3488  }

§ rename_command()

menus::rename_command

Definition at line 866 of file menus.tcl.

866  proc rename_command {} {
867 
868  # Get the current name
869  gui::get_info {} current fname remote
870 
871  set old_name $fname
872  set new_name $fname
873  set selrange [utils::basename_range $fname]
874 
875  # Get the new name from the user
876  if {[gui::get_user_response [msgcat::mc "File Name:"] new_name -allow_vars 1 -selrange $selrange]} {
877 
878  # If the value of the cell hasn't changed or is empty, do nothing else.
879  if {($old_name eq $new_name) || ($new_name eq "")} {
880  return
881  }
882 
883  if {[catch { files::rename_file $old_name $new_name $remote} new_name]} {
884  gui::set_error_message [msgcat::mc "Unable to rename file"] $new_name
885  return
886  }
887 
888  # Add the file directory
889  sidebar::update_directory [sidebar::add_directory [file dirname $new_name] -remote $remote]
890 
891  # Update the old directory
892  if {[set sidebar_index [sidebar::get_index [file dirname $old_name] $remote]] ne ""} {
893  sidebar::update_directory $sidebar_index
894  }
895 
896  }
897 
898  }

§ restart_command()

menus::restart_command

Definition at line 3317 of file menus.tcl.

3317  proc restart_command {} {
3318 
3319  # Perform exit cleanup
3320  exit_cleanup
3321 
3322  # Execute the restart command
3323  if {[file tail [info nameofexecutable]] eq "tke.exe"} {
3324  exec [info nameofexecutable] &
3325  } else {
3326  exec [info nameofexecutable] [file normalize $::argv0] &
3327  }
3328 
3329  exit
3330 
3331  }

§ run_bist()

menus::run_bist

Definition at line 3305 of file menus.tcl.

3305  proc run_bist {} {
3306 
3307  # Source the bist.tcl file
3308  uplevel #0 [list source [file join $::tke_dir lib bist.tcl]]
3309 
3310  # Run bist
3311  bist::create
3312 
3313  }

§ save_as_command()

menus::save_as_command

Definition at line 782 of file menus.tcl.

782  proc save_as_command {} {
783 
784  # Get some of the save options
785  if {[set sfile [gui::prompt_for_save]] ne ""} {
786  gui::save_current -force 1 -save_as $sfile
787  }
788 
789  }

§ save_as_remote_command()

menus::save_as_remote_command

Definition at line 793 of file menus.tcl.

793  proc save_as_remote_command {} {
794 
795  set fname [file tail [gui::get_info {} current fname]]
796 
797  lassign [remote::create save $fname] connection sfile
798 
799  if {$sfile ne ""} {
800  gui::save_current -force 1 -save_as $sfile -remote $connection
801  }
802 
803  }

§ save_command()

menus::save_command

Definition at line 774 of file menus.tcl.

774  proc save_command {} {
775 
776  gui::save_current -force 1
777 
778  }

§ save_selection_as_command()

menus::save_selection_as_command

Definition at line 807 of file menus.tcl.

807  proc save_selection_as_command {} {
808 
809  # Get the filename
810  if {[set sfile [gui::prompt_for_save]] ne ""} {
811 
812  # Get the current text widget
813  set txt [gui::current_txt]
814 
815  # Save the current selection
816  edit::save_selection $txt [$txt index sel.first] [$txt index sel.last] 1 $sfile
817 
818  }
819 
820  }

§ select_mode()

menus::select_mode

Definition at line 1954 of file menus.tcl.

1954  proc select_mode {} {
1955 
1957 
1958  }

§ sessions_close_current()

menus::sessions_close_current

Definition at line 3418 of file menus.tcl.

3418  proc sessions_close_current {} {
3419 
3421 
3422  }

§ sessions_delete_launcher()

menus::sessions_delete_launcher

Definition at line 3442 of file menus.tcl.

3442  proc sessions_delete_launcher {} {
3443 
3444  set i 0
3445  foreach name [sessions::get_names] {
3446  launcher::register_temp "`SESSION:$name" [list sessions::delete $name] $name $i
3447  incr i
3448  }
3449 
3450  # Display the launcher in SESSION: mode
3451  launcher::launch "`SESSION:"
3452 
3453  }

§ sessions_posting()

menus::sessions_posting   mb  

Definition at line 3363 of file menus.tcl.

3363  proc sessions_posting {mb} {
3364 
3365  variable current_session
3366 
3367  # Get the list of sessions names
3368  set names [sessions::get_names]
3369 
3370  # Update the open, switch to, and delete menus
3371  $mb.switch delete 0 end
3372  $mb.delete delete 0 end
3373 
3374  set current_session $sessions::current_name
3375 
3376  foreach name $names {
3377  $mb.switch add radiobutton -label $name -variable sessions::current_name -value $name -command [list menus::main_only sessions::load "full" $name 0]
3378  $mb.delete add radiobutton -label $name -variable menus::current_session -value $name -command [list menus::main_only sessions::delete $name]
3379  }
3380 
3381  # If the current session is not set, disable the menu item
3382  if {[sessions::current] eq ""} {
3383  $mb entryconfigure [msgcat::mc "Close Current"] -state disabled
3384  $mb entryconfigure [msgcat::mc "Save Current"] -state disabled
3385  } else {
3386  $mb entryconfigure [msgcat::mc "Close Current"] -state normal
3387  $mb entryconfigure [msgcat::mc "Save Current"] -state normal
3388  }
3389 
3390  # If there are no names, disable the Open, Switch to and Delete menu commands
3391  if {[llength $names] == 0} {
3392  $mb entryconfigure [msgcat::mc "Switch To"] -state disabled
3393  $mb entryconfigure [msgcat::mc "Delete"] -state disabled
3394  } else {
3395  $mb entryconfigure [msgcat::mc "Switch To"] -state normal
3396  $mb entryconfigure [msgcat::mc "Delete"] -state normal
3397  }
3398 
3399  }

§ sessions_save_as()

menus::sessions_save_as

Definition at line 3434 of file menus.tcl.

3434  proc sessions_save_as {} {
3435 
3436  sessions::save "full"
3437 
3438  }

§ sessions_save_current()

menus::sessions_save_current

Definition at line 3426 of file menus.tcl.

3426  proc sessions_save_current {} {
3427 
3429 
3430  }

§ sessions_switch_launcher()

menus::sessions_switch_launcher

Definition at line 3403 of file menus.tcl.

3403  proc sessions_switch_launcher {} {
3404 
3405  set i 0
3406  foreach name [sessions::get_names] {
3407  launcher::register_temp "`SESSION:$name" [list sessions::load "full" $name 0] $name $i
3408  incr i
3409  }
3410 
3411  # Display the launcher in SESSION: mode
3412  launcher::launch "`SESSION:"
3413 
3414  }

§ set_code_folding()

menus::set_code_folding   ?value?  

Definition at line 3006 of file menus.tcl.

3006  proc set_code_folding {{value ""}} {
3007 
3008  variable code_folding
3009 
3010  # Get the current text widget
3011  set txt [gui::current_txt]
3012 
3013  # Set the fold enable value
3014  if {$value eq ""} {
3015  folding::set_fold_enable $txt $code_folding
3016  } else {
3017  folding::set_fold_enable $txt [set code_folding $value]
3018  }
3019 
3020  }

§ set_line_numbering()

menus::set_line_numbering   type  

Definition at line 2932 of file menus.tcl.

2932  proc set_line_numbering {type} {
2933 
2934  [gui::current_txt] configure -linemap_type $type
2935 
2936  }

§ set_line_wrapping()

menus::set_line_wrapping

Definition at line 2940 of file menus.tcl.

2940  proc set_line_wrapping {} {
2941 
2942  variable line_wrapping
2943 
2944  [gui::current_txt] configure -wrap [expr {$line_wrapping ? "word" : "none"}]
2945 
2946  }

§ set_pane_sync_indicator()

menus::set_pane_sync_indicator   value  

Definition at line 82 of file menus.tcl.

82  proc set_pane_sync_indicator {value} {
83 
84  variable sync_panes
85 
86  set sync_panes $value
87 
88  }

§ set_state()

menus::set_state   state  

Definition at line 112 of file menus.tcl.

112  proc set_state {state} {
113 
114  set last [.menubar index end]
115 
116  for {set i 0} {$i <= $last} {incr i} {
117  .menubar entryconfigure $i -state $state
118  }
119 
120  }

§ show_console_view()

menus::show_console_view   mb  

Definition at line 2843 of file menus.tcl.

2843  proc show_console_view {mb} {
2844 
2845  # Convert the menu command into the hide console command
2846  if {![catch {$mb entryconfigure [msgcat::mc "Show Tcl Console"] -label [msgcat::mc "Hide Tcl Console"] -command [list menus::main_only menus::hide_console_view $mb]}]} {
2848  }
2849 
2850  }

§ show_file_diff()

menus::show_file_diff

Definition at line 762 of file menus.tcl.

762  proc show_file_diff {} {
763 
764  # Get the current filename
765  gui::get_info {} current fname
766 
767  # Display the current file as a difference
768  gui::add_file end $fname -diff 1 -other [preferences::get View/ShowDifferenceInOtherPane]
769 
770  }

§ show_last_profiling_report()

menus::show_last_profiling_report

Definition at line 3220 of file menus.tcl.

3220  proc show_last_profiling_report {} {
3221 
3222  variable profile_report
3223 
3224  # If the profiling report exists, display it
3225  if {[file exists $profile_report]} {
3226  gui::add_file end $profile_report -lock 1 -sidebar 0
3227  }
3228 
3229  }

§ show_line_numbers()

menus::show_line_numbers   mb  

Definition at line 2909 of file menus.tcl.

2909  proc show_line_numbers {mb} {
2910 
2911  # Convert the menu command into the hide line numbers command
2912  if {![catch {$mb entryconfigure [msgcat::mc "Show Line Numbers"] -label [msgcat::mc "Hide Line Numbers"] -command [list menus::main_only menus::hide_line_numbers $mb]}]} {
2914  }
2915 
2916  }

§ show_marker_map()

menus::show_marker_map   mb  

Definition at line 2950 of file menus.tcl.

2950  proc show_marker_map {mb} {
2951 
2952  # Convert the menu command into the hide marker map command
2953  if {![catch {$mb entryconfigure [msgcat::mc "Show Marker Map"] -label [msgcat::mc "Hide Marker Map"] -command [list menus::main_only menus::hide_marker_map $mb]}]} {
2954  [winfo parent [gui::current_txt]].vb configure -markhide1 0
2955  }
2956 
2957  }

§ show_meta_chars()

menus::show_meta_chars   mb  

Definition at line 2972 of file menus.tcl.

2972  proc show_meta_chars {mb} {
2973 
2974  [gui::current_txt] configure -hidemeta 0
2975 
2976  }

§ show_sidebar_view()

menus::show_sidebar_view   mb  

Definition at line 2821 of file menus.tcl.

2821  proc show_sidebar_view {mb} {
2822 
2823  # Convert the menu command into the hide sidebar command
2824  if {![catch {$mb entryconfigure [msgcat::mc "Show Sidebar"] -label [msgcat::mc "Hide Sidebar"] -command [list menus::main_only menus::hide_sidebar_view $mb]}]} {
2826  }
2827 
2828  }

§ show_status_view()

menus::show_status_view   mb  

Definition at line 2887 of file menus.tcl.

2887  proc show_status_view {mb} {
2888 
2889  # Convert the menu command into the hide status bar command
2890  if {![catch {$mb entryconfigure [msgcat::mc "Show Status Bar"] -label [msgcat::mc "Hide Status Bar"] -command [list menus::main_only menus::hide_status_view $mb]}]} {
2892  }
2893 
2894  }

§ show_tab_view()

menus::show_tab_view   mb  

Definition at line 2865 of file menus.tcl.

2865  proc show_tab_view {mb} {
2866 
2867  # Convert the menu command into the hide tab bar command
2868  if {![catch {$mb entryconfigure [msgcat::mc "Show Tab Bar"] -label [msgcat::mc "Hide Tab Bar"] -command [list menus::main_only menus::hide_tab_view $mb]}]} {
2870  }
2871 
2872  }

§ start_profiling_command()

menus::start_profiling_command   mb  

Definition at line 3163 of file menus.tcl.

3163  proc start_profiling_command {mb} {
3164 
3165  if {[$mb entrycget [msgcat::mc "Start Profiling"] -state] eq "normal"} {
3166 
3167  # Turn on procedure profiling
3168  profile {*}[preferences::get Tools/ProfileReportOptions] on
3169 
3170  # Indicate that profiling mode is on
3171  $mb entryconfigure [msgcat::mc "Start Profiling"] -state disabled
3172  $mb entryconfigure [msgcat::mc "Stop Profiling"] -state normal
3173 
3174  # Indicate that profiling has started in the information bar
3175  gui::set_info_message [msgcat::mc "Profiling started"]
3176 
3177  }
3178 
3179  }

§ stop_profiling_command()

menus::stop_profiling_command   mb show_report  

Definition at line 3184 of file menus.tcl.

3184  proc stop_profiling_command {mb show_report} {
3185 
3186  variable profile_report
3187  variable profiling_info
3188 
3189  if {[$mb entrycget [msgcat::mc "Stop Profiling"] -state] eq "normal"} {
3190 
3191  puts "Turning profiling off!"
3192  puts [utils::stacktrace]
3193 
3194  # Turn off procedure profiling
3195  profile off profiling_info
3196 
3197  # Generate a report file
3199  # set sortby [preferences::get Tools/ProfileReportSortby]
3200  # profrep profiling_info $sortby $profile_report "Profiling Information Sorted by $sortby"
3201 
3202  # Indicate that profiling has completed
3203  gui::set_info_message [msgcat::mc "Profiling stopped"]
3204 
3205  # Add the report to the tab list
3206  if {$show_report} {
3208  }
3209 
3210  # Indicate that profiling mode is off
3211  $mb entryconfigure [msgcat::mc "Stop Profiling"] -state disabled
3212  $mb entryconfigure [msgcat::mc "Start Profiling"] -state normal
3213 
3214  }
3215 
3216  }

§ sync_panes()

menus::sync_panes

Definition at line 2996 of file menus.tcl.

2996  proc sync_panes {} {
2997 
2998  variable sync_panes
2999 
3000  gui::set_pane_sync $sync_panes
3001 
3002  }

§ text_only()

menus::text_only   cmd args  

Definition at line 125 of file menus.tcl.

125  proc text_only {cmd args} {
126 
127  if {[set has_focus [focus]] ne ""} {
128  gui::get_info {} current txt txt2
129  if {($has_focus eq "$txt.t") || ($has_focus eq "$txt2.t")} {
130  uplevel #0 [list $cmd {*}$args]
131  }
132  }
133 
134  }

§ theme_edit_command()

menus::theme_edit_command

Definition at line 3154 of file menus.tcl.

3154  proc theme_edit_command {} {
3155 
3156  # Edit the current theme
3158 
3159  }

§ tools_posting()

menus::tools_posting   mb  

Definition at line 3125 of file menus.tcl.

3125  proc tools_posting {mb} {
3126 
3127  variable profile_report
3128 
3129  if {[::tke_development]} {
3130 
3131  catch {
3132  if {[file exists $profile_report]} {
3133  $mb entryconfigure [msgcat::mc "Show Last Profiling Report"] -state normal
3134  } else {
3135  $mb entryconfigure [msgcat::mc "Show Last Profiling Report"] -state disabled
3136  }
3137  }
3138 
3139  # Handle the state of the Show/Hide Console entry (if it exists)
3140  if {[winfo exists .tkcon]} {
3141  if {[winfo ismapped .tkcon]} {
3142  catch { $mb entryconfigure [msgcat::mc "Show Tcl Console"] -label [msgcat::mc "Hide Tcl Console"] -command [list menus::main_only menus::hide_console_view $mb]}
3143  } else {
3144  catch { $mb entryconfigure [msgcat::mc "Hide Tcl Console"] -label [msgcat::mc "Show Tcl Console"] -command [list menus::main_only menus::show_console_view $mb]}
3145  }
3146  }
3147 
3148  }
3149 
3150  }

§ unfavorite_command()

menus::unfavorite_command   mb  

Definition at line 1020 of file menus.tcl.

1020  proc unfavorite_command {mb} {
1021 
1022  # Get current file information
1023  gui::get_info {} current fileindex fname
1024 
1025  # Get the current file index (if one exists)
1026  if {$fileindex != -1} {
1027 
1028  # Remove the file as a favorite
1029  if {[favorites::remove $fname]} {
1030 
1031  $mb entryconfigure [msgcat::mc "Unfavorite"] -label [msgcat::mc "Favorite"] -command [list menus::text_only menus::favorite_command $mb]
1032 
1033  }
1034 
1035  }
1036 
1037  }

§ unindent_command()

menus::unindent_command

Definition at line 1970 of file menus.tcl.

1970  proc unindent_command {} {
1971 
1973 
1974  }

§ unlock_command()

menus::unlock_command   mb  

Definition at line 984 of file menus.tcl.

984  proc unlock_command {mb} {
985 
986  # Unlock the current file
987  if {[gui::set_current_file_lock 0]} {
988 
989  # Set the menu up to display the lock file menu option
990  $mb entryconfigure [msgcat::mc "Unlock"] -label [msgcat::mc "Lock"] -command [list menus::text_only menus::lock_command $mb]
991 
992  }
993 
994  }

§ view_fold_posting()

menus::view_fold_posting   mb  

Definition at line 2780 of file menus.tcl.

2780  proc view_fold_posting {mb} {
2781 
2782  variable code_folding
2783 
2784  # Get the current text widget
2785  set txt [gui::current_txt]
2786  set state [folding::fold_state $txt [lindex [split [$txt index insert] .] 0]]
2787  set code_folding [folding::get_enable $txt]
2788  set sel_state [expr {([$txt tag ranges sel] ne "") ? "normal" : "disabled"}]
2789 
2790  if {[folding::get_method $txt] eq "manual"} {
2791  $mb entryconfigure [msgcat::mc "Create Fold From Selection"] -state $sel_state
2792  $mb entryconfigure [msgcat::mc "Delete Selected Folds"] -state $sel_state
2793  $mb entryconfigure [msgcat::mc "Delete Current Fold"] -state normal
2794  $mb entryconfigure [msgcat::mc "Delete All Folds"] -state normal
2795  } else {
2796  $mb entryconfigure [msgcat::mc "Create Fold From Selection"] -state disabled
2797  $mb entryconfigure [msgcat::mc "Delete Selected Folds"] -state disabled
2798  $mb entryconfigure [msgcat::mc "Delete Current Fold"] -state disabled
2799  $mb entryconfigure [msgcat::mc "Delete All Folds"] -state disabled
2800  }
2801 
2802  $mb entryconfigure [msgcat::mc "Close Selected Folds"] -state $sel_state
2803  $mb entryconfigure [msgcat::mc "Open Selected Folds"] -state $sel_state
2804 
2805  if {$state eq "open"} {
2806  $mb entryconfigure [msgcat::mc "Close Current Fold"] -state normal
2807  } else {
2808  $mb entryconfigure [msgcat::mc "Close Current Fold"] -state disabled
2809  }
2810 
2811  if {$state eq "close"} {
2812  $mb entryconfigure [msgcat::mc "Open Current Fold"] -state normal
2813  } else {
2814  $mb entryconfigure [msgcat::mc "Open Current Fold"] -state disabled
2815  }
2816 
2817  }

§ view_posting()

menus::view_posting   mb  

Definition at line 2663 of file menus.tcl.

2663  proc view_posting {mb} {
2664 
2665  variable show_split_pane
2666  variable show_birdseye
2667  variable line_numbering
2668  variable line_wrapping
2669 
2670  if {([gui::tabs_in_pane] < 2) && ([gui::panes] < 2)} {
2671  $mb entryconfigure [msgcat::mc "Tabs"] -state disabled
2672  } else {
2673  $mb entryconfigure [msgcat::mc "Tabs"] -state normal
2674  }
2675 
2676  if {[gui::panes] < 2} {
2677  $mb entryconfigure [msgcat::mc "Panes"] -state disabled
2678  } else {
2679  $mb entryconfigure [msgcat::mc "Panes"] -state normal
2680  }
2681 
2682  if {[gui::current_txt] eq ""} {
2683  catch { $mb entryconfigure [msgcat::mc "Show Line Numbers"] -state disabled}
2684  catch { $mb entryconfigure [msgcat::mc "Hide Line Numbers"] -state disabled}
2685  catch { $mb entryconfigure [msgcat::mc "Line Numbering"] -state disabled}
2686  $mb entryconfigure [msgcat::mc "Line Wrapping"] -state disabled
2687  catch { $mb entryconfigure [msgcat::mc "Show Marker Map"] -state disabled}
2688  catch { $mb entryconfigure [msgcat::mc "Hide Marker Map"] -state disabled}
2689  catch { $mb entryconfigure [msgcat::mc "Show Meta Characters"] -state disabled}
2690  catch { $mb entryconfigure [msgcat::mc "Hide Meta Characters"] -state disabled}
2691  $mb entryconfigure [msgcat::mc "Display Text Info"] -state disabled
2692  $mb entryconfigure [msgcat::mc "Split View"] -state disabled
2693  $mb entryconfigure [msgcat::mc "Bird's Eye View"] -state disabled
2694  $mb entryconfigure [msgcat::mc "Move to Other Pane"] -state disabled
2695  if {[tk windowingsystem] ne "aqua"} {
2696  $mb entryconfigure [msgcat::mc "Set Syntax"] -state disabled
2697  }
2698  $mb entryconfigure [msgcat::mc "Folding"] -state disabled
2699  } else {
2700  gui::get_info {} current tab txt
2701  catch { $mb entryconfigure [msgcat::mc "Show Line Numbers"] -state normal}
2702  catch { $mb entryconfigure [msgcat::mc "Hide Line Numbers"] -state normal}
2703  catch { $mb entryconfigure [msgcat::mc "Line Numbering"] -state normal}
2704  $mb entryconfigure [msgcat::mc "Line Wrapping"] -state normal
2705  if {[markers::exists $tab]} {
2706  catch { $mb entryconfigure [msgcat::mc "Show Marker Map"] -state normal}
2707  catch { $mb entryconfigure [msgcat::mc "Hide Marker Map"] -state normal}
2708  } else {
2709  catch { $mb entryconfigure [msgcat::mc "Show Marker Map"] -state disabled}
2710  catch { $mb entryconfigure [msgcat::mc "Hide Marker Map"] -state disabled}
2711  }
2712  if {[llength [[gui::current_txt] syntax metaclasses]] > 0} {
2713  if {[[gui::current_txt] cget -hidemeta] == 0} {
2714  set lbl [msgcat::mc "Hide Meta Characters"]
2715  set cmd [list menus::main_only menus::hide_meta_chars $mb]
2716  } else {
2717  set lbl [msgcat::mc "Show Meta Characters"]
2718  set cmd [list menus::main_only menus::show_meta_chars $mb]
2719  }
2720  catch { $mb entryconfigure [msgcat::mc "Show Meta Characters"] -label $lbl -command $cmd -state normal}
2721  catch { $mb entryconfigure [msgcat::mc "Hide Meta Characters"] -label $lbl -command $cmd -state normal}
2722  } else {
2723  catch { $mb entryconfigure [msgcat::mc "Show Meta Characters"] -state disabled}
2724  catch { $mb entryconfigure [msgcat::mc "Hide Meta Characters"] -state disabled}
2725  }
2726  $mb entryconfigure [msgcat::mc "Display Text Info"] -state normal
2727  $mb entryconfigure [msgcat::mc "Split View"] -state normal
2728  $mb entryconfigure [msgcat::mc "Bird's Eye View"] -state normal
2730  $mb entryconfigure [msgcat::mc "Move to Other Pane"] -state normal
2731  } else {
2732  $mb entryconfigure [msgcat::mc "Move to Other Pane"] -state disabled
2733  }
2734  if {[tk windowingsystem] ne "aqua"} {
2735  $mb entryconfigure [msgcat::mc "Set Syntax"] -state normal
2736  }
2737  $mb entryconfigure [msgcat::mc "Folding"] -state normal
2738  gui::get_info {} current txt2 beye
2739  set show_split_pane [winfo exists $txt2]
2740  set show_birdseye [winfo exists $beye]
2741 
2742  # Get the current line numbering
2743  set line_numbering [[gui::current_txt] cget -linemap_type]
2744 
2745  # Get the current line wrapping
2746  set line_wrapping [expr {[[gui::current_txt] cget -wrap] eq "word"}]
2747 
2748  }
2749 
2750  }

§ view_tabs_posting()

menus::view_tabs_posting   mb  

Definition at line 2755 of file menus.tcl.

2755  proc view_tabs_posting {mb} {
2756 
2757  if {[gui::tabs_in_pane] < 2} {
2758  $mb entryconfigure [msgcat::mc "Goto Next Tab"] -state disabled
2759  $mb entryconfigure [msgcat::mc "Goto Previous Tab"] -state disabled
2760  $mb entryconfigure [msgcat::mc "Goto Last Tab"] -state disabled
2761  $mb entryconfigure [msgcat::mc "Sort Tabs"] -state disabled
2762  } else {
2763  $mb entryconfigure [msgcat::mc "Goto Next Tab"] -state normal
2764  $mb entryconfigure [msgcat::mc "Goto Previous Tab"] -state normal
2765  $mb entryconfigure [msgcat::mc "Goto Last Tab"] -state normal
2766  $mb entryconfigure [msgcat::mc "Sort Tabs"] -state normal
2767  }
2768 
2769  if {[gui::panes] < 2} {
2770  $mb entryconfigure [msgcat::mc "Goto Other Pane"] -state disabled
2771  } else {
2772  $mb entryconfigure [msgcat::mc "Goto Other Pane"] -state normal
2773  }
2774 
2775  }