home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
cstepm.zip
/
custepm.e
< prev
next >
Wrap
Text File
|
1995-01-16
|
18KB
|
371 lines
; This is included as a site version of MYEXTRA.E (and so part of EXTRA.EX)
; if EXTRA.EX = 1, or as a site version of MYSTUFF.E (and so part of EPM.EX)
; if EXTRA.EX = 0.
; Or, as of March 29, 1993, this can be compiled as a stand-alone module which
; is linked from one of the above.
compile if not defined(SMALL) -- If SMALL not defined, then being separately compiled
define INCLUDING_FILE = 'CUSTEPM.E'
const
tryinclude 'MYCNF.E' -- the user's configuration customizations.
compile if not defined(SITE_CONFIG)
const SITE_CONFIG = 'SITECNF.E'
compile endif
compile if SITE_CONFIG
tryinclude SITE_CONFIG
compile endif
const
compile if not defined(WANT_BRACKET_MATCHING)
WANT_BRACKET_MATCHING = 0
compile endif
compile if not defined(WANT_DYNAMIC_PROMPTS) -- This must appear *before* ENGLISH.E.
WANT_DYNAMIC_PROMPTS = 1
compile endif
compile if not defined(NLS_LANGUAGE)
NLS_LANGUAGE = 'ENGLISH'
compile endif
include NLS_LANGUAGE'.e'
define -- We're being compiled standalone, so we know we must want the rest.
SKIP_REST_OF_FILE = 0
compile else -- not defined(SMALL) else being included from MYSTUFF or MYEXTRA
define -- so if we should link separately, then only define the stub here.
SKIP_REST_OF_FILE = LINK_CUSTEPM_SEPARATELY
compile if LINK_CUSTEPM_SEPARATELY
definit
'linkverify custepm'
compile endif
compile endif -- not defined(SMALL)
compile if not SKIP_REST_OF_FILE
const -- Text defined separately, for easier NLS translation
ACTIONS_BAR__MSG = TILDE_CHAR'Actions ' -- See also ACTIONS_ACCEL__L in CUSTEPM.CFG
BOX_MENU__MSG = '~Box'
BOX_1_MENU__MSG = 'Box ~1 - │'
BOX_2_MENU__MSG = 'Box ~2 - ║'
BOX_3_MENU__MSG = 'Box ~3 - |'
BOX_4_MENU__MSG = 'Box ~4 - █'
BOX_5_MENU__MSG = 'Box ~5 - ╤'
BOX_6_MENU__MSG = 'Box ~6 - ╥'
BOX_A_MENU__MSG = 'Box ~Asm'
BOX_B_MENU__MSG = 'Box ~Blanks'
BOX_C_MENU__MSG = 'Box ~C'
BOX_E_MENU__MSG = 'Box ~E'
BOX_P_MENU__MSG = 'Box ~Pascal'
BOX_R_MENU__MSG = 'Box ~Remove'
BOX_S_MENU__MSG = 'Box ~Script'
DRAW_MENU__MSG = '~Draw'
DRAW_1_MENU__MSG = 'Draw ~1 - │'
DRAW_2_MENU__MSG = 'Draw ~2 - ║'
DRAW_3_MENU__MSG = 'Draw ~3 - |'
DRAW_4_MENU__MSG = 'Draw ~4 - █'
DRAW_5_MENU__MSG = 'Draw ~5 - ╤'
DRAW_6_MENU__MSG = 'Draw ~6 - ╥'
DRAW_B_MENU__MSG = 'Draw ~Blanks'
HOST_SCREEN_MENU__MSG = '~Host screen'
SCREEN_A_MENU__MSG = 'Screen ~A'
SCREEN_B_MENU__MSG = 'Screen ~B'
SCREEN_C_MENU__MSG = 'Screen ~C'
SCREEN_D_MENU__MSG = 'Screen ~D'
SCREEN_E_MENU__MSG = 'Screen ~E'
SCREEN_F_MENU__MSG = 'Screen ~F'
SCREEN_G_MENU__MSG = 'Screen ~G'
SCREEN_H_MENU__MSG = 'Screen ~H'
SCREEN_I_MENU__MSG = 'Screen ~I'
SCREEN_J_MENU__MSG = 'Screen ~J'
SCAN_TEXT_MENU__MSG = 'Scan for ~text...'
GREP_TEXT_MENU__MSG = 'G~REP for text...'
SORT_LINES_MENU__MSG = '~Sort lines'
SORT_ASCENDING__MSG = 'Sort ~ascending'
SORT_DESCENDING__MSG = 'Sort ~descending'
compile if EVERSION >= 5.50 -- GPI version required for code folding
FOLD_CODE_MENU__MSG = '~Fold code'
EXPAND_CODE_MENU__MSG = '~Expand code'
compile endif
compile if WANT_BRACKET_MATCHING
MATCH_BRACKET_MENU__MSG='~Match bracket'
compile endif
GML_TAGS_MENU__MSG = '~GML tags'
SGML_TAGS_MENU__MSG = 'SGM~L tags'
HTML_TAGS_MENU__MSG = 'HTML t~ags'
LATEX_CMDS_MENU__MSG = '~LaTeX commands'
PRINTER_CODES_MENU__MSG='~Printer codes'
compile if WANT_DYNAMIC_PROMPTS
ACTIONS_BARP__MSG = \1'Additional actions that can be taken with text regions'
BOX_MENUP__MSG = \1'Draw box around marked block'
BOX_x_MENUP__MSG = \1'Draw a box using line style shown'
BOX_A_MENUP__MSG = \1'Draw a box using Assembler comments'
BOX_B_MENUP__MSG = \1'Draw a box using blanks'
BOX_C_MENUP__MSG = \1'Draw a box using C comments'
BOX_E_MENUP__MSG = \1'Draw a box using E comments'
BOX_P_MENUP__MSG = \1'Draw a box using Pascal comments'
BOX_R_MENUP__MSG = \1'Reflow the text in the block'
BOX_S_MENUP__MSG = \1'Draw a box using Script comments'
DRAW_MENUP__MSG = \1'Draw lines; press Esc to stop'
DRAW_x_MENUP__MSG = \1'Draw lines using line style shown'
DRAW_B_MENUP__MSG = \1'Draw lines using blanks'
HOST_SCREEN_MENUP__MSG = \1'Capture the host screen'
SCREEN_A_MENUP__MSG = \1'Capture host screen - session A'
SCREEN_B_MENUP__MSG = \1'Capture host screen - session B'
SCREEN_C_MENUP__MSG = \1'Capture host screen - session C'
SCREEN_D_MENUP__MSG = \1'Capture host screen - session D'
SCREEN_E_MENUP__MSG = \1'Capture host screen - session E'
SCREEN_F_MENUP__MSG = \1'Capture host screen - session F'
SCREEN_G_MENUP__MSG = \1'Capture host screen - session G'
SCREEN_H_MENUP__MSG = \1'Capture host screen - session H'
SCREEN_I_MENUP__MSG = \1'Capture host screen - session I'
SCREEN_J_MENUP__MSG = \1'Capture host screen - session J'
SCAN_TEXT_MENUP__MSG = \1'Search for text in external files'
GREP_TEXT_MENUP__MSG = \1'Search for text in external files using GREP algorithm'
SORT_LINES_MENUP__MSG = \1'Sort lines in ascending or descending order'
SORT_ASCENDINGP__MSG = \1'Sort lines in ascending order'
SORT_DESCENDINGP__MSG = \1'Sort lines in descending order'
compile if EVERSION >= 5.50 -- GPI version required for code folding
FOLD_CODE_MENUP__MSG = \1'Place cursor on bracket & select to fold bracketed code'
EXPAND_CODE_MENUP__MSG = \1'Place cursor inside folded code & select to expand code'
compile endif
compile if WANT_BRACKET_MATCHING
MATCH_BRACKET_MENUP__MSG=\1'Place cursor on bracket & select to find match'
compile endif
GML_TAGS_MENUP__MSG = \1'Add/remove GML Tag menu to/from the action bar'
SGML_TAGS_MENUP__MSG = \1'Add/remove SGML Tag menu to/from the action bar'
HTML_TAGS_MENUP__MSG = \1'Add/remove HTML Tag menu to/from the action bar'
LATEX_CMDS_MENUP__MSG = \1'Add/remove LaTeX menu to/from the action bar'
PRINTER_CODES_MENUP__MSG=\1'Add/remove Printer Codes menu to/from the action bar'
compile else
ACTIONS_BARP__MSG = ''
BOX_MENUP__MSG = ''
BOX_x_MENUP__MSG = ''
BOX_A_MENUP__MSG = ''
BOX_B_MENUP__MSG = ''
BOX_C_MENUP__MSG = ''
BOX_E_MENUP__MSG = ''
BOX_P_MENUP__MSG = ''
BOX_R_MENUP__MSG = ''
BOX_S_MENUP__MSG = ''
DRAW_MENUP__MSG = ''
DRAW_x_MENUP__MSG = ''
DRAW_B_MENUP__MSG = ''
HOST_SCREEN_MENUP__MSG = ''
SCREEN_A_MENUP__MSG = ''
SCREEN_B_MENUP__MSG = ''
SCREEN_C_MENUP__MSG = ''
SCREEN_D_MENUP__MSG = ''
SCREEN_E_MENUP__MSG = ''
SCREEN_F_MENUP__MSG = ''
SCREEN_G_MENUP__MSG = ''
SCREEN_H_MENUP__MSG = ''
SCREEN_I_MENUP__MSG = ''
SCREEN_J_MENUP__MSG = ''
SCAN_TEXT_MENUP__MSG = ''
GREP_TEXT_MENUP__MSG = ''
SORT_LINES_MENUP__MSG = ''
SORT_ASCENDINGP__MSG = ''
SORT_DESCENDINGP__MSG = ''
compile if EVERSION >= 5.50 -- GPI version required for code folding
FOLD_CODE_MENUP__MSG = ''
EXPAND_CODE_MENUP__MSG = ''
compile endif
compile if WANT_BRACKET_MATCHING
MATCH_BRACKET_MENUP__MSG=''
compile endif
GML_TAGS_MENUP__MSG = ''
SGML_TAGS_MENUP__MSG = ''
HTML_TAGS_MENUP__MSG = ''
LATEX_CMDS_MENUP__MSG = ''
PRINTER_CODES_MENUP__MSG=''
compile endif -- WANT_DYNAMIC_PROMPTS
SCAN_TITLE__MSG = 'Scan for text in files'
SCAN_PROMPT__MSG = 'Enter string (in quotes if it contains spaces) and file spec.'
OK__MSG = '~OK'
GREP_WARNING__MSG = 'No filespec given - select OK if you really want to search all files. (Specify *.* to avoid this warning.)'
definit
compile if EVERSION < 6
'postme add_actions_menu' -- Make this happen *after* menus are built.
compile else
'postme postme add_actions_menu' -- Need to delay it longer, since EPM32 does a postme of its menu creation.
compile endif
defc add_actions_menu
universal defaultmenu, activemenu
universal GML_tags_menu_flag, SGML_tags_menu_flag, HTML_tags_menu_flag, printer_codes_menu_flag
deletemenu defaultmenu, 6, 0, 0 -- delete the existing Help menu (we want it to stay at the right)
buildsubmenu defaultmenu, 37, ACTIONS_BAR__MSG, ACTIONS_BARP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3760, BOX_MENU__MSG, BOX_MENUP__MSG, 17, 0
buildmenuitem defaultmenu, 37, 3761, BOX_1_MENU__MSG, 'box 1'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3762, BOX_2_MENU__MSG, 'box 2'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3763, BOX_3_MENU__MSG, 'box 3'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3764, BOX_4_MENU__MSG, 'box 4'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3765, BOX_5_MENU__MSG, 'box 5'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3766, BOX_6_MENU__MSG, 'box 6'BOX_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3767, BOX_A_MENU__MSG, 'box A'BOX_A_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3768, BOX_B_MENU__MSG, 'box B'BOX_B_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3769, BOX_C_MENU__MSG, 'box C'BOX_C_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3770, BOX_E_MENU__MSG, 'box E'BOX_E_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3771, BOX_P_MENU__MSG, 'box P'BOX_P_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3772, BOX_R_MENU__MSG, 'box R'BOX_R_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3773, BOX_S_MENU__MSG, 'box S'BOX_S_MENUP__MSG, 32769, 0
buildmenuitem defaultmenu, 37, 3780, DRAW_MENU__MSG, DRAW_MENUP__MSG, 17, 0
buildmenuitem defaultmenu, 37, 3781, DRAW_1_MENU__MSG, 'draw 1'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3782, DRAW_2_MENU__MSG, 'draw 2'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3783, DRAW_3_MENU__MSG, 'draw 3'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3784, DRAW_4_MENU__MSG, 'draw 4'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3785, DRAW_5_MENU__MSG, 'draw 5'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3786, DRAW_6_MENU__MSG, 'draw 6'DRAW_x_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3787, DRAW_B_MENU__MSG, 'draw B'DRAW_B_MENUP__MSG, 32769, 0
buildmenuitem defaultmenu, 37, 3788, \0, '', 4, 0
buildmenuitem defaultmenu, 37, 3700, HOST_SCREEN_MENU__MSG, HOST_SCREEN_MENUP__MSG, 17, 0
buildmenuitem defaultmenu, 37, 3701, SCREEN_A_MENU__MSG, 'gethost A'SCREEN_A_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3702, SCREEN_B_MENU__MSG, 'gethost B'SCREEN_B_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3703, SCREEN_C_MENU__MSG, 'gethost C'SCREEN_C_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3704, SCREEN_D_MENU__MSG, 'gethost D'SCREEN_D_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3705, SCREEN_E_MENU__MSG, 'gethost E'SCREEN_E_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3706, SCREEN_F_MENU__MSG, 'gethost F'SCREEN_F_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3707, SCREEN_G_MENU__MSG, 'gethost G'SCREEN_G_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3708, SCREEN_H_MENU__MSG, 'gethost H'SCREEN_H_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3709, SCREEN_I_MENU__MSG, 'gethost I'SCREEN_I_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3710, SCREEN_J_MENU__MSG, 'gethost J'SCREEN_J_MENUP__MSG, 32769, 0
buildmenuitem defaultmenu, 37, 3711, \0, '', 4, 0
buildmenuitem defaultmenu, 37, 3720, SCAN_TEXT_MENU__MSG, 'Scan'SCAN_TEXT_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3721, GREP_TEXT_MENU__MSG, 'GREP'GREP_TEXT_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3730, SORT_LINES_MENU__MSG, SORT_LINES_MENUP__MSG, 17, 0
buildmenuitem defaultmenu, 37, 3731, SORT_ASCENDING__MSG, 'sort'SORT_ASCENDINGP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3732, SORT_DESCENDING__MSG, 'sort R'SORT_DESCENDINGP__MSG, 32769, 0
buildmenuitem defaultmenu, 37, 3733, \0, '', 4, 0
compile if EVERSION >= 5.50 -- GPI version required for code folding
buildmenuitem defaultmenu, 37, 3735, FOLD_CODE_MENU__MSG, 'fold'FOLD_CODE_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3736, EXPAND_CODE_MENU__MSG, 'fold 0'EXPAND_CODE_MENUP__MSG, 0, 0
compile endif
compile if WANT_BRACKET_MATCHING
buildmenuitem defaultmenu, 37, 3737, MATCH_BRACKET_MENU__MSG, 'match_bracket'MATCH_BRACKET_MENUP__MSG, 0, 0
compile endif
compile if EVERSION >= 5.50 or WANT_BRACKET_MATCHING
buildmenuitem defaultmenu, 37, 3738, \0, '', 4, 0
compile endif
buildmenuitem defaultmenu, 37, 3740, GML_TAGS_MENU__MSG, 'link_gmltags'GML_TAGS_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3742, SGML_TAGS_MENU__MSG, 'link_sgmltags'SGML_TAGS_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3743, HTML_TAGS_MENU__MSG, 'link_htmltags'HTML_TAGS_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3745, LATEX_CMDS_MENU__MSG, 'link_LaTeX'LATEX_CMDS_MENUP__MSG, 0, 0
buildmenuitem defaultmenu, 37, 3750, PRINTER_CODES_MENU__MSG, 'epmprt'PRINTER_CODES_MENUP__MSG, 0, 0
call readd_help_menu()
if printer_codes_menu_flag='' then printer_codes_menu_flag=0; endif
defc menuinit_37
universal GML_tags_menu_flag, SGML_tags_menu_flag, HTML_tags_menu_flag, printer_codes_menu_flag, LaTeX_cmds_menu_flag
SetMenuAttribute( 3740, 8192, not GML_tags_menu_flag)
SetMenuAttribute( 3742, 8192, not SGML_tags_menu_flag)
SetMenuAttribute( 3743, 8192, not HTML_tags_menu_flag)
SetMenuAttribute( 3745, 8192, not LaTeX_cmds_menu_flag)
SetMenuAttribute( 3750, 8192, not printer_codes_menu_flag)
compile if WANT_BRACKET_MATCHING
defc match_bracket = call passist()
compile endif
defc link_gmltags
universal GML_tags_menu_flag
universal defaultmenu, activemenu
if GML_tags_menu_flag then
deletemenu defaultmenu, 38, 0, 0
call maybe_show_menu()
GML_tags_menu_flag = 0
unlink 'gmltags'
return
endif
'linkverify gmltags'
defc link_sgmltags
universal SGML_tags_menu_flag
universal defaultmenu, activemenu
if SGML_tags_menu_flag then
deletemenu defaultmenu, 40, 0, 0
call maybe_show_menu()
SGML_tags_menu_flag = 0
unlink 'sgmltags'
return
endif
'linkverify sgmltags'
defc link_htmltags
universal HTML_tags_menu_flag
universal defaultmenu, activemenu
if HTML_tags_menu_flag then
deletemenu defaultmenu, 41, 0, 0
call maybe_show_menu()
HTML_tags_menu_flag = 0
unlink 'htmltags'
return
endif
'linkverify htmltags'
defc link_LaTeX
universal LaTeX_cmds_menu_flag
universal defaultmenu, activemenu
if LaTeX_cmds_menu_flag then
deletemenu defaultmenu, 39, 0, 0
call maybe_show_menu()
LaTeX_cmds_menu_flag = 0
unlink 'latexmnu'
return
endif
'linkverify latexmnu'
defc scan
call grep_common(arg(1), '/a')
defc grep =
call grep_common(arg(1))
defproc grep_common(search_arg)
if search_arg='' then
parse value entrybox(SCAN_TITLE__MSG,'/'OK__MSG'/'Cancel__MSG'/',\0,'',200,
atoi(1) || atoi(0) || gethwndc(APP_HANDLE) ||
SCAN_PROMPT__MSG) with button 2 search_arg \0
if button<>\1 then return; endif
endif
temp = strip(search_arg)
do while temp <> ''
if pos(leftstr(temp, 1), '-/') then
parse value temp with . temp
else
leave
endif
enddo
if leftstr(temp, 1)='"' then
parse value temp with 2 '"' temp
else
parse value temp with . temp
endif
if temp='' then
if 1<> winmessagebox(sayerrortext(-275), GREP_WARNING__MSG, 16673 ) -- MB_OKCANCEL + MB_CUAWARNING + MB_DEFBUTTON2 + MB_MOVEABLE)
then
return
endif
endif
sayerror 'Scanning files...'
call redirect('grep', arg(2) '/y /q /l' search_arg)
if not .last | (.last=1 & leftstr(textline(.last), 7) = 'SEARCH:') then
'q'
sayerror 'No hits.'
endif
defproc redirect(cmd)
universal vTEMP_PATH
outfile=vTEMP_PATH || substr(cmd'_______',1,8) || '.out'
quietshell cmd arg(2) '>'outfile '2>&1'
if RC = sayerror('Insufficient memory') or
RC = sayerror('File Not found') then stop; endif
'e /u /d' outfile
.filename='.Output from' cmd arg(2)
call erasetemp(outfile)
compile endif -- not SKIP_REST_OF_FILE