/****************************** Module Header ******************************* * * Module Name: prefspopup.e * * Copyright (c) Netlabs EPM Distribution Project 2002 * * $Id$ * * =========================================================================== * * This file is part of the Netlabs EPM Distribution package and is free * software. You can redistribute it and/or modify it under the terms of the * GNU General Public License as published by the Free Software * Foundation, in version 2 as it comes in the "COPYING" file of the * Netlabs EPM Distribution. This library is distributed in the hope that it * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * ****************************************************************************/ compile if not defined( SMALL) -- If SMALL not defined, then being separately EA_comment 'This defines the preferences popup menu.' define INCLUDING_FILE = 'PREFSPOPUP.E' include 'stdconst.e' include 'menuhelp.h' const tryinclude 'mycnf.e' const compile if not defined( NLS_LANGUAGE) NLS_LANGUAGE = 'ENGLISH' compile endif include NLS_LANGUAGE'.e' compile endif ; --------------------------------------------------------------------------- const ; Also added to ENGLISH.E compile if not defined( NEWLINE_KEY__MSG) NEWLINE_KEY__MSG = 'Newline' compile endif ; -------------------------------------------------------------------------------------- Preferences ------------------ const compile if not defined( PRESET_BITSTR_USER_CUA) PRESET_BITSTR_USER_CUA = 011100000 compile endif compile if not defined( PRESET_BITSTR_PROG_CUA) PRESET_BITSTR_PROG_CUA = 101111111 compile endif compile if not defined( PRESET_BITSTR_PROG_STD) PRESET_BITSTR_PROG_STD = 100011111 compile endif compile if not defined( MARKING_BITSTR_ADV) MARKING_BITSTR_ADV = '???01 0? ?0?? 1 ??' compile endif compile if not defined( MARKING_BITSTR_CUA) MARKING_BITSTR_CUA = 'C0A10 10 C1W? 0 ??' compile endif ; --------------------------------------------------------------------------- defc PrefsPopupMenu universal activemenu universal nodismiss -- 0 | 32 MenuName = 'prefspopup' -- 'preferences' is already used by the edit menu item activemenu = MenuName call SetMenuAVar( 'mid_'MenuName, 90) call SetMenuAVar( 'popupmids', '') deletemenu MenuName, 0, 0, 0 DefSubMenu( MenuName, '') DefNextItemStartsSubMenu() DefMenuItem( 'basicconfig', -- Basic configuration > 'Basic con~figuration', '', 'Set basic configuration', '', nodismiss) DefMenuItem( '', -- Presets 'Presets', '', '', '', 'STATIC') DefMenuItem( 'presetusercua', -- User, CUA '~User, CUA', 'ApplyPresetBitStr' PRESET_BITSTR_USER_CUA, 'Reset to standard user settings with CUA keyset', '', nodismiss) DefMenuItem( 'presetprogcua', -- Programmer, CUA (default) '~Programmer, CUA (default)', 'ApplyPresetBitStr' PRESET_BITSTR_PROG_CUA, 'Reset to programmer settings with CUA keyset', '', nodismiss) DefMenuItem( 'presetprogstd', -- Programmer, standard EPM 'Programmer, standard ~EPM', 'ApplyPresetBitStr' PRESET_BITSTR_PROG_STD, 'Reset to standard EPM settings with line mode', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Main items 'Main items', '', '', '', 'STATIC') DefMenuItem( 'advancedmarking2', -- Advanced marking '~Advanced marking', 'TogglePresetBit 1', 'Activate advanced marking - non-destructive, more operations with support for > 64 KB within EPM', HP_OPTIONS_CUATOGGLE, nodismiss) DefMenuItem( 'cuamarking2', -- CUA marking '~CUA marking', 'TogglePresetBit 2', 'Activate basic marking - destructive, uses clipboard with a maximum of 64 KB', HP_OPTIONS_CUATOGGLE, nodismiss) DefMenuItem( 'cuakeyset', -- CUA keyset 'CUA ~keyset', 'TogglePresetBit 3', 'Toggle between CUA keys and standard EPM keys', '', nodismiss) DefMenuItem( 'defaultstreammode2', -- Stream mode '~Stream mode', 'TogglePresetBit 4', 'Toggle between stream and line editing mode', HP_OPTIONS_STREAM, nodismiss) DefMenuItem( 'cursoreverywhere2', -- Allow cursor everywhere 'Allow cu~rsor everywhere', 'TogglePresetBit 5', 'Cursor can be positioned after line end', '', nodismiss) DefMenuItem( 'homeendtoggle', -- Home and End keys toggle '~Home and End keys toggle', 'TogglePresetBit 6', 'Toggle between text and line boundaries', '', nodismiss) DefMenuItem( 'blockaltletterkeys2', -- Block Alt+letter keys from jumping to menu bar '~Block Alt+letter keys from jumping to menu bar', 'TogglePresetBit 7', 'Enable for advanced mark operations (Ctrl+Alt+Shift+letter works for menu)', HP_OPTIONS_CUAACCEL, nodismiss) DefMenuItem( 'syntaxexpansion2', -- Syntax expansion 'S~yntax expansion', 'TogglePresetBit 8', 'Let %1 and %2 do syntax expansion', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'matchbrackets', -- Match brackets '~Match brackets', 'TogglePresetBit 9', 'Highlight brackets and insert bracket pairs on typing', '', nodismiss) DefMenuSep() -------------------- add_prefs_loadfiles() add_prefs_editfiles() add_prefs_saveandrestore() add_prefs_appearance() DefMenuSep() -------------------- DefNextItemStartsSubMenu() DefMenuItem( '', -- User settings > '~User settings', '', 'Export and import settings', '', nodismiss) DefMenuItem( '', -- Export user settings 'Export ~user settings', 'ExportConfig u \NEPMD\User 0', 'Export user settings to a text file for later import', '', nodismiss) DefMenuItem( '', -- Export history lists 'Export ~history lists', 'ExportHistory', 'Export history lists to text files for later import', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Export user and default mode settings 'Export user and default ~mode settings', 'ExportConfig ud_mode \NEPMD\User\Mode\ 1', 'Export user and default mode settings to a text file for later import', '', nodismiss) DefMenuItem( '', -- Export user and default coding styles 'Export user and default ~coding styles', 'ExportConfig ud_coding \NEPMD\User\CodingStyles 1', 'Export user and default coding styles to a text file for later import', '', nodismiss) DefMenuItem( '', -- Export user and default settings 'Export user and ~default settings', 'ExportConfig ud \NEPMD\User 1', 'Export user and default settings to a text file for later import', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Import user settings... '~Import user settings...', 'ImportUserConfig', 'Select a text file with user settings to import', '', nodismiss) DefMenuItem( '', -- Import history list... 'Import history ~list...', 'ImportHistory', 'Select a text file with history entries to import', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Delete user settings... '~Delete user settings...', 'DeleteUserSettings', 'Delete all user settings', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( '', -- Delete history lists... 'D~elete history lists...', 'DeleteHistoryLists', 'Delete all existing Edit, Load, Save and Last lists', '', nodismiss) if nodismiss <> 0 then DefMenuSep() -------------------- DefMenuItem( '', -- Close menu 'C~lose menu', 'mc ;SetFocusToEditClient;HighlightCursor', '', '') endif -- nodismiss <> 0 showmenu menuname, 1 -- 0 = standard menu (default for missing parameter), 1 = popup menu, 2 = undefined, 3 = UC menu (toolbar) -- Workaround: This ensures that the configured menu font is set for the -- menu and not a dropped font. Without font dropping, it works without -- this workaround. 'PostMe SetMenuFont 'MenuName -- This highlights the cursor below the popup menu. 'PostMe HighlightCursor' ; --------------------------------------------------------------------------- defproc add_prefs_loadfiles universal nodismiss universal wpsstarted DefMenuItem( '', -- Load files 'Load files', '', '', '', 'STATIC') if wpsstarted then DefNextItemStartsSubMenu() DefMenuItem( 'prg', -- Program objects > 'Program ob~jects', '', '', '', '') DefMenuItem( 'prgnewwindow', -- Open in same window 'Open in ~same window (/r)', 'toggle_new_same_window', 'Open file objects in topmost EPM window', '', nodismiss) DefMenuItem( 'prgomitopenbox', -- File open selection: ~Omit open box (/o) 'File open selection: ~Omit open box (/o)', 'toggle_omit_openbox', 'Show file dialog directly instead of history list first', '', nodismiss) DefMenuItem( '', -- Set startup dir... 'Set startup ~dir...', 'StartupDirDlg', 'Select startup dir for several EPM objects', '', '') DefNextItemEndsSubMenu() DefMenuItem( '', -- Set associations... 'Set ~associations...', 'SelectAssoc', 'Configure WPS associations for EPM objects', '', '') endif -- wpsstarted DefNextItemStartsSubMenu() DefMenuItem( 'directories', -- Directories > '~Directories', '', '', '', '') DefMenuItem( '', -- Set work dir 'Set work dir', '', '', '', 'STATIC') DefMenuItem( 'workdirprogram', -- By program object 'By program ~object', 'ChangeWorkDirMenuCmd 0', 'This is EPM''s default', '', nodismiss) DefMenuItem( 'workdirprev', -- Use previous work dir 'Use ~previous work dir', 'ChangeWorkDirMenuCmd 1', 'Keep work dir across EPM sessions', '', nodismiss) DefMenuItem( 'workdirfile', -- To dir of selected file 'To dir of ~selected file', 'ChangeWorkDirMenuCmd 2', 'Change to dir of current file', '', nodismiss) DefMenuItem( '', -- To... '~To...', 'CDDlg', 'Show/change current work dir now', '') DefMenuSep() -------------------- DefMenuItem( '', -- Start Edit/Add file dialog at 'Start Edit/Add file dialog at', '', '', '', 'STATIC') DefMenuItem( 'opendlgdirprev', -- Previous dir '~Previous dir', 'OpenDlgDirMenuCmd 0', 'Start at dir from last Open dialog', '', nodismiss) DefMenuItem( 'opendlgdirwork', -- Work dir '~Work dir', 'OpenDlgDirMenuCmd 1', 'Start at work dir', '', nodismiss) DefMenuItem( 'opendlgdirfile', -- Dir of current file '~Dir of current file', 'OpenDlgDirMenuCmd 2', 'Start at dir of current file', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Start Save-as dialog for virtual files at 'Start Save-as dialog for virtual files at', '', '', '', 'STATIC') DefMenuItem( 'saveasdlgdirprev', -- Previous dir '~Previous dir', 'SaveasDlgDirMenuCmd 0', 'Start at dir from last saved file', '', nodismiss) DefMenuItem( 'saveasdlgdirwork', -- Work dir '~Work dir', 'SaveasDlgDirMenuCmd 1', 'Start at work dir', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Edit MYEPM.ENV 'Edit ~MYEPM.ENV', 'EditCreateMyepmEnv', 'Edit user environment file. This file is loaded additionally to EPM.ENV.', '', '') DefNextItemEndsSubMenu() DefMenuItem( '', -- Edit EPM.ENV 'Edit ~EPM.ENV', 'EditCreateUserFile bin\epm.env', 'Edit environment file', '', '') DefNextItemStartsSubMenu() DefMenuItem( 'editoptions', -- Edit options > '~Edit options: %1', '', 'View/change default edit options', '', nodismiss) DefMenuItem( 'editoptions_b', -- /b search both: ring and disk '/~b'\9'search both: ring and disk*', 'EditOptionsMenuCmd /b', '', '', nodismiss) DefMenuItem( 'editoptions_c', -- /c create a new file '/~c'\9'create a new file', 'EditOptionsMenuCmd /c', '', '', nodismiss) DefMenuItem( 'editoptions_d', -- /d create new if on disk '/~d'\9'create new if on disk', 'EditOptionsMenuCmd /d', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'editoptions_nt', -- /nt expand tabs (tabs = 8) '/~nt'\9'expand tabs (tabs = 8)', 'EditOptionsMenuCmd /nt', '', '', nodismiss) DefMenuItem( 'editoptions_t', -- /t don't expand tabs* '/~t'\9'don''t expand tabs*', 'EditOptionsMenuCmd /t', '', '', nodismiss) ; In EPM 6 there's no difference between /u and /l anymore. ; EPM breaks lines at CRCRLF, CRLF, CR and LF, not dependent on /u or /l. ; EPM adds CRLF when Enter is pressed. That can't be changed with an option. ; /u and /l are senseless now. ; Per default all line ends are kept as on file loading. Even 'unterminated' ; is possible for the last line. (But it's not visible, if the last line is ; terminated or not. EPM won't add a blank line, if the last line is terminated.) ; Line ends can be forced to CRLF or CR on save. That applies also to the last line. ; DefMenuSep() -------------------- ; ; DefMenuItem( 'editoptions_u', -- ; '/~u'\9'Unix line end (LF)', ; 'EditOptionsMenuCmd /u', ; '', ; '') ; DefMenuItem( 'editoptions_l', -- ; '/~l'\9'DOS line end (CRLF)*', ; 'EditOptionsMenuCmd /l', ; '', ; '') DefMenuSep() -------------------- DefMenuItem( '', -- Reset to initial default (*) ''\9'~Reset to initial default (*)', 'EditOptionsMenuCmd RESET', '', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( '', -- Save as default ''\9'Sa~ve as default', 'EditOptionsMenuCmd SAVE', '', '', NoDisMiss) DefMenuSep() -------------------- ; --------------------------------------------------------------------------- defproc add_prefs_editfiles universal nodismiss DefMenuItem( '', -- Edit files 'Edit files', '', '', '', 'STATIC') DefNextItemStartsSubMenu() DefMenuItem( 'markingsettings', -- Marking > 'Markin~g', '', '', '', nodismiss) DefMenuItem( '', -- Marking presets 'Marking presets', '', '', '', 'STATIC') DefMenuItem( 'advancedmarking', -- Advanced marking '~Advanced marking', 'SwitchMarkingMode A', 'Activate advanced marking - non-destructive, more operations with support for > 64 KB within EPM', HP_OPTIONS_CUATOGGLE, nodismiss) DefMenuItem( 'cuamarking', -- CUA marking '~CUA marking', 'SwitchMarkingMode C', 'Activate basic marking - destructive, uses clipboard with a maximum of 64 KB', HP_OPTIONS_CUATOGGLE, nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Mark 'Mark', '', '', '', 'STATIC') DefMenuItem( 'defaultpaste', -- Default paste: [%1] 'Default ~paste: [%1]', 'SwitchMarkingBit 1 T', 'Style for Sh+Ins/Alt+MB1, add Ctrl/Sh for alt. paste', '', nodismiss) DefMenuItem( 'shiftmarkextends', -- Sh-mark always extends mark '~Sh-mark always extends mark', 'SwitchMarkingBit 2 T', 'Extend mark always or just at boundaries', '', nodismiss) DefMenuItem( 'lineinsert', -- Insert marked lines: [%1] 'Insert marked ~lines: [%1]', 'SwitchMarkingBit 3 T', 'Line mark: insert below (standard EPM) or above current line', '', nodismiss) DefMenuItem( 'replacemark', -- Replace mark '~Replace mark', 'SwitchMarkingBit 4 T', 'Overwrite mark with newly inserted text - disable this for non-destructive insertion', '', nodismiss) DefMenuItem( 'directmarkactions', -- Direct mark actions (shared buffer) '~Direct mark actions (shared buffer)', 'SwitchMarkingBit 5 T', 'Copy & paste is done in one pass - supports copying > 64 KB and attributes', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Unmark 'Unmark ('strip( MenuAccelString( 'UnMark'), 'L', \9)')', '', '', '', 'STATIC') DefMenuItem( 'unmarkonanykey', -- Unmark on any key '~Unmark on any key', 'SwitchMarkingBit 6 T', 'Unmark on any key and on cursor move - disable this for non-destructive marking', '', nodismiss) DefMenuItem( 'unmarkaftermove', -- Unmark after move 'Unmark after mo~ve', 'SwitchMarkingBit 7 T', 'Unmark after doing a move mark', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Mouse mark 'Mouse mark', '', '', '', 'STATIC') DefMenuItem( 'defaultmousemark', -- Default mouse mark: [%1] 'Default m~ouse mark: [%1]', 'SwitchMarkingBit 8 T', 'Mark definition for MB1, use Ctrl+MB1 or MB3 for alt. mark', '', nodismiss) DefMenuItem( 'gotomousemark', -- Cursor to end of mouse mark 'Cursor to ~end of mouse mark', 'SwitchMarkingBit 9 T', 'Move the cursor to the pos. where the mouse button is released after a mouse mark', '', nodismiss) DefMenuItem( 'doubleclickmarks', -- MB 1 double click: [%1] 'M~B 1 double click: [%1]', 'SwitchMarkingBit 10 T', 'Select double click behavior', '', nodismiss) DefMenuItem( '4os2mousemark', -- 4os2 mouse marking '~4os2 mouse marking', 'SwitchMarkingBit 11 T', 'Copy: begin with MB 1 marking, at the end press MB 2 additionally - Paste: press MB 1 and MB 2', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Mouse unmark 'Mouse unmark', '', '', '', 'STATIC') DefMenuItem( 'doubleclickunmarks', -- MB 1 double click on space 'MB ~1 double click on space', 'SwitchMarkingBit 12 T', 'Double click anywhere after line end to unmark', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Search 'Search', '', '', '', 'STATIC') DefMenuItem( 'searchinmark', -- Search in multi-line mark if file is marked 'Search in ~multi-line mark if file is marked', 'SwitchMarkingBit 13 T', 'If file is marked, activate search in mark and from top', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'searchmarkedwords', -- Use marked words as search string 'Use marked ~words as search string', 'SwitchMarkingBit 14 T', 'If words are marked, overtake them as search string for the search dialog', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'keysmouse', -- Keys and mouse > '~Keys and mouse', '', 'Configure key bindings, special keys and mouse', '', '') DefMenuItem( '', -- Keysets 'Keysets', '', '', '', 'STATIC') DefMenuItem( 'keydefs', -- Keyset additions: %1... 'Keyset ~additions: %1...', 'SelectKeyDefs', 'Configure key def additions to the standard keyset', '', '') DefMenuItem( '', -- Edit STDKEYS.E '~Edit STDKEYS.E', 'EditCreateUserMacro stdkeys.e', 'Edit entire set of key definitions', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Home and End 'Home and End', '', '', '', 'STATIC') DefMenuItem( 'hometoggles', -- Home key toggles begin text and begin line '~Home key toggles begin text and begin line', 'toggle_home_toggles', '', '', nodismiss) DefMenuItem( 'endtoggles', -- End key toggles end text and column after text '~End key toggles end text and column after text', 'toggle_end_toggles', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Syntax expansion 'Syntax expansion', '', '', '', 'STATIC') DefMenuItem( 'syntaxexpansionkeys', -- Keys for syntax expansion %1... 'Keys for s~yntax expansion: %1...', 'SelectExpandKeys', 'Select e.g. "space newline" or "c_space c_newline"', '') DefMenuSep() -------------------- DefMenuItem( '', -- Alt 'Alt', '', '', '', 'STATIC') DefMenuItem( 'blockaltletterkeys', -- Block Alt+letter keys from jumping to menu bar '~Block Alt+letter keys from jumping to menu bar', 'accel_toggle', 'Enable for advanced mark operations (Ctrl+Alt+Shift+letter works for menu)', HP_OPTIONS_CUAACCEL, nodismiss) DefMenuItem( 'blockleftaltkey', -- Block left Alt key from jumping to menu bar 'Block ~left Alt key from jumping to menu bar', 'toggle_block_left_alt_key', 'When enabled, use F10', '', nodismiss) DefMenuItem( 'blockrightaltkey', -- Block right Alt key from jumping to menu bar 'Block ~right Alt key from jumping to menu bar', 'toggle_block_right_alt_key', 'When enabled, use F10', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Mouse 'Mouse', '', '', '', 'STATIC') DefMenuItem( 'defaultmousemark2', -- Default mouse mark: [%1] 'Default ~mouse mark: [%1]', 'SwitchMarkingBit 8 T', 'Mark definition for MB1, use Ctrl+MB1 or MB3 for alt. mark', '', nodismiss) DefMenuItem( 'gotomousemark2', -- Cursor to end of mouse mark 'Cursor to ~end of mouse mark', 'SwitchMarkingBit 9 T', 'Place the cursor to the pos. where the mouse button is released after a mouse mark', '', nodismiss) DefMenuItem( 'doubleclickmarks2', -- MB 1 double click: [%1] 'MB 1 double click: [%1]', 'SwitchMarkingBit 10 T', 'Select double click behavior', '', nodismiss) DefMenuItem( '4os2mousemark2', -- 4os2 mouse marking '~4os2 mouse marking', 'SwitchMarkingBit 11 T', 'Copy: begin with MB 1 marking, at the end press MB 2 additionally - Paste: press MB 1 and MB 2', '', nodismiss) DefMenuItem( 'doubleclickunmarks2', -- MB 1 double click on space unmarks 'MB 1 double click on space ~unmarks', 'SwitchMarkingBit 11 T', 'Double click anywhere after line end to unmark', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'clickonlygivesfocus', -- Click only gives focus '~Click only gives focus', 'toggle_ClickOnlyGivesFocus', 'When enabled, the cursor is placed at the second click only', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'streamnewline', -- Stream and Newline > 'Stream and Ne~wline', '', 'Switch stream/line mode and define newline and enter', '', nodismiss) DefMenuItem( 'defaultstreammode', -- Stream mode '~Stream mode', 'toggle_default_stream', 'Toggle between stream and line editing mode', HP_OPTIONS_STREAM, nodismiss) DefMenuItem( 'newlineenter', -- Configure [%1] keys: 'Configure [%1] keys:', 'toggle_newlineenter', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'newline', -- Newline in stream mode '', '', '', '', 'STATIC') DefMenuItem( 'newlinesplit', -- Line and split: [%1] 'Line and split: [%1]', 'toggle_newlinesplit newline', 'Hold 'CTRL_KEY__MSG' to configure cmd', '', nodismiss) DefMenuItem( 'newlinecol', -- Cursor column: [%1] 'Cursor column: [%1]', 'toggle_newlinecol newline', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 's_newline', -- Sh+Newline in stream mode '', '', '', '', 'STATIC') DefMenuItem( 's_newlinesplit', -- Line and split: [%1] 'Line and split: [%1]', 'toggle_newlinesplit s_newline', 'Hold 'CTRL_KEY__MSG' to configure cmd', '', nodismiss) DefMenuItem( 's_newlinecol', -- Cursor column: [%1] 'Cursor column: [%1]', 'toggle_newlinecol s_newline', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'a_newline', -- Alt+Newline in stream mode '', '', '', '', 'STATIC') DefMenuItem( 'a_newlinesplit', -- Line and split: [%1] 'Line and split: [%1]', 'toggle_newlinesplit a_newline', 'Hold 'CTRL_KEY__MSG' to configure cmd', '', nodismiss) DefMenuItem( 'a_newlinecol', -- Cursor column: [%1] 'Cursor column: [%1]', 'toggle_newlinecol a_newline', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'c_newline', -- Ctrl+Newline in stream mode '', '', '', '', 'STATIC') DefMenuItem( 'c_newlinesplit', -- Line and split: [%1] 'Line and split: [%1]', 'toggle_newlinesplit c_newline', 'Hold 'CTRL_KEY__MSG' to configure cmd', '', nodismiss) DefMenuItem( 'c_newlinecol', -- Cursor column: [%1] 'Cursor column: [%1]', 'toggle_newlinecol c_newline', '', '', nodismiss) DefMenuSep() -------------------- DefNextItemEndsSubMenu() DefMenuItem( '', -- Reset all Newline and PadEnter key definitions 'Reset all 'NEWLINE_KEY__MSG' and 'ENTER_KEY__MSG' key definitions', 'ResetNewlineKeyDefs', '', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'tabsandmargins', -- Tabs and margins > 'Tab~s and margins', '', 'Configure tabs and margins', '', nodismiss) DefMenuItem( '', -- Tab and Backtab keys 'Tab and Backtab keys', '', '', '', 'STATIC') DefMenuItem( 'tab', -- Tab [%1] 'Tab [%1]', 'ChangeTab tab', 'Change behavior of Tab', '', nodismiss) DefMenuItem( 'c_tab', -- Ctrl+Tab [%1] CTRL_KEY__MSG'+Tab [%1]', 'ChangeTab c_tab', 'Change behavior of 'CTRL_KEY__MSG'+Tab', '', nodismiss) DefMenuItem( 'c_a_tab', -- Ctrl+Alt+Tab [%1] CTRL_KEY__MSG'+'ALT_KEY__MSG'+Tab [%1]', 'ChangeTab c_a_tab', 'Change behavior of 'CTRL_KEY__MSG'+'ALT_KEY__MSG'+Tab', '', nodismiss) DefMenuItem( 's_backtab', -- Backtab [%1] 'Backtab [%1]', 'ChangeTab s_backtab', 'Change behavior of Backtab', '', nodismiss) DefMenuItem( 'c_s_backtab', -- Ctrl+Backtab [%1] CTRL_KEY__MSG'+Backtab [%1]', 'ChangeTab c_s_backtab', 'Change behavior of 'CTRL_KEY__MSG'+Backtab', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Tab behavior 'Tab behavior', '', '', '', 'STATIC') DefMenuItem( 'defaultmatchtab', -- Matchtab: tab stops at word boundaries of lines above '~Matchtab: tab stops at word boundaries of lines above', 'toggle_default_matchtab', 'Tab and Backtab use word boundaries of prev. lines', '', nodismiss) DefMenuItem( 'showtabs', -- Show tab chars 'Sho~w tab chars', 'toggle_tabglyph', 'Show a circle for every tab char', '', nodismiss) DefMenuItem( 'tabs', -- Tabs... '~Tabs: %1...%2', 'Tabs', 'Change tabs', '') DefMenuSep() -------------------- DefMenuItem( '', -- Margins 'Margins', '', '', '', 'STATIC') DefMenuItem( 'joinafterwrap', -- Join after wrap on typing '~Join after wrap on typing', 'Toggle_Join_After_Wrap', 'Join wrapped part with next line', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'margins', -- Margins... '~Margins: %1...%2', 'Margins', 'Change margins', '') DefNextItemStartsSubMenu() DefMenuItem( 'cursorwindows', -- Cursor and windows > '~Cursor and windows', '', 'Configure cursor position, scroll and windows', '') DefMenuItem( '', -- Cursor 'Cursor', '', '', '', 'STATIC') DefMenuItem( 'cursoreverywhere', -- Allow cursor everywhere '~Allow cursor everywhere', 'toggle_cursor_everywhere', 'Cursor can be positioned after line end', '', nodismiss) DefMenuItem( 'keepcursoronscreen', -- Keep cursor on screen '~Keep cursor on screen', 'toggle_keep_cursor_on_screen', 'Keep cursor visible on scroll bar scrolling', '', nodismiss) DefMenuItem( 'highlightcursor', -- Highlight cursor 'H~ighlight cursor', 'toggle_highlight_cursor', 'Highlight cursor after several commands to make it better visible', '', nodismiss) DefMenuItem( 'scrolllockv', -- ScrollLock activates vertical scrolling 'ScrollLock activates ve~rtical scrolling', 'ToggleScrollLockV', 'Vertical cursor keys scroll - Ctrl and vertical cursor keys move normally', '', nodismiss) DefMenuItem( 'scrolllockh', -- ScrollLock activates horizontal scrolling 'ScrollLock activates ~horizontal scrolling', 'ToggleScrollLockH', 'Horizontal cursor keys scroll', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Scroll 'Scroll', '', '', '', 'STATIC') DefMenuItem( 'vposaftersearch', -- V-position after search: [%1] '~V-position after search: [%1]', 'SwitchVPosAfterSearch', 'Select scroll type after a search action', '', nodismiss) DefMenuItem( 'scrollaftersearch', -- Scroll after search: %1... 'S~croll after search: %1...', 'SetScrollAfterSearch', 'View found string at a special v-position', '') DefMenuSep() -------------------- DefMenuItem( '', -- Start width 'Start width', '', '', '', 'STATIC') DefMenuItem( 'startwithmaxcols', -- Start with maximal %1 columns '|No window width ~limitation...|Start with maxima~l %1 columns...', 'LimitEditWindowWidth', 'Limit window width on startup, 0 for no limitation', '') DefMenuSep() -------------------- DefMenuItem( '', -- Focus 'Focus', '', '', '', 'STATIC') DefMenuItem( 'clickonlygivesfocus2', -- Click only gives focus '~Click only gives focus', 'toggle_ClickOnlyGivesFocus', 'When enabled, the cursor is placed at the second click only', '', nodismiss) DefMenuItem( 'focustoeditwindow', -- Search sets focus to edit window 'Search sets focus to ~edit window', 'toggle_FocusToEditWindow', 'When enabled, a search dialog action makes the edit window active', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Search mark 'Search mark', '', '', '', 'STATIC') DefMenuItem( 'searchinmark2', -- Search in multi-line mark if file is marked 'Search in ~multi-line mark if file is marked', 'toggle_SearchMarkIfMarked', 'If file is marked, activate search in mark and from top', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'searchmarkedwords2', -- Use marked words as search string 'Use marked ~words as search string', 'toggle_SearchMarkedWords', 'If words are marked, overtake them as search string for the search dialog', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'modeexpansion', -- Mode and expansion > 'Mode and e~xpansion', 'Configure mode-dependent settings', '', '', '') DefMenuItem( '', -- Match 'Match', '', '', '', 'STATIC') DefMenuItem( 'matchfindonmove', -- Highlight brackets on cursor move 'Highlight brackets on cursor ~move', 'toggle_MatchFindOnMove', 'MatchFindOnMove: match-find bracket on cursor move', '', nodismiss) DefMenuItem( 'matchfindopening', -- Highlight opening bracket on typing closing one 'Highlight ~opening bracket on typing closing one', 'toggle_MatchFindOpening', 'MatchFindOpening: match-find opening bracket on typing closing one', '', nodismiss) DefMenuItem( 'matchinsertpair', -- MatchInsertPair: insert bracket pair on typing opening one 'Insert bracket ~pair on typing opening one', 'toggle_MatchInsertPair', 'MatchInsertPair: insert bracket pair on typing opening one', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Keyword highlighting 'Keyword highlighting', '', '', '', 'STATIC') DefMenuItem( 'defaultkeywordhighlighting', -- Keyword highlighting 'Keyword ~highlighting', 'toggle_default_highlight', 'Switch keyword highlighting on (Ctrl to reload keyword file)', '', nodismiss) DefMenuItem( 'openhilitedirs', -- Open hilite directories for mode CURMODE 'Open hilite ~directories for mode %1', 'OpenHiliteDirs', 'Open dir(s) with .hil/.ini files', '', nodismiss) DefMenuItem( 'hilitecachedirdialog', -- Hilite cache directory: %1... 'Hilite ~cache directory: %1...', 'HiliteCacheDir', '', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Syntax expansion 'Syntax expansion', '', '', '', 'STATIC') DefMenuItem( 'syntaxexpansion3', -- Syntax expansion '~Syntax expansion', 'ToggleSyntaxExpansion', 'Let %1 and %2 do syntax expansion', '', nodismiss) DefMenuItem( 'selectcodingstyle', -- Select coding style (%1) for mode %2... 'Select ~coding style (%1) for mode %2...', 'SelectCodingStyle', 'Select a previously defined coding style for current mode', '', '') DefMenuItem( '', -- Export user and default coding styles 'Export user and default ~coding styles', 'ExportConfig ud_coding \NEPMD\User\CodingStyles', 'Export user and default coding styles to a text file for later import', '', nodismiss) DefMenuSep() -------------------- DefNextItemEndsSubMenu() DefMenuItem( '', -- Export user and default mode settings 'Export user and default ~mode settings', 'ExportConfig ud_mode \NEPMD\User\Mode\', 'Export user and default mode settings to a text file for later import', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'searchoptions', -- Search options > 'Search o~ptions: %1', '', 'View/change default search options', '', nodismiss) DefMenuItem( 'searchoptions_+', -- + down: top to bottom* '~+'\9'down: top to bottom*', 'SearchOptionsMenuCmd +', '', '', nodismiss) DefMenuItem( 'searchoptions_-', -- - up: bottom to top '~-'\9'up: bottom to top', 'SearchOptionsMenuCmd -', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_f', -- f forward: left to right '~f'\9'forward: left to right*', 'SearchOptionsMenuCmd f', '', '', nodismiss) DefMenuItem( 'searchoptions_r', -- r reverse: right to left '~r'\9'reverse: right to left', 'SearchOptionsMenuCmd r', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_!t!b', -- !t!b start at cursor* ''\9'start at c~ursor*', 'SearchOptionsMenuCmd !t!b', '', '', nodismiss) DefMenuItem( 'searchoptions_t', -- t start at top of file '~t'\9'start at top of file', 'SearchOptionsMenuCmd t', '', '', nodismiss) DefMenuItem( 'searchoptions_b', -- b start at bottom of file '~b'\9'start at bottom of file', 'SearchOptionsMenuCmd b', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_a', -- a all: in the whole file* '~a'\9'all: in the whole file*', 'SearchOptionsMenuCmd a', '', '', nodismiss) DefMenuItem( 'searchoptions_m', -- m mark: in mark only '~m'\9'mark: in mark only', 'SearchOptionsMenuCmd m', '', '', nodismiss 'DISABLED') DefMenuSep() -------------------- DefMenuItem( 'searchoptions_e', -- e case-sensitive '~e'\9'case-sensitive', 'SearchOptionsMenuCmd e', '', '', nodismiss) DefMenuItem( 'searchoptions_c', -- c ignore case '~c'\9'ignore case', 'SearchOptionsMenuCmd c', '', '', nodismiss) DefMenuItem( 'searchoptions_v', -- v autonatic case* '~v'\9'automatic case*', 'SearchOptionsMenuCmd v', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_!w!g!x', -- !w!g!x chars* ''\9'c~hars*', 'SearchOptionsMenuCmd !w!g!x', '', '', nodismiss) DefMenuItem( 'searchoptions_w', -- w words '~w'\9'words', 'SearchOptionsMenuCmd w', '', '', nodismiss) DefMenuItem( 'searchoptions_g', -- g grep '~g'\9'grep', 'SearchOptionsMenuCmd g', '', '', nodismiss) DefMenuItem( 'searchoptions_x', -- x egrep '~x'\9'egrep', 'SearchOptionsMenuCmd x', '', '', nodismiss) -------------------------- vertical DefMenuItem( 'searchoptions_!^', -- !^ including* ''\9'~including*', 'SearchOptionsMenuCmd !^', '', '', 'BREAKSEPARATOR' nodismiss) DefMenuItem( 'searchoptions_^', -- ^ excluding (negated) ~ and ^ are equivalent '~^'\9'excluding (negated)', 'SearchOptionsMenuCmd ^', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_!l', -- !l current file* ''\9'~current file*', 'SearchOptionsMenuCmd !l', '', '', nodismiss) DefMenuItem( 'searchoptions_l', -- l all loaded files '~l'\9'all loaded files', 'SearchOptionsMenuCmd l', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_;', -- ; include comments* '~;'\9'include comments*', 'SearchOptionsMenuCmd ;', '', '', nodismiss) DefMenuItem( 'searchoptions_!;', -- !; exclude comments ''\9'exclude ~comments', 'SearchOptionsMenuCmd !;', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_"', -- " include literals* '~"'\9'include literals*', 'SearchOptionsMenuCmd "', '', '', nodismiss) DefMenuItem( 'searchoptions_!"', -- !" exclude literals ''\9'exclude l~iterals', 'SearchOptionsMenuCmd !"', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_!k', -- !k change: replace sets case* ''\9'change: re~place sets case*', 'SearchOptionsMenuCmd !k', '', '', nodismiss) DefMenuItem( 'searchoptions_k', -- k change: keep case of search '~k'\9'change: keep case of search', 'SearchOptionsMenuCmd k', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'searchoptions_!*', -- !* change 1 only* ''\9'change ~1 only*', 'SearchOptionsMenuCmd !*', '', '', nodismiss) DefMenuItem( 'searchoptions_*', -- * change all '~*'\9'change all', 'SearchOptionsMenuCmd *', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Restore default ''\9'Restore ~default', 'SearchOptionsMenuCmd DEFAULT', 'Apply default search options', '', nodismiss) DefMenuItem( '', -- Reset to initial default (*) ''\9'Reset to i~nitial default (*)', 'SearchOptionsMenuCmd RESET', 'Apply default Netlabs search options', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( '', -- Save as default ''\9'Save as defa~ult', 'SearchOptionsMenuCmd SAVE', '', '', nodismiss) DefMenuSep() -------------------- ; --------------------------------------------------------------------------- defproc add_prefs_saveandrestore universal nodismiss DefMenuItem( '', -- Save and restore 'Save and restore', '', '', '', 'STATIC') DefNextItemStartsSubMenu() DefMenuItem( 'readonlyandmodified', -- Read-only and modified > '~Read-only and modified', '', '', '', nodismiss) DefMenuItem( '', -- Concurrent access 'Concurrent access', '', '', '', 'STATIC') DefMenuItem( 'respectreadonly', -- Respect read-only '~Respect read-only', 'ToggleRespectReadonly', 'Read-only file attribute disables edit mode', '', nodismiss) DefMenuItem( 'lockonmodify', -- Lock on modify '~Lock on modify', 'ToggleLockOnModify', 'Deny write access for other applications if file is modified', '', nodismiss) DefMenuItem( 'lockonload', -- Lock on load 'Loc~k on load', 'ToggleLockOnLoad', 'Deny write access for other applications if file is loaded', '', nodismiss) DefMenuItem( 'msgboxonlockerror', -- Message box on lock error 'Message box on lo~ck error', 'ToggleMsgBoxOnLockError', 'Pop up a message box on lock error', '', nodismiss) DefMenuItem( 'msgboxonsaveerror', -- Message box on save error 'Message box on sa~ve error', 'ToggleMsgBoxOnSaveError', 'Pop up a message box on save error', '', nodismiss) DefMenuItem( 'checkforalternation', -- Check for alternation on disk '~Check for alternation on disk', 'ToggleCheckForAlternation', 'Check file on disk for changed date', '', nodismiss) DefMenuItem( 'msgboxifaltered', -- Message box if altered 'Message box if ~altered', 'ToggleMsgBoxIfAltered', 'Pop up a message box if file was altered on disk', '', nodismiss) DefMenuItem( 'autoreload', -- Auto-reload if altered 'A~uto-reload if altered', 'ToggleAutoReload', 'Reload file automatically if altered on disk', '', nodismiss) DefMenuItem( 'autoreadonly', -- Set read-only if altered '~Set read-only if altered', 'ToggleAutoReadonly', 'Disable further editing if file was altered on disk', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Discard changes 'Discard changes', '', '', '', 'STATIC') DefMenuItem( 'discarduntitled', -- Untitled '~Untitled', 'ToggleDiscardChanges untitled', 'Automatically discard changes for modified Untitled files', '', nodismiss) DefMenuItem( 'discardnewshells', -- New shells '~New shells', 'ToggleDiscardChanges newshells', 'Automatically discard changes for modified new shell files', '', nodismiss) DefMenuItem( 'discardrestoredshells', -- Restored shells '~Restored shells', 'ToggleDiscardChanges restoredshells', 'Automatically discard changes for modified restored shell files', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'discardothervirtual', -- Other virtual files '~Other virtual files', 'ToggleDiscardChanges othervirtual', 'Automatically discard changes for other modified virtual files', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'restore', -- Restore > 'Rest~ore', '', '', '', nodismiss) DefMenuItem( '', -- History 'History', '', '', '', 'STATIC') DefMenuItem( 'trackhistorylists', -- Track additional history lists '~Track additional history lists', 'Toggle_History', 'Enable edit, load and save history', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Restore rings 'Restore rings', '', '', '', 'STATIC') DefMenuItem( 'autosavelastring', -- Auto-save last rings 'Auto-~save last rings', 'Toggle_Save_Ring', 'Save last ring on load and quit, save all last rings on opening a new window', '', nodismiss) DefMenuItem( 'autoloadlastring', -- Auto-load last rings 'Auto-~load last rings', 'Toggle_Restore_Ring', 'Restore all previously saved last rings if the first EPM is started without args', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Cursor position 'Cursor position', '', '', '', 'STATIC') DefMenuItem( 'restorecursorpos', -- Restore cursor position 'Restore ~cursor position', 'toggle_restore_pos', 'Restore of cursor pos. from file''s last save', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Search options on EPM start 'Search options on EPM start', '', '', '', 'STATIC') DefMenuItem( 'restoredefaultsearchoptions', -- Restore default options 'Restore ~default options', 'RestoreSearchOptionsCmd D', 'Restore default search options on EPM start', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( 'restorelastsearchoptions', -- Restore last options 'Restore ~last options', 'RestoreSearchOptionsCmd L', 'Restore options from last search on EPM start', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'backup', -- Backup > '~Backup', '', '', '', '') DefMenuItem( 'autosaveenabled', -- Autosave '~Autosave', 'toggle_autosave', '', '', nodismiss) DefMenuItem( 'autosavenumdialog', -- After %1 changes... 'After %1 ~changes...', 'AutosaveNum', '', '') DefMenuSep() -------------------- DefMenuItem( 'backupenabled', -- Backup '~Backup', 'toggle_backup', '', '', nodismiss) DefMenuItem( 'backupnumdialog', -- Keep %1 backups... '~Keep %1 backups...', 'BackupNum', '', '') DefMenuSep() -------------------- DefMenuItem( 'backupdirdialog', -- Directory: %1... '~Directory: %1...', 'BackupDir', '', '', '') DefMenuItem( 'backuplistdir', -- List directory '~List directory', 'ListBackupDir', '', '', '') DefNextItemEndsSubMenu() DefMenuItem( 'backupdeleteoldfiles', -- Delete old backup files... 'Delete ~old backup files...', 'DeleteOldBackupFiles', '', '', '') DefNextItemStartsSubMenu() DefMenuItem( 'saveoptions', -- Save options > 'Sa~ve options: %1', '', 'View/change default save options', '', nodismiss) DefMenuItem( 'saveoptions_ns', -- /ns don't strip spaces '/ns'\9'~don''t strip spaces', 'SaveOptionsMenuCmd /ns', '', '', nodismiss) DefMenuItem( 'saveoptions_s', -- /s strip spaces* '/~s'\9'strip trailing spaces*', 'SaveOptionsMenuCmd /s', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'saveoptions_nt', -- /nt don't compress spaces* '/nt'\9'don''t compress s~paces*', 'SaveOptionsMenuCmd /nt', '', '', nodismiss) DefMenuItem( 'saveoptions_t', -- /t compress spaces to tabs (tabs = 8, buggy!) '/~t'\9'compress spaces to tabs (tabs = 8, buggy!)', 'SaveOptionsMenuCmd /t', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'saveoptions_ne', -- /ne no file end char* '/~ne'\9'no file end char*', 'SaveOptionsMenuCmd /ne', '', '', nodismiss) DefMenuItem( 'saveoptions_e', -- /e append a file end char '/~e'\9'append a file end char', 'SaveOptionsMenuCmd /e', '', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( 'saveoptions_a', -- !/o!/u auto-line-end ''\9'~auto-line-end', 'SaveOptionsMenuCmd /a', '', '', nodismiss) DefMenuItem( 'saveoptions_o', -- /o force DOS line end (CRLF)* '/~o'\9'force DOS line end (CRLF)*', 'SaveOptionsMenuCmd /o', '', '', nodismiss) DefMenuItem( 'saveoptions_l', -- /u force Unix line end (LF) '/~l'\9'force Unix line end (LF)', 'SaveOptionsMenuCmd /l', '', '', nodismiss) -- /u is the same as /l /ne DefMenuSep() -------------------- DefMenuItem( '', -- Reset to initial default (*) ''\9'Reset to initial ~default (*)', 'SaveOptionsMenuCmd RESET', '', '', nodismiss) DefNextItemEndsSubMenu() DefMenuItem( '', -- Save as default ''\9'Sa~ve as default', 'SaveOptionsMenuCmd SAVE', '', '', nodismiss) DefMenuSep() -------------------- ; --------------------------------------------------------------------------- defproc add_prefs_appearance universal nodismiss DefMenuItem( '', -- Appearance 'Appearance', '', '', '', 'STATIC') DefNextItemStartsSubMenu() DefMenuItem( 'menu', -- Menu > 'Me~nu', '', '', '', '') DefMenuItem( '', -- Select menu 'Select ~menu...', 'ChangeMenu', 'Open a listbox and change or refresh the menu', '', '') DefMenuItem( 'nodismiss', -- Nodismiss menus '~Nodismiss menus', 'toggle_nodismiss', 'Keep menu open after selecting menu items', '', nodismiss) DefMenuSep() -------------------- DefNextItemEndsSubMenu() DefMenuItem( 'hideformatmenuitems', -- Hide Format menu items '~Hide Format menu items', 'mc ;HideMenuItems TOGGLE;menuinit_menu', 'This is required for to load several external packages, otherwise EPM would crash', '', nodismiss) DefNextItemStartsSubMenu() DefMenuItem( 'infobars', -- Info bars > '~Info bars', '', '', '', '') DefMenuItem( 'showlongname', -- Show .LONGNAME 'Show .~LONGNAME', 'toggle_longname', 'Show .LONGNAME EA as filename in titlebar', '', nodismiss) DefMenuItem( 'messageline', -- Message line MSG_LINE_MENU__MSG, 'ToggleFrame 2', MSG_LINE_MENUP__MSG, HP_FRAME_MESSAGE, nodismiss) DefMenuItem( 'statusbar', -- Status bar 'Status b~ar', 'ToggleFrame 1', STATUS_LINE_MENUP__MSG, HP_FRAME_STATUS, nodismiss) DefMenuItem( 'infoattop', -- Info at top INFOATTOP_MENU__MSG, 'ToggleFrame 32', INFOATTOP_MENUP__MSG, HP_FRAME_EXTRAPOS, nodismiss) DefMenuItem( 'showmenuhints', -- Show menu hints 'Show menu ~hints', 'toggleprompt', PROMPTING_MENUP__MSG, HP_FRAME_PROMPT, nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Configure title bar... 'Configure ~title bar...', 'ConfigInfoLine TITLE', 'Change layout of titletext', '', '') DefMenuItem( '', -- Configure status bar... 'Configure status ~bar...', 'ConfigInfoLine STATUS', 'Change layout of status bar', '', '') DefNextItemEndsSubMenu() DefMenuItem( '', -- Configure separator... 'Configure ~separator...', 'ConfigInfoLine SEP', 'Change layout of separator for title and status bar', '', '') DefNextItemStartsSubMenu() DefMenuItem( 'toolbar', -- Toolbar > '~Toolbar', '', '', '', '') DefMenuItem( 'toolbarenabled', -- Enabled '~Enabled', 'toggle_toolbar', TOGGLETOOLBAR_MENUP__MSG, HP_TOOLBAR_TOGGLE, nodismiss) DefMenuItem( '', -- Select... '~Select...', 'LoadToolbar', 'Open a listbox and load, reload or delete a toolbar', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Style 'Style', '', '', '', 'STATIC') DefMenuItem( 'toolbartext', -- Text '~Text', 'toggle_toolbar_text', 'Show button text', '', nodismiss) DefMenuItem( 'toolbarautosize', -- Automatic size '~Automatic size', 'toggle_toolbar_autosize', 'Adjust button sizes to the .bmp sizes', '', nodismiss) DefMenuItem( 'toolbarsize', -- Size: 26x26... '~Size: %1...', 'ToolbarSize', 'Default = 26x26, add 4x4 to the .bmp size', '', nodismiss) DefMenuItem( 'toolbarscaling', -- Scaling: [and] 'S~caling: [%1]', 'toggle_toolbar_scaling', 'In most cases "and" looks best', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Save as... 'Save ~as...', 'SaveToolbar', '', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Import... '~Import...', 'ImportToolbar', '', '', '') DefNextItemEndsSubMenu() DefMenuItem( '', -- Export... 'E~xport...', 'ExportToolbar', '', '', '') DefNextItemStartsSubMenu() DefMenuItem( 'miscellaneous', -- Miscellaneous > '~Miscellaneous', '', '', '', nodismiss) DefMenuItem( '', -- Cursor style 'Cursor style', '', '', '', 'STATIC') DefMenuItem( 'cursorbar', -- Bar '~Bar', 'CursorStyle' 1, 'Vertical bar in insert and block in overwrite mode', '', nodismiss) DefMenuItem( 'cursorbarwidth', -- Bar width 'Bar ~width: %1...', 'CursorWidth', 'Enter bar width', '') DefMenuItem( 'cursorunderline', -- Underline '~Underline', 'CursorStyle' 2, 'Underline in insert and half block in overwrite mode', '', nodismiss) DefMenuItem( 'cursorcustom', -- Custom '~Custom', 'CursorStyle' 3, 'Special cursor dimensions', '', nodismiss) DefMenuItem( 'cursorcustomdimen', -- Dimensions: %1... '~Dimensions: %1...', 'CursorStyle ?', 'Set special cursor dimensions', '') DefMenuSep() -------------------- DefMenuItem( '', -- Pointer style 'Pointer style', '', '', '', 'STATIC') DefMenuItem( 'pointeribeam', -- I-beam '~I-beam', 'PointerStyle' 2, 'I-beam pointer', '', nodismiss) DefMenuItem( 'pointerarrow', -- Arrow '~Arrow', 'PointerStyle' 1, 'Arrow pointer', '', nodismiss) DefMenuSep() -------------------- DefMenuItem( '', -- Background bitmap 'Background bitmap', '', '', '', 'STATIC') DefMenuItem( 'backgroundbitmapenabled', -- Enabled '~Enabled', 'toggle_bitmap', TOGGLEBITMAP_MENUP__MSG, HP_FRAME_BITMAP, nodismiss) DefMenuItem( '', -- Select... '~Select...', 'SetBackgroundBitmap SELECT', 'Select a background bitmap', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Fonts 'Fonts', '', '', '', 'STATIC') DefMenuItem( '', -- Change controls fonts... 'Change controls ~fonts...', 'OpenObject ', '', '') DefMenuItem( '', -- Old colors and fonts dialog... 'Old colors and fonts ~dialog...', 'PostMe ConfigDlg' 1023 - 2 - 16, -- 2 = color page bit, 16 = fonts page bit, 1023 = sum for all pages 'Use either the old configuration dialog or drag''n''drop', '', '') DefMenuSep() -------------------- DefMenuItem( '', -- Colors 'Colors', '', '', '', 'STATIC') DefMenuItem( '', -- Change controls colors... 'Change controls ~colors...', 'OpenObject ', 'To change a foreground color, hold the Ctrl key', '') DefMenuItem( '', -- Old colors and fonts dialog... 'Old colors and fonts ~dialog...', 'PostMe ConfigDlg' 1023 - 2 - 16, -- 2 = color page bit, 16 = fonts page bit, 1023 = sum for all pages 'Use either the old configuration dialog or drag''n''drop', '', '') DefNextItemEndsSubMenu() DefMenuItem( '', -- Change highlighting color palette... 'Change highlighting color ~palette...', 'SelectColorPal', 'Modify EPM''s 16-color palette (e.g. used for highlighting)', '', '') ; ------------------------------------ Preferences -------------------------- ; This is automatically executed on opening the prefspopup menu. ; --------------------------------------------------------------------------- defc menuinit_prefspopup MenuText_editoptions() MenuText_saveoptions() MenuText_searchoptions() ; --------------------------------------------------------------------------- defproc MenuText_editoptions universal default_edit_options new = default_edit_options mid = GetMenuAVar( 'mid_editoptions') if IsNum( mid) then SetMenuVarText( 'editoptions', new) endif ; --------------------------------------------------------------------------- defproc MenuText_saveoptions universal default_save_options new = default_save_options mid = GetMenuAVar( 'mid_saveoptions') if IsNum( mid) then SetMenuVarText( 'saveoptions', new) endif ; --------------------------------------------------------------------------- defproc MenuText_searchoptions new = GetLastSearchOptions() mid = GetMenuAVar( 'mid_searchoptions') if IsNum( mid) then SetMenuVarText( 'searchoptions', new) endif ; --------------------------------------------------------------------------- defc menuinit_basicconfig universal default_stream_mode universal cua_menu_accel BitStr = GetPresetBitStr() SetMenuAttribute( 'presetusercua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_USER_CUA)) SetMenuAttribute( 'presetprogcua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_CUA)) SetMenuAttribute( 'presetprogstd', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_STD)) MarkingMode = QueryMarkingMode() SetMenuAttribute( 'advancedmarking', MIA_CHECKED, not (MarkingMode = 'A')) SetMenuAttribute( 'cuamarking', MIA_CHECKED, not (MarkingMode = 'C')) SetMenuAttribute( 'advancedmarking2', MIA_CHECKED, not (MarkingMode = 'A')) SetMenuAttribute( 'cuamarking2', MIA_CHECKED, not (MarkingMode = 'C')) on = (lowcase( GetAddKeyDefs()) = 'cua') SetMenuAttribute( 'cuakeyset', MIA_CHECKED, not on) SetMenuAttribute( 'defaultstreammode2', MIA_CHECKED, not default_stream_mode) KeyPath = '\NEPMD\User\CursorPos\CursorEverywhere' on = (QueryConfigKey( KeyPath) <> 0) SetMenuAttribute( 'cursoreverywhere2', MIA_CHECKED, not on) KeyPath1 = '\NEPMD\User\SpecialKeys\HomeToggles' on1 = QueryConfigKey( KeyPath1) KeyPath2 = '\NEPMD\User\SpecialKeys\EndToggles' on2 = QueryConfigKey( KeyPath2) on = (on1 = 1 & on2 = 1) SetMenuAttribute( 'homeendtoggle', MIA_CHECKED, not on) on = not cua_menu_accel SetMenuAttribute( 'blockaltletterkeys2', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SyntaxExpansion' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'syntaxexpansion2', MIA_CHECKED, not on) parse value GetExpandKeys() with FirstExpandKey SecondExpandKey SetMenuVarHint( 'syntaxexpansion2', FirstExpandKey, SecondExpandKey) KeyPath1 = '\NEPMD\User\SpecialKeys\MatchFindOnMove' on1 = QueryConfigKey( KeyPath1) KeyPath2 = '\NEPMD\User\SpecialKeys\MatchFindOpening' on2 = QueryConfigKey( KeyPath2) KeyPath3 = '\NEPMD\User\SpecialKeys\MatchInsertPair' on3 = QueryConfigKey( KeyPath3) on = (on1 = 1 & on2 = 1 & on3 = 1) SetMenuAttribute( 'matchbrackets', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc toggle_AddKeyDefs on = (lowcase( GetAddKeyDefs()) = 'cua') on = not on if on then 'SetAddKeyDefs cua' else 'SetAddKeyDefs' endif 'RefreshInfoLine KEYSET' SetMenuAttribute( 'cuakeyset', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc toggle_HomeEndToggle KeyPath1 = '\NEPMD\User\SpecialKeys\HomeToggles' on1 = QueryConfigKey( KeyPath1) KeyPath2 = '\NEPMD\User\SpecialKeys\EndToggles' on2 = QueryConfigKey( KeyPath2) on = (on1 = 1 & on2 = 1) on = not on WriteConfigKey( KeyPath1, on) WriteConfigKey( KeyPath2, on) SetMenuAttribute( 'homeendtoggle', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc toggle_MatchBrackets KeyPath1 = '\NEPMD\User\SpecialKeys\MatchFindOnMove' on1 = QueryConfigKey( KeyPath1) KeyPath2 = '\NEPMD\User\SpecialKeys\MatchFindOpening' on2 = QueryConfigKey( KeyPath2) KeyPath3 = '\NEPMD\User\SpecialKeys\MatchInsertPair' on3 = QueryConfigKey( KeyPath3) on = (on1 = 1 & on2 = 1 & on3 = 1) on = not on WriteConfigKey( KeyPath1, on) WriteConfigKey( KeyPath2, on) WriteConfigKey( KeyPath3, on) SetMenuAttribute( 'matchbrackets', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc menuinit_editoptions 'EditOptionsMenuCmd MENUINIT' ; --------------------------------------------------------------------------- defc menuinit_saveoptions 'SaveOptionsMenuCmd MENUINIT' ; --------------------------------------------------------------------------- defc menuinit_searchoptions 'SearchOptionsMenuCmd MENUINIT' ; --------------------------------------------------------------------------- defc Toggle4os2MouseMark do once = 1 to 1 KeyPath = '\NEPMD\User\Mark\4os2MouseMark' f4os2MouseMark = QueryConfigKey( KeyPath) new = not f4os2MouseMark WriteConfigKey( KeyPath, new) SetMenuAttribute( '4os2mousemark', MIA_CHECKED, not Query4os2MouseMark()) SetMenuAttribute( '4os2mousemark2', MIA_CHECKED, not Query4os2MouseMark()) enddo ; --------------------------------------------------------------------------- ; This is for the Preferences popup menu only. defc menuinit_markingsettings CurrentMarkingBitStr = GetCurrentMarkingBitStr() -- E precision is max. 9 digits, DigitComp is required SetMenuAttribute( 'advancedmarking', MIA_CHECKED, DigitComp( CurrentMarkingBitStr, MARKING_BITSTR_ADV)) SetMenuAttribute( 'cuamarking', MIA_CHECKED, DigitComp( CurrentMarkingBitStr, MARKING_BITSTR_CUA)) KeyPath = '\NEPMD\User\Mark\DefaultPaste' next = substr( upcase( QueryConfigKey( KeyPath)), 1, 1) if next = 'L' then new = 'line' elseif next = 'B' then new = 'block' else new = 'char' endif SetMenuVarText( 'defaultpaste', new) KeyPath = '\NEPMD\User\Mark\ShiftMarkAlwaysExtends' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'shiftmarkextends', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Mark\LineInsert' LineInsert = QueryConfigKey( KeyPath) if LineInsert = 'A' then new = 'above' else new = 'below' endif SetMenuVarText( 'lineinsert', new) SetMenuAttribute( 'replacemark', MIA_CHECKED, not QueryReplaceMark()) SetMenuAttribute( 'directmarkactions', MIA_CHECKED, not QueryDirectMarkActions()) SetMenuAttribute( 'unmarkonanykey', MIA_CHECKED, not QueryUnmarkOnAnyKey()) KeyPath = '\NEPMD\User\Mark\UnmarkAfterMove' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'unmarkaftermove', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Mark\DefaultMouseMark' DefaultMouseMark = QueryConfigKey( KeyPath) if DefaultMouseMark <> 'B' then new = 'char' else new = 'block' endif SetMenuVarText( 'defaultmousemark', new) SetMenuAttribute( 'gotomousemark', MIA_CHECKED, not QueryGoToMouseMarkPos()) DoubleClickMarks = QueryDoubleClickMarks() if DoubleClickMarks = 0 then Val = 'doesn''t mark' elseif DoubleClickMarks = 'W' then Val = 'marks word' elseif DoubleClickMarks = 'I' then Val = 'marks identifier' endif SetMenuVarText( 'doubleclickmarks', Val) SetMenuAttribute( '4os2mousemark', MIA_CHECKED, not Query4os2MouseMark()) SetMenuAttribute( 'doubleclickunmarks', MIA_CHECKED, not QueryDoubleClickUnmarks()) KeyPath = '\NEPMD\User\SearchDialog\SearchMarkIfMarked' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'searchinmark', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SearchDialog\SearchMarkedWords' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'searchmarkedwords', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc menuinit_keysmouse universal cua_menu_accel MenuText_keydefs() KeyPath = '\NEPMD\User\SpecialKeys\HomeToggles' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'hometoggles', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SpecialKeys\EndToggles' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'endtoggles', MIA_CHECKED, not on) MenuText_syntaxexpansionkeys() KeyPath = '\NEPMD\User\SyntaxExpansion' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'syntaxexpansionkeys', MIA_DISABLED, on) SetMenuAttribute( 'blockaltletterkeys', MIA_CHECKED, cua_menu_accel) KeyPath = '\NEPMD\User\SpecialKeys\Alt\BlockLeftAlt' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'blockleftaltkey', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SpecialKeys\Alt\BlockRightAlt' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'blockrightaltkey', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Mark\DefaultMouseMark' DefaultMouseMark = QueryConfigKey( KeyPath) if DefaultMouseMark <> 'B' then new = 'char' else new = 'block' endif SetMenuVarText( 'defaultmousemark2', new) SetMenuAttribute( 'gotomousemark2', MIA_CHECKED, not QueryGoToMouseMarkPos()) DoubleClickMarks = QueryDoubleClickMarks() if DoubleClickMarks = 0 then Val = 'doesn''t mark' elseif DoubleClickMarks = 'W' then Val = 'marks word' endif SetMenuVarText( 'doubleclickmarks2', Val) SetMenuAttribute( '4os2mousemark2', MIA_CHECKED, not Query4os2MouseMark()) SetMenuAttribute( 'doubleclickunmarks2', MIA_CHECKED, not QueryDoubleClickUnmarks()) KeyPath = '\NEPMD\User\EditWindow\ClickOnlyGivesFocus' ClickOnlyGivesFocus = QueryConfigKey( KeyPath) SetMenuAttribute( 'clickonlygivesfocus', MIA_CHECKED, not ClickOnlyGivesFocus) ; --------------------------------------------------------------------------- defproc MenuText_keydefs None = '-none-' new = GetAddKeyDefs() if new = '' then new = None else parse value new with new'keys' new = new'keys' endif SetMenuVarText( 'keydefs', new) ; --------------------------------------------------------------------------- defc menuinit_streamnewline universal default_stream_mode SetMenuAttribute( 'defaultstreammode', MIA_CHECKED, not default_stream_mode) MenuText_newlineenter() MenuText_newline( 'newline') MenuText_newlinesplit( 'newline') MenuText_newlinecol( 'newline') MenuText_newline( 's_newline') MenuText_newlinesplit( 's_newline') MenuText_newlinecol( 's_newline') MenuText_newline( 'a_newline') MenuText_newlinesplit( 'a_newline') MenuText_newlinecol( 'a_newline') MenuText_newline( 'c_newline') MenuText_newlinesplit( 'c_newline') MenuText_newlinecol( 'c_newline') ; --------------------------------------------------------------------------- defc toggle_newlineenter universal newline_enter if newline_enter = 'enter' then newline_enter = 'newline' else newline_enter = 'enter' endif MenuText_newlineenter() MenuText_newline( 'newline') MenuText_newlinesplit( 'newline') MenuText_newlinecol( 'newline') MenuText_newline( 's_newline') MenuText_newlinesplit( 's_newline') MenuText_newlinecol( 's_newline') MenuText_newline( 'a_newline') MenuText_newlinesplit( 'a_newline') MenuText_newlinecol( 'a_newline') MenuText_newline( 'c_newline') MenuText_newlinesplit( 'c_newline') MenuText_newlinecol( 'c_newline') ; --------------------------------------------------------------------------- defproc MenuText_newlineenter universal newline_enter if newline_enter = 'enter' then new = PADENTER_KEY__MSG else new = NEWLINE_KEY__MSG endif SetMenuVarText( 'newlineenter', new) ; --------------------------------------------------------------------------- defc toggle_newlinesplit universal newline_enter universal default_stream_mode miname = arg( 1) if miname = '' then miname = 'newline' endif key = lowcase( miname) if newline_enter = 'enter' then key = ChangeStr( 'newline', key, 'enter') endif KeyPath = '\NEPMD\User\SpecialKeys' if default_stream_mode then KeyPath = KeyPath'\Stream' else KeyPath = KeyPath'\Line' endif KeyPath = KeyPath'\'key next = QueryConfigKey( KeyPath) if next = '' then next = 'Split,KeepIndent' endif parse value next with SplitCfg','ColCfg','fCmd','Cmd if fCmd <> 1 then fCmd = 0 endif UpSplitCfg = upcase( SplitCfg) if CtrlIsDown() then 'ConfigureNewlineCmd' key return elseif default_stream_mode then if fCmd then new = 'Split' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'SPLIT' then if Cmd = '' then new = '-no cmd-' else new = Cmd endif fCmd = 1 else new = 'Split' SplitCfg = new fCmd = 0 endif else if fCmd then new = 'Split' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'SPLIT' then new = 'Add' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'ADD' then new = 'NoAdd' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'NOADD' then new = 'SplitIns' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'SPLITINS' then new = 'AddIns' SplitCfg = new fCmd = 0 elseif UpSplitCfg = 'ADDINS' then if Cmd = '' then new = '-no cmd-' else new = Cmd endif fCmd = 1 else new = 'Split' SplitCfg = new fCmd = 0 endif endif SetMenuVarText( miname'split', new) Val = SplitCfg','ColCfg','fCmd','Cmd WriteConfigKey( KeyPath, Val) -- Disable col menu item if cmd is selected on = not fCmd SetMenuAttribute( GetMenuAVar( 'mid_'miname'col'), MIA_DISABLED, on) ; --------------------------------------------------------------------------- defc toggle_newlinecol universal newline_enter universal default_stream_mode miname = arg( 1) if miname = '' then miname = 'newline' endif key = lowcase( miname) if newline_enter = 'enter' then key = ChangeStr( 'newline', key, 'enter') endif KeyPath = '\NEPMD\User\SpecialKeys' if default_stream_mode then KeyPath = KeyPath'\Stream' else KeyPath = KeyPath'\Line' endif KeyPath = KeyPath'\'key next = QueryConfigKey( KeyPath) if next = '' then next = 'Split,KeepIndent' endif parse value next with SplitCfg','ColCfg','fCmd','Cmd if fCmd <> 1 then fCmd = 0 endif UpColCfg = upcase( ColCfg) if default_stream_mode then if UpColCfg = 'KEEPINDENT' then new = 'NoIndent' elseif UpColCfg = 'NOINDENT' then new = 'Margins' elseif UpColCfg = 'MARGINS' then new = 'ParMargin' else new = 'KeepIndent' endif else if UpColCfg = 'KEEPINDENT' then new = 'KeepCol' elseif UpColCfg = 'KEEPCOL' then new = 'NoIndent' elseif UpColCfg = 'NOINDENT' then new = 'Margins' elseif UpColCfg = 'MARGINS' then new = 'ParMargin' else new = 'KeepIndent' endif endif ColCfg = new SetMenuVarText( miname'col', new) Val = SplitCfg','ColCfg','fCmd','Cmd WriteConfigKey( KeyPath, Val) ; --------------------------------------------------------------------------- defproc MenuText_newlinesplit universal newline_enter universal default_stream_mode miname = arg( 1) if miname = '' then miname = 'newline' endif key = lowcase( miname) if newline_enter = 'enter' then key = ChangeStr( 'newline', key, 'enter') endif KeyPath = '\NEPMD\User\SpecialKeys' if default_stream_mode then KeyPath = KeyPath'\Stream' else KeyPath = KeyPath'\Line' endif KeyPath = KeyPath'\'key next = QueryConfigKey( KeyPath) if next = '' then next = 'Split,KeepIndent' endif parse value next with SplitCfg','ColCfg','fCmd','Cmd if fCmd <> 1 then fCmd = 0 new = SplitCfg else if Cmd = '' then new = '-no cmd-' else new = Cmd endif endif -- Disable col menu item if cmd is selected on = not fCmd SetMenuAttribute( GetMenuAVar( 'mid_'miname'col'), MIA_DISABLED, on) SetMenuVarText( miname'split', new) ; --------------------------------------------------------------------------- defproc MenuText_newlinecol universal newline_enter universal default_stream_mode miname = arg( 1) if miname = '' then miname = 'newline' endif key = lowcase( miname) if newline_enter = 'enter' then key = ChangeStr( 'newline', key, 'enter') endif KeyPath = '\NEPMD\User\SpecialKeys' if default_stream_mode then KeyPath = KeyPath'\Stream' else KeyPath = KeyPath'\Line' endif KeyPath = KeyPath'\'key next = QueryConfigKey( KeyPath) if next = '' then next = 'Split,KeepIndent' endif parse value next with SplitCfg','ColCfg','fCmd','Cmd SetMenuVarText( miname'col', ColCfg) ; --------------------------------------------------------------------------- defproc MenuText_newline universal newline_enter universal default_stream_mode miname = arg( 1) if miname = '' then miname = 'newline' endif key = lowcase( miname) if newline_enter = 'enter' then key = ChangeStr( 'newline', key, 'enter') endif Rest = key KeyString = '' do while Rest <> '' if pos( 'c_', Rest) = 1 then KeyString = KeyString''CTRL_KEY__MSG'+' Rest = substr( Rest, 3) endif if pos( 'a_', Rest) = 1 then KeyString = KeyString''ALT_KEY__MSG'+' Rest = substr( Rest, 3) endif if pos( 's_', Rest) = 1 then KeyString = KeyString''SHIFT_KEY__MSG'+' Rest = substr( Rest, 3) endif if Rest <> '' then VKString = GetVKMenuName( Rest) if VKString <> '' then KeyString = KeyString''VKString else KeyString = KeyString''upcase( Rest) endif Rest = '' endif enddo if default_stream_mode then stream_line = 'stream' else stream_line = 'line' endif SetMenuText( miname, KeyString' in 'stream_line' mode') ; --------------------------------------------------------------------------- defc ResetNewlineKeyDefs universal numcfgkeys numcfgkeys = 0 DeleteConfigTree( '\NEPMD\User\SpecialKeys\Stream') DeleteConfigTree( '\NEPMD\User\SpecialKeys\Line') 'sayerror' numcfgkeys 'key(s) deleted.' MenuText_newlinesplit( 'newline') MenuText_newlinecol( 'newline') MenuText_newlinesplit( 's_newline') MenuText_newlinecol( 's_newline') MenuText_newlinesplit( 'a_newline') MenuText_newlinecol( 'a_newline') MenuText_newlinesplit( 'c_newline') MenuText_newlinecol( 'c_newline') ; --------------------------------------------------------------------------- defc menuinit_tabsandmargins universal cua_menu_accel universal join_after_wrap MenuText_tab() MenuText_c_tab() MenuText_c_a_tab() MenuText_s_backtab() MenuText_c_s_backtab() KeyPath = '\NEPMD\User\SpecialKeys\Tab\MatchWordsAbove' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'defaultmatchtab', MIA_CHECKED, not on) on = tabglyph() SetMenuAttribute( 'showtabs', MIA_CHECKED, not on) MenuText_tabs() MenuText_margins() SetMenuAttribute( 'joinafterwrap', MIA_CHECKED, not join_after_wrap) ; --------------------------------------------------------------------------- defc menuinit_cursorwindows KeyPath = '\NEPMD\User\CursorPos\CursorEverywhere' on = (QueryConfigKey( KeyPath) <> 0) SetMenuAttribute( 'cursoreverywhere', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\CursorPos\KeepCursorOnScreen' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'keepcursoronscreen', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\CursorPos\HighlightCursor' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'highlightcursor', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\CursorPos\ScrollLockV' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'scrolllockv', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\CursorPos\ScrollLockH' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'scrolllockh', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\CursorPos\VPosAfterSearch' val = QueryConfigKey( KeyPath) call MenuText_VPosAfterSearch() SetMenuAttribute( 'scrollaftersearch', MIA_DISABLED, val = 'S') MenuText_scrollaftersearch() KeyPath = '\NEPMD\User\EditWindow\MaxCols' MaxCols = QueryConfigKey( KeyPath) Text = GetMenuCondText( 'startwithmaxcols', MaxCols = 0, MaxCols <> 0) Text = ExpandVarText( Text, MaxCols) SetMenuText( 'startwithmaxcols', Text) KeyPath = '\NEPMD\User\EditWindow\ClickOnlyGivesFocus' fClickOnlyGivesFocus = QueryConfigKey( KeyPath) on = fClickOnlyGivesFocus SetMenuAttribute( 'clickonlygivesfocus2', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SearchDialog\FocusToEditWindow' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'focustoeditwindow', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SearchDialog\SearchMarkIfMarked' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'searchinmark2', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SearchDialog\SearchMarkedWords' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'searchmarkedwords2', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ToggleScrollLockV KeyPath = '\NEPMD\User\CursorPos\ScrollLockV' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) SetMenuAttribute( 'scrolllockv', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ToggleScrollLockH KeyPath = '\NEPMD\User\CursorPos\ScrollLockH' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) SetMenuAttribute( 'scrolllockh', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ChangeTab KeyString = arg( 1) KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) NewOptions = Options if wordpos( KeyString, 'tab c_tab c_a_tab') then List = 'Text,Spaces Text,Tab TextIns,Spaces TextIns,Tab Cursor' wp = wordpos( Options, List) Nextwp = wp + 1 if Nextwp > words( List) then Nextwp = 1 endif NewOptions = word( List, Nextwp) elseif wordpos( KeyString, 's_backtab c_s_backtab') then List = 'Text Text,Whitespace TextIns TextIns,Whitespace Cursor' wp = wordpos( Options, List) Nextwp = wp + 1 if Nextwp > words( List) then Nextwp = 1 endif NewOptions = word( List, Nextwp) endif if NewOptions <> Options & NewOptions <> '' then WriteConfigKey( KeyPath, NewOptions) endif SetMenuVarText( KeyString, TabOptionsToText( NewOptions)) ; --------------------------------------------------------------------------- defproc TabOptionsToText Options = arg( 1) Text = '' if Options = 'Text,Spaces' then Text = 'moves text with spaces' elseif Options = 'Text,Tab' then Text = 'moves text with tab' elseif Options = 'TextIns,Spaces' then Text = 'moves text in insert mode with spaces' elseif Options = 'TextIns,Tab' then Text = 'moves text in insert mode with tab' elseif Options = 'Cursor' then Text = 'moves cursor' elseif Options = 'Text' then Text = 'moves text' elseif Options = 'Text,Whitespace' then Text = 'moves text over whitespace' elseif Options = 'TextIns' then Text = 'moves text in insert mode' elseif Options = 'TextIns,Whitespace' then Text = 'moves text in insert mode over whitespace' endif return Text ; --------------------------------------------------------------------------- defproc MenuText_tab KeyString = 'tab' KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) SetMenuVarText( KeyString, TabOptionsToText( Options)) ; --------------------------------------------------------------------------- defproc MenuText_c_tab KeyString = 'c_tab' KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) SetMenuVarText( KeyString, TabOptionsToText( Options)) ; --------------------------------------------------------------------------- defproc MenuText_c_a_tab KeyString = 'c_a_tab' KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) SetMenuVarText( KeyString, TabOptionsToText( Options)) ; --------------------------------------------------------------------------- defproc MenuText_s_backtab KeyString = 's_backtab' KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) SetMenuVarText( KeyString, TabOptionsToText( Options)) ; --------------------------------------------------------------------------- defproc MenuText_c_s_backtab KeyString = 'c_s_backtab' KeyPath = '\NEPMD\User\SpecialKeys\'KeyString Options = QueryConfigKey( KeyPath) SetMenuVarText( KeyString, TabOptionsToText( Options)) ; --------------------------------------------------------------------------- defproc MenuText_tabs KeyPath = '\NEPMD\User\Tabs' Val = QueryConfigKey( KeyPath) SettingName = 'tabs' SettingSrc = GetFileAVar( SettingName'.src') if SettingSrc = 'EA' then AppendText = ' (overridden by file EAs)' else AppendText = '' endif new = Val SetMenuVarText( 'tabs', new, AppendText) ; --------------------------------------------------------------------------- defproc MenuText_margins KeyPath = '\NEPMD\User\Margins' Val = QueryConfigKey( KeyPath) SettingName = 'margins' SettingSrc = GetFileAVar( SettingName'.src') if SettingSrc = 'EA' then AppendText = ' (overridden by file EAs)' else AppendText = '' endif new = Val SetMenuVarText( 'margins', new, AppendText) ; --------------------------------------------------------------------------- defproc MenuText_vposaftersearch KeyPath = '\NEPMD\User\CursorPos\VPosAfterSearch' val = QueryConfigKey( KeyPath) if val = 'C' then new = 'center' elseif val = 'K' then new = 'keep' else new = 'scroll' endif SetMenuVarText( 'vposaftersearch', new) ; --------------------------------------------------------------------------- defc SwitchVPosAfterSearch KeyPath = '\NEPMD\User\CursorPos\VPosAfterSearch' val = QueryConfigKey( KeyPath) if val = 'C' then val = 'K' elseif val = 'K' then val = 'S' else val = 'C' endif call WriteConfigKey( KeyPath, val) call MenuText_VPosAfterSearch() SetMenuAttribute( 'scrollaftersearch', MIA_DISABLED, val = 'S') ; --------------------------------------------------------------------------- defproc MenuText_scrollaftersearch KeyPath = '\NEPMD\User\CursorPos\ScrollAfterSearch' new = QueryConfigKey( KeyPath) SetMenuVarText( 'scrollaftersearch', new) ; --------------------------------------------------------------------------- defproc MenuText_syntaxexpansionkeys new = GetExpandKeys() SetMenuVarText( 'syntaxexpansionkeys', new) -- Max. word length of a command name: 28 chars ; --------------------------------------------------------------------------- defc menuinit_modeexpansion KeyPath = '\NEPMD\User\KeywordHighlighting' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'defaultkeywordhighlighting', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SyntaxExpansion' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'syntaxexpansion3', MIA_CHECKED, not on) SetMenuAttribute( 'selectcodingstyle', MIA_DISABLED, on) parse value GetExpandKeys() with FirstExpandKey SecondExpandKey SetMenuVarHint( 'syntaxexpansion3', FirstExpandKey, SecondExpandKey) KeyPath = '\NEPMD\User\SpecialKeys\MatchFindOnMove' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'matchfindonmove', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SpecialKeys\MatchFindOpening' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'matchfindopening', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\SpecialKeys\MatchInsertPair' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'matchinsertpair', MIA_CHECKED, not on) CurMode = GetMode() None = '-none-' new = GetCodingStyle() if new = '' then new = None endif SetMenuVarText( 'selectcodingstyle', new, CurMode) SetMenuVarText( 'openhilitedirs', CurMode) new = GetHiliteCacheDir() SetMenuVarText( 'hilitecachedirdialog', new) ; --------------------------------------------------------------------------- defc menuinit_readonlyandmodified KeyPath = '\NEPMD\User\Readonly' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'respectreadonly', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Lock\OnModify' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'lockonmodify', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Lock\OnLoad' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'lockonload', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Lock\MessageBoxOnError' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'msgboxonlockerror', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Save\MessageBoxOnError' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'msgboxonsaveerror', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\Check' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'checkforalternation', MIA_CHECKED, not on) SetMenuAttribute( 'msgboxifaltered', MIA_DISABLED, on) SetMenuAttribute( 'autoreload', MIA_DISABLED, on) SetMenuAttribute( 'autoreadonly', MIA_DISABLED, on) KeyPath = '\NEPMD\User\AlteredOnDisk\MessageBoxOnChange' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'msgboxifaltered', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReload' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'autoreload', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReadonly' on = QueryConfigKey( KeyPath) SetMenuAttribute( 'autoreadonly', MIA_CHECKED, not on) KeyPath = '\NEPMD\User\Modify\DiscardChanges' on = QueryConfigKey( KeyPath'\Untitled') SetMenuAttribute( 'discarduntitled', MIA_CHECKED, not on) on = QueryConfigKey( KeyPath'\NewShells') SetMenuAttribute( 'discardnewshells', MIA_CHECKED, not on) on = QueryConfigKey( KeyPath'\RestoredShells') SetMenuAttribute( 'discardrestoredshells', MIA_CHECKED, not on) on = QueryConfigKey( KeyPath'\OtherVirtual') SetMenuAttribute( 'discardothervirtual', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ToggleRespectReadonly KeyPath = '\NEPMD\User\Readonly' on = QueryConfigKey( KeyPath) WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'respectreadonly', MIA_CHECKED, not on) 'Ring enable_readonly 'on ; --------------------------------------------------------------------------- defc ToggleLockOnModify KeyPath = '\NEPMD\User\Lock\OnModify' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'lockonmodify', MIA_CHECKED, not on) if on then -- Uncheck other KeyPath = '\NEPMD\User\Lock\OnLoad' WriteConfigKey( KeyPath, not on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'lockonload', MIA_CHECKED, on) endif 'PostMe Ring LockOnModify 'on ; --------------------------------------------------------------------------- defc ToggleLockOnLoad KeyPath = '\NEPMD\User\Lock\OnLoad' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'lockonload', MIA_CHECKED, not on) if on then -- Uncheck other KeyPath = '\NEPMD\User\Lock\OnModify' WriteConfigKey( KeyPath, not on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'lockonmodify', MIA_CHECKED, on) endif if on then 'PostMe Ring Lock' else 'PostMe Ring Unlock' endif ; --------------------------------------------------------------------------- defc ToggleMsgBoxOnLockError KeyPath = '\NEPMD\User\Lock\MessageBoxOnError' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'msgboxonlockerror', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ToggleMsgBoxOnSaveError KeyPath = '\NEPMD\User\Save\MessageBoxOnError' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'msgboxonsaveerror', MIA_CHECKED, not on) ; --------------------------------------------------------------------------- defc ToggleCheckForAlternation KeyPath = '\NEPMD\User\AlteredOnDisk\Check' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'checkforalternation', MIA_CHECKED, not on) SetMenuAttribute( 'msgboxifaltered', MIA_DISABLED, on) SetMenuAttribute( 'autoreload', MIA_DISABLED, on) SetMenuAttribute( 'autoreadonly', MIA_DISABLED, on) ; --------------------------------------------------------------------------- defc ToggleMsgBoxIfAltered KeyPath = '\NEPMD\User\AlteredOnDisk\MessageBoxOnChange' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'msgboxifaltered', MIA_CHECKED, not on) if on then -- Uncheck others KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReload' WriteConfigKey( KeyPath, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReadonly' WriteConfigKey( KeyPath, not on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'autoreload', MIA_CHECKED, on) SetMenuAttribute( 'autoreadonly', MIA_CHECKED, on) endif ; --------------------------------------------------------------------------- defc ToggleAutoReload KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReload' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'autoreload', MIA_CHECKED, not on) if on then -- Uncheck others KeyPath = '\NEPMD\User\AlteredOnDisk\MessageBoxOnChange' WriteConfigKey( KeyPath, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReadonly' WriteConfigKey( KeyPath, not on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'msgboxifaltered', MIA_CHECKED, on) SetMenuAttribute( 'autoreadonly', MIA_CHECKED, on) endif ; --------------------------------------------------------------------------- defc ToggleAutoReadonly KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReadonly' on = QueryConfigKey( KeyPath) on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'autoreadonly', MIA_CHECKED, not on) if on then -- Uncheck others KeyPath = '\NEPMD\User\AlteredOnDisk\MessageBoxOnChange' WriteConfigKey( KeyPath, not on) KeyPath = '\NEPMD\User\AlteredOnDisk\AutoReload' WriteConfigKey( KeyPath, not on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on SetMenuAttribute( 'msgboxifaltered', MIA_CHECKED, on) SetMenuAttribute( 'autoreload', MIA_CHECKED, on) endif ; --------------------------------------------------------------------------- defc ToggleDiscardChanges NamePart = lowcase( strip( arg( 1))) if NamePart = 'untitled' then KeyName = 'Untitled' elseif NamePart = 'newshells' then KeyName = 'NewShells' elseif NamePart = 'restoredshells' then KeyName = 'RestoredShells' elseif NamePart = 'othervirtual' then KeyName = 'OtherVirtual' else 'SayError ToggleDiscardChanges: Unknown arg "'arg( 1)'"' return endif KeyPath = '\NEPMD\User\Modify\DiscardChanges\'KeyName -- Query value for current file before toggeling on = QueryConfigKey( KeyPath) PrevOn = on -- Toggle value on = not on WriteConfigKey( KeyPath, on) -- Set MIA_CHECKED attribute for the case MIA_NODISMISS attribute is on MenuName = 'discard'NamePart SetMenuAttribute( MenuName, MIA_CHECKED, not on) -- Reset .modify if required and configured if .modify then if on & on <> PrevOn then 'DiscardChanges' endif endif ; --------------------------------------------------------------------------- defc menuinit_restore KeyPath = '\NEPMD\User\History' Enabled = QueryConfigKey( KeyPath) Unchecked = (Enabled <> 1) SetMenuAttribute( 'trackhistorylists', MIA_CHECKED, Unchecked) KeyPath = '\NEPMD\User\AutoRestore\Ring\SaveLast' Enabled = QueryConfigKey( KeyPath) Unchecked = (Enabled <> 1) SetMenuAttribute( 'autosavelastring', MIA_CHECKED, Unchecked) KeyPath = '\NEPMD\User\AutoRestore\Ring\LoadLast' Enabled = QueryConfigKey( KeyPath) Unchecked = (Enabled <> 1) SetMenuAttribute( 'autoloadlastring', MIA_CHECKED, Unchecked) KeyPath = '\NEPMD\User\AutoRestore\CursorPos' Enabled = QueryConfigKey( KeyPath) Unchecked = (Enabled <> 1) SetMenuAttribute( 'restorecursorpos', MIA_CHECKED, Unchecked) KeyPath = '\NEPMD\User\AutoRestore\SearchOptions' RestoreType = QueryConfigKey( KeyPath) SetMenuAttribute( 'restoredefaultsearchoptions', MIA_CHECKED, RestoreType <> 'D') SetMenuAttribute( 'restorelastsearchoptions', MIA_CHECKED, RestoreType <> 'L') ; --------------------------------------------------------------------------- defc menuinit_backup KeyPath = '\NEPMD\User\AutoSave' on = (QueryConfigKey( KeyPath) <> 0) WriteConfigKey( KeyPath, on) SetMenuAttribute( 'autosaveenabled', MIA_CHECKED, not on) new = GetAutoSaveNum() SetMenuVarText( 'autosavenumdialog', new) SetMenuAttribute( 'autosavenumdialog', MIA_DISABLED, on) KeyPath = '\NEPMD\User\Backup' on = (QueryConfigKey( KeyPath) = 1) WriteConfigKey( KeyPath, on) SetMenuAttribute( 'backupenabled', MIA_CHECKED, not on) new = GetBackupNum() SetMenuVarText( 'backupnumdialog', new) SetMenuAttribute( 'backupnumdialog', MIA_DISABLED, on) new = GetBackupDir() SetMenuVarText( 'backupdirdialog', new) ; --------------------------------------------------------------------------- defc menuinit_directories KeyPath = '\NEPMD\User\StartDir\WorkDir\Type' opt = QueryConfigKey( KeyPath) SetMenuAttribute( 'workdirprogram', MIA_CHECKED, (opt = 1 | opt = 2)) SetMenuAttribute( 'workdirprev', MIA_CHECKED, not (opt = 1)) SetMenuAttribute( 'workdirfile', MIA_CHECKED, not (opt = 2)) KeyPath = '\NEPMD\User\StartDir\OpenDlg\Type' opt = QueryConfigKey( KeyPath) SetMenuAttribute( 'opendlgdirprev', MIA_CHECKED, (opt = 1 | opt = 2)) SetMenuAttribute( 'opendlgdirwork', MIA_CHECKED, not (opt = 1)) SetMenuAttribute( 'opendlgdirfile', MIA_CHECKED, not (opt = 2)) KeyPath = '\NEPMD\User\StartDir\SaveasDlg\Type' opt = QueryConfigKey( KeyPath) SetMenuAttribute( 'saveasdlgdirprev', MIA_CHECKED, (opt = 1)) SetMenuAttribute( 'saveasdlgdirwork', MIA_CHECKED, not (opt = 1)) ; --------------------------------------------------------------------------- defc menuinit_prg KeyPath = '\NEPMD\User\ProgramObjects\OpenSameWindow' opt = QueryConfigKey( KeyPath) SetMenuAttribute( 'prgnewwindow', MIA_CHECKED, not (opt = 1)) KeyPath = '\NEPMD\User\ProgramObjects\OmitOpenBox' opt = QueryConfigKey( KeyPath) SetMenuAttribute( 'prgomitopenbox', MIA_CHECKED, not (opt = 1)) ; --------------------------------------------------------------------------- defc menuinit_menu universal nodismiss universal menuitemshidden SetMenuAttribute( 'nodismiss', MIA_CHECKED, not (nodismiss = 32)) SetMenuAttribute( 'hideformatmenuitems', MIA_CHECKED, not menuitemshidden) ; --------------------------------------------------------------------------- defc menuinit_infobars universal show_longnames universal menu_prompt SetMenuAttribute( 'showlongname', MIA_CHECKED, not show_longnames) SetMenuAttribute( 'messageline', MIA_CHECKED, not QueryFrameControl( 2)) SetMenuAttribute( 'statusbar', MIA_CHECKED, not QueryFrameControl( 1)) SetMenuAttribute( 'infoattop', MIA_CHECKED, not QueryFrameControl( 32)) SetMenuAttribute( 'showmenuhints', MIA_CHECKED, not menu_prompt) ; --------------------------------------------------------------------------- defc menuinit_toolbar SetMenuAttribute( 'toolbarenabled', MIA_CHECKED, not QueryFrameControl( EFRAMEF_TOOLBAR)) parse value GetToolbarSetup() with \1 Style \1 Cx \1 Cy \1 . fText = not (Style bitand 16) fAutosize = not (Style bitand 4) fFlat = not (Style bitand 8) fScaleDel = (not (Style bitand 32)) and (not (Style bitand 64)) fScaleOr = (Style bitand 32) and (Style bitand 64) fScaleAnd = (Style bitand 32) and (not (Style bitand 64)) SetMenuAttribute( 'toolbartext', MIA_CHECKED, not fText) SetMenuAttribute( 'toolbarautosize', MIA_CHECKED, not fAutosize) SetMenuAttribute( 'toolbarsize', MIA_DISABLED, not fAutosize) SetMenuAttribute( 'toolbarscaling', MIA_DISABLED, not fAutosize) new = Cx'x'Cy SetMenuVarText( 'toolbarsize', new) if fScaleDel then new = 'delete' elseif fScaleOr then new = 'or' else new = 'and' endif SetMenuVarText( 'toolbarscaling', new) ; --------------------------------------------------------------------------- defproc MenuText_toolbarsize parse value GetToolbarSetup() with \1 Style \1 Cx \1 Cy \1 . new = Cx'x'Cy SetMenuVarText( 'toolbarsize', new) ; --------------------------------------------------------------------------- defc menuinit_miscellaneous universal menuloaded universal cursordimensions universal bitmap_present if menuloaded then KeyPath = '\NEPMD\User\Appearance\CursorStyle' Style = QueryConfigKey( KeyPath) SetMenuAttribute( 'cursorbar', MIA_CHECKED, not (Style = 1)) SetMenuAttribute( 'cursorunderline', MIA_CHECKED, not (Style = 2)) SetMenuAttribute( 'cursorcustom', MIA_CHECKED, not (Style = 3)) SetMenuAttribute( 'cursorbarwidth', MIA_DISABLED, (Style = 1)) SetMenuAttribute( 'cursorcustomdimen', MIA_DISABLED, (Style = 3)) KeyPath = '\NEPMD\User\Appearance\CursorWidth' CursorWidth = QueryConfigKey( KeyPath) new = CursorWidth SetMenuVarText( 'cursorbarwidth', new) new = cursordimensions SetMenuVarText( 'cursorcustomdimen', new) KeyPath = '\NEPMD\User\Appearance\PointerStyle' Style = QueryConfigKey( KeyPath) SetMenuAttribute( 'pointerarrow', MIA_CHECKED, not (Style = 1)) SetMenuAttribute( 'pointeribeam', MIA_CHECKED, not (Style = 2)) SetMenuAttribute( 'backgroundbitmapenabled', MIA_CHECKED, not bitmap_present) endif ; --------------------------------------------------------------------------- defproc GetPresetBitStr universal default_stream_mode universal cua_menu_accel CurrentMarkingMode = QueryMarkingMode() fAdvancedMarking = (CurrentMarkingMode = 'A') fCuaMarking = (CurrentMarkingMode = 'C') fCuaKeyset = (lowcase( GetAddKeyDefs()) = 'cua') fStreamMode = default_stream_mode KeyPath = '\NEPMD\User\CursorPos\CursorEverywhere' fCursorEverywhere = (QueryConfigKey( KeyPath) <> 0) KeyPath1 = '\NEPMD\User\SpecialKeys\HomeToggles' KeyPath2 = '\NEPMD\User\SpecialKeys\EndToggles' fHomeEndToggle = ((QueryConfigKey( KeyPath1) = 1) & (QueryConfigKey( KeyPath2) = 1)) fBlockAltLetter = not cua_menu_accel KeyPath = '\NEPMD\User\SyntaxExpansion' fSyntaxExpansion = QueryConfigKey( KeyPath) KeyPath1 = '\NEPMD\User\SpecialKeys\MatchFindOnMove' KeyPath2 = '\NEPMD\User\SpecialKeys\MatchFindOpening' KeyPath3 = '\NEPMD\User\SpecialKeys\MatchInsertPair' fMatchBrackets = (QueryConfigKey( KeyPath1) & QueryConfigKey( KeyPath2) & QueryConfigKey( KeyPath3)) BitStr = '' || fAdvancedMarking || fCuaMarking || fCuaKeyset || fStreamMode || fCursorEverywhere || fHomeEndToggle || fBlockAltLetter || fSyntaxExpansion || fMatchBrackets return BitStr ; --------------------------------------------------------------------------- defc ApplyPresetBitStr universal default_stream_mode universal cua_menu_accel do once = 1 to 1 -- Query BitStr BitStr = SpaceStr( arg( 1), 0) -- Check BitStr if length( BitStr) <> length( SpaceStr( PRESET_BITSTR_USER_CUA, 0)) then leave elseif (verify( BitStr, '01') <> 0) then leave endif -- Parse BitStr fAdvancedMarking = substr( BitStr, 1, 1) fCuaMarking = substr( BitStr, 2, 1) fCuaKeyset = substr( BitStr, 3, 1) fStreamMode = substr( BitStr, 4, 1) fCursorEverywhere = substr( BitStr, 5, 1) fHomeEndToggle = substr( BitStr, 6, 1) fBlockAltLetter = substr( BitStr, 7, 1) fSyntaxExpansion = substr( BitStr, 8, 1) fMatchBrackets = substr( BitStr, 9, 1) -- Apply bits if fAdvancedMarking then 'SwitchMarkingMode A' elseif fCuaMarking then 'SwitchMarkingMode C' endif if fCuaKeyset <> (lowcase( GetAddKeyDefs()) = 'cua') then 'toggle_AddKeyDefs cuakeys' endif if fStreamMode <> default_stream_mode then 'toggle_default_stream' endif KeyPath = '\NEPMD\User\CursorPos\CursorEverywhere' if fCursorEverywhere <> (QueryConfigKey( KeyPath) <> 0) then 'toggle_cursor_everywhere' endif KeyPath1 = '\NEPMD\User\SpecialKeys\HomeToggles' KeyPath2 = '\NEPMD\User\SpecialKeys\EndToggles' if fCursorEverywhere <> ((QueryConfigKey( KeyPath1) = 1) & (QueryConfigKey( KeyPath2) = 1)) then 'toggle_HomeEndToggle' endif if fBlockAltLetter <> (not cua_menu_accel) then 'toggle_Accel' endif KeyPath = '\NEPMD\User\SyntaxExpansion' if fSyntaxExpansion <> QueryConfigKey( KeyPath) then 'ToggleSyntaxExpansion' endif KeyPath1 = '\NEPMD\User\SpecialKeys\MatchFindOnMove' KeyPath2 = '\NEPMD\User\SpecialKeys\MatchFindOpening' KeyPath3 = '\NEPMD\User\SpecialKeys\MatchInsertPair' if fMatchBrackets <> (QueryConfigKey( KeyPath1) & QueryConfigKey( KeyPath2) & QueryConfigKey( KeyPath3)) then 'toggle_MatchBrackets' endif -- E precision is max. 9 digits, compare or DigitComp is required SetMenuAttribute( 'presetusercua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_USER_CUA)) SetMenuAttribute( 'presetprogcua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_CUA)) SetMenuAttribute( 'presetprogstd', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_STD)) enddo ; --------------------------------------------------------------------------- defc TogglePresetBit do once = 1 to 1 Bit = strip( arg( 1)) if not IsUInt( Bit) then leave endif if Bit = 1 then 'SwitchMarkingMode A' elseif Bit = 2 then 'SwitchMarkingMode C' elseif Bit = 3 then 'toggle_AddKeyDefs cuakeys' elseif Bit = 4 then 'toggle_default_stream' elseif Bit = 5 then 'toggle_cursor_everywhere' elseif Bit = 6 then 'toggle_HomeEndToggle' elseif Bit = 7 then 'toggle_Accel' elseif Bit = 8 then 'ToggleSyntaxExpansion' elseif Bit = 9 then 'toggle_MatchBrackets' endif BitStr = GetPresetBitStr() -- E precision is max. 9 digits, compare or DigitComp is required SetMenuAttribute( 'presetusercua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_USER_CUA)) SetMenuAttribute( 'presetprogcua', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_CUA)) SetMenuAttribute( 'presetprogstd', MIA_CHECKED, DigitComp( BitStr, PRESET_BITSTR_PROG_STD)) enddo ; --------------------------------------------------------------------------- defc SwitchMarkingBit do once = 1 to 1 parse arg Bit Val Bit = strip( Bit) Val = strip( Val) if Val = '?' then leave endif if Bit = 1 then if Val = 'T' then 'toggle_default_paste' endif elseif Bit = 2 then 'SwitchShiftMarkAlwaysExtends 'Val elseif Bit = 3 then if Val = 'T' then 'toggle_lineinsert' endif elseif Bit = 4 then 'SwitchReplaceMark 'Val elseif Bit = 5 then 'SwitchDirectMarkActions 'Val elseif Bit = 6 then 'SwitchUnmarkOnAnyKey 'Val elseif Bit = 7 then if Val = 'T' then 'toggle_unmark_after_move' endif elseif Bit = 8 then 'SwitchDefaultMouseMark 'Val elseif Bit = 9 then 'SwitchGoToMouseMarkPos 'Val elseif Bit = 10 then 'SwitchDoubleClickMarks 'Val elseif Bit = 11 then if Val = 'T' then 'Toggle4os2MouseMark' endif elseif Bit = 12 then 'SwitchDoubleClickUnmarks 'Val elseif Bit = 13 then if Val = 'T' then 'toggle_SearchMarkIfMarked' endif elseif Bit = 14 then if Val = 'T' then 'toggle_SearchMarkedWords' endif endif CurrentMarkingBitStr = GetCurrentMarkingBitStr() -- E precision is max. 9 digits, DigitComp is required SetMenuAttribute( 'advancedmarking', MIA_CHECKED, DigitComp( CurrentMarkingBitStr, MARKING_BITSTR_ADV)) SetMenuAttribute( 'cuamarking', MIA_CHECKED, DigitComp( CurrentMarkingBitStr, MARKING_BITSTR_CUA)) 'RefreshInfoLine MARKINGMODE' enddo