home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
High Voltage Shareware
/
high1.zip
/
high1
/
DIR4
/
TEXMAC.ZIP
/
MENUS.SPM
< prev
next >
Wrap
Text File
|
1991-11-24
|
12KB
|
440 lines
; Scribe compatible Sprint Alternative User Interface v. 1.01
; Copyright (c) 1988 Borland International. All Rights Reserved.
;
; NAME: Menu.UIM
; VERSION: 1.
; DESCRIPTION: Menus and Keystroke macros used by the user
; interface, merged from SP & FWII
; LAST UPDATE: September 9, 1988. RDT: 1/6/91
; -----------------------------------------------------------------
; Deletions
; -----------------------------------------------------------------
; Variables
; -----------------------------------------------------------------
; Forward Declarations
; -----------------------------------------------------------------
; Automatically-Called Macro Definitions
; -----------------------------------------------------------------
; General Macros
; -----------------------------------------------------------------
; Menus
PrintMenu : WPPrintMenu
FormatMenu : ScribeFormatMenu
AltPrintMenu : TeXDVIMenu
AltFormatMenu : TexFormatMenu
UIMenu :
menu "User Interface" {
"Function Keys" KeyReMap,
"Reset Shortcuts" MacroClear,
"_",
"Load" UIOpen,
"Save" UIWriteAs
}
ToneMenu :
do {
infobox "Tone" {
soundfreq "Pitch\>%d Hz ",
sounddur "Length\>%d msec",
"_",
"UP\>Higher Pitch",
"DOWN\>Lower Pitch",
"LEFT\>Shorter Length",
"RIGHT \>Longer Length"
}
MenuKey case {
'^[', abortkey abort,
148h soundfreq + 20->soundfreq ; up
if (soundfreq > 2000) (2000->soundfreq),
14bh sounddur - 10 ->sounddur ; left
if (sounddur < 10) (10->sounddur),
14dh sounddur + 10 ->sounddur ; right
if (sounddur > 400) (400->sounddur),
150h soundfreq - 20->soundfreq ; down
if (soundfreq < 20) (20->soundfreq)
}
if !keypressed (1 Bell) SetOvlModf
}
CustOptMenu :
do {
menu "Options" {
EraseSwap "Preserve Editing Session\>%[YES%:NO%]"
!EraseSwap->EraseSwap,
((swapdelay>>1)&7FFFH)/500 "Background Save Period\>%[ OFF%:%2u Sec%]"
3 rangeget 60 "Background save period (in seconds)" -> swapdelay
swapdelay * 1000 -> swapdelay,
(menudelay/100) "Menu Display Delay\>%[NO DELAY%:%4u%]"
menudelay/100 rangeget 100
"Delay before menu display (in tenths of seconds)"
* 100 -> menudelay,
(BIGDOS ==16) "DOS Shell Size\>%[SMALL%:LARGE%]"
if (BIGDOS == 16) (0->BIGDOS) else (16->BIGDOS)
SetOvlModf,
"_",
overwrite "Insert Mode\>%[INSERT%:OVERWRITE%]" ToggleIns,
"Tone" ToneMenu
}
SetOvlModf
}
; ---------- Help Menu Functions ----------
HelpTemplate :
; draw
; infobox(
; "","","","","",""," Legend:","","",
; " Unshifted (edit)",
; " ^ Ctrl (file)",
; " + SHIFT (window)",
; " ~ Alt ",
; "","","","","","","") (
; infobox "Sprint Template" (
; "F1 Help │ Glossary Recall F2",
; "^ Correct Bad │ Save File\>^",
; "+ SPELL MENU │ WINDOW RESIZE\>+",
; "~ Thesaurus │",
; "_┼",
; "F3 Toggle Select │ Copy F4",
; "^ Open File │ Close File\>^",
; "+ OPEN WINDOW │ CLOSE WINDOW\>+",
; "_┼",
; "F5 Move │ Paste F6",
; "^ File Back │ File Fwd\>^",
; "+ ZOOM │ NEXT WINDOW\>+",
; "_┼",
; "F7 Search Fwd │ Replace F8",
; "^ Paginate │ Preview\>^",
; "+ SCROLL ALL UP │ SCROLL ALL DOWN\>+",
; "_┼",
; "F9 Go to Line │ Main Menu F10",
; "^ Pick File │",
; "+ CLOSE ALL │"
; )
; (0 wait) KeyGet redraw abort)
HelpKeyFunction :
HelpDisk
int ktmp
0-> int quit
do {
message "\nPress the key you want help on ("
-abortkey + 27 status "%[Esc%:%27-~+c%] twice to quit): "
KeyGet -> ktmp = abortkey? (1->quit) : (0->quit)
draw
ktmp keyhelp 2 help Q0
} while(!quit)
; Context Coercion for help
LastHelp :
HelpMenu :
HelpDisk
menu "Help" {
"Function Keys" HelpTemplate,
"Index" 2 help "",
"Last Help" LastHelp 1 help,
"Keyboard Help" HelpKeyFunction
}
ThesMenu :
int t
if ((0 subchar engine) != 't') {
status "\nLoading thesaurus..."
set Q0 "thesaur.eng" NeedDisk
set engine "thesaur AMERICAN.THS"
}
mark {
if !istoken (r to istoken)
r past istoken
copy past istoken QD ; 'original' word
copy past istoken Q0 ; 'previous' word
set Q4 Q0 ; initial prev word is same as Q0
do {
(128+256+1 runengine past istoken) -> t
if (t=0) break
if (t&128) {
delete past istoken
insert QD
r past istoken
}
if (t&256) {
delete past istoken
insert Q0
r past istoken
}
set Q0 Q4
copy past istoken Q4 ; 'previous' word
}
if !t {
draw message "\nNot in thesaurus."
}
}
CorrectMenu : menu "Spelling" {
"Rest of File" CorrectRest,
"Paragraph" CorrectPara,
"Word" CorrectWord,
"Block" CorrectRegion,
"_",
"Last Bad Word" CorrectLastBad,
"Every Bad Word" CorrectAllBad,
"_",
AutoCorrect "AutoSpell\>%[OFF%:ON%]"
if !AutoCorrect (
0->BadWordPending
set QE ""
if !stopped LoadSpeller
1->AutoCorrect
)
else (0->AutoCorrect)
abort,
(0 GetDictionary) "Main Dictionary\>" Q0 0 SetDictionary abort,
(1 GetDictionary) "User Dictionary\>" Q0 1 SetDictionary abort,
"_",
"Thesaurus" ThesMenu
}
DiskDirectory :
menu "File Manager" {
"Copy" FileCopy,
"Rename-Move" FileRename,
"Delete" FileDelete,
"_", ; cd,
"Set Directory" SetCurrentDir,
"Quick Directory" set Q0 "" message "\nDir name: " set Q0 call "command /c cdx" Q0,
"Goto Directory" DirectoryNew abort,
"List Directory" call "command /c Dirmagic"
}
FilesMenu : menu "Files" (
"Open" FileOpen,
"Next" FileFwd,
"Previous" FileBack,
"Close" FileClose,
"Revert to saved" RevertToSaved,
"Save" FileSave,
"Write as ..." FileWrite,
"Insert file" FileInsert,
"Block write" RegionWrite,
"List open files" FilePick,
; "Goto directory" DirectoryGoTo,
"_" cd,
"Manage Files" DiskDirectory)
MacroMenu : menu "Macros" (
"Enter" MacroExecute,
"Assign to key" KeyAssignMacro,
"Load from disk" MacroLoad,
"Compile current" MacroRunFile,
"Misc. Macros" PickCommandMenu,
"Key Binding" KeyReport,
"Binding report" KeyReportAll,
; "_Key Record",
; "Begin" MacroCollBegin KeyRecordMsg,
; "Halt" MacroCollHalt,
; "Do" MacroCollDo,
; "Iterate" MacroCollRepeat,
; "Get (from disk)" MacroCollLoad,
; "Save (to disk)" MacroCollSave,
"_",
; "Run DOS Command" SystemCommand,
"Value of current char." CharValue
)
; interesting history here. early on, gloss was only for text
; blocks. it was then expanded for key recordings, hence some confusion
GlossMenu :
menu "Glossary" {
"Recall" GlossLookup4,
"Assign to Key" KeyAssignGloss,
"_",
"Define Region" GlossDefine1,
"Keyboard Record" KeyRecordGloss,
"Erase" GlossDelete,
"_",
"Merge" GlossMerge,
"List" GlossList,
(set QD QA mark {
to QD
to current = '.' ; remove extension
erase toend
r (past IsAlpha erase toend) ; remove home directory
})
"Glossary\>" QD GlossChange abort
}
RegionMenu : menu "Region" (
"Select one end" ToggleSelect,
"Copy" BlockCopy,
"Delete" BlockDelete,
"Undelete" BlockPaste,
ColMode "Mode: <%[Region%:Column%]>" ToggleColMode,
; "Write region to file" RegionWrite,
"Go to other end" swapmark,
"Re-select" ReSelect,
"_",
"Fence Region" MatchSelect,
"Append & Copy" AppendCopy,
"Append & Delete" AppendDelete,
"Indent 1 tab" RegionIndent,
"Outdent 1 tab" RegionOutdent,
"EnTab (Space->Tab)" RegionEntab,
"DeTab (Tab->Space)" RegionDetab,
"Wrap Region" RegionFill,
"alpha Sort" SortMenu)
ScreenMenu :
do {
menu "Screen" {
(tct 10 = 32) "Paragraph Marks\>%[ON%:OFF%]"
((tct 10 = 32) ? 17 : 32)->tct 10,
(tct 9 = 32) "Tabs\>%[ON%:OFF%]"
((tct 9 = 32) ? 16 : 32)->tct 9,
(tct 32 = 32) "Spaces\>%[ON%:OFF%]"
((tct 32 = 32) ? 250 : 32)->tct 32->tct 31,
; (tct 28 = 32) "Non-Breaking Spaces\>%[ON%:OFF%]"
; ((tct 28 = 32) ? 30 : 32)->tct 28,
raw "Codes\>%[OFF%:ON%]"
++raw if !raw readruler, ; in case user changed
"_",
!statline "Bottom Status Line\>%[ON%:OFF%]"
(statline ? (0->statline) : (1->statline)),
"Colors" SetColors
}
}
;may need to set rightmargin here
EditorSetMenu :
; do { ; if I wanted to cycle
menu "Editor Settings" (
WordWrap "Wrap mode\>%[Off%;Normal%;TeX%]"
(WordWrap+1)%3->WordWrap->flag4 abort,
ALineLength "Line length\>%d"
ALineLength get "Line length"->ALineLength,
AutoIndent "Auto-Indent\>%[Off%:On%]"
!AutoIndent->AutoIndent,
overwrite "Overwrite mode \>%[Ins%:Ovr%]" ToggleIns,
tabsize "Tab interval\>%d" tabsize get "Tab spacing"->tabsize,
swapdelay "Swap Delay\>%d" 300 get->swapdelay,
menudelay "Menu Pop Up Delay\>%d" 30 get->menudelay,
"_",
(tct 10 = 32) "Paragraph Marks\>%[On%:Off%]"
((tct 10 = 32) ? 17 : 32)->tct 10,
(tct 9 = 32) "Tabs\>%[On%:Off%]"
((tct 9 = 32) ? 16 : 32)->tct 9,
(tct 32 = 32) "Spaces\>%[On%:Off%]"
((tct 32 = 32) ? 250 : 32)->tct 32->tct 31,
raw "Codes\>%[Off%:On%]"
++raw if !raw readruler, ; in case user changed
!statline "Bottom Status Line\>%[On%:Off%]"
(statline ? (0->statline) : (1->statline)),
"_",
"Colors" SetColors)
; }
WindowsMenu : menu "Windows" (
"Next window" WindowFwd,
"Previous window" WindowBack,
"Split window" WindowOpen,
"Close window" WindowClose,
"All Close" WindowCloseAll,
"Grow window" WindowResize,
zoom "%[Z%:Unz%]oom" WindowZoom,
"_",
"Y-Previous PageUp" ScrollPrevUp,
"V-Previous PageDown" ScrollPrevDown,
"Up, Scroll All" WindowUp, ; confusing terms again
"Down, Scroll All" WindowDown,
"_",
"Left Scroll" ScrollLeft,
"Right Scroll" ScrollRight)
JumpMenu : menu "Jumps" (
"Line Go to" LineJump,
"Go to The Mark" swapmark,
; Mnum "_Current BookMark: %d",
"_",
(Mnum+1)%10 "Auto BookMark: %d" MarkerMark, ; shows current mark
(NextMnum+1)%10 "Next Marker: %d" MarkerFwd, ; next mark in jump ring
(NextMnum)%10 "Previous Marker: %d" MarkerBack,
"Jump to # Mark" MarkerJump,
; "Mark by #" MarkerSet
"_",
"Top of file" FileStart,
"Bottom of file" FileEnd
)
LocateMenu :
menu "Search & Replace" (
"Search" Find,
"Locate Next" LocateNext,
; "Back Locate" LocateBack,
"Incremental Locate" LocateInc,
"Auto Locate" LocateAuto,
"_",
"Query Replace" QueryReplace,
"Block Replace" ReplaceRegion,
; "Fast Replace" ReplaceAll,
SearchDirection "_Dir: %[Rev%: FWD%]",
"Forward" 1->SearchDirection abort,
"Reverse" 0->SearchDirection abort
)
ShortCutsMenu : menu "Shortcuts" {
"X- Set Mark" ToggleSelect,
"G- Go to other end" swapmark,
"C- Copy region" BlockCopy,
"D- Delete region" BlockDelete,
"U- Undelete" BlockPaste,
"_",
"W- Next Sentence" SentenceFwd,
"B- Previous Sentence" SentenceBack,
"N- Next paragraph" ParagraphFwd,
"P- Previous paragraph" ParagraphBack,
"Y- Scroll up" ScrollBack,
"V- Scroll down" ScrollFwd,
"E- End of file" FileEnd,
"S- Start of file" FileStart,
"F- File Fwd" FileFwd,
"R- File Rev" FileBack,
"_",
"T- Transpose words" WordTranspose,
"K- Delete to eol" delete toeol
}
MiscMenu : menu "Miscellaneous" (
"Wrap paragraph" Reformat, ; or reformat, ParagraphFill
"Global Wrap" FileFill,
"Display refresh" ScreenCenter,
"Help" HelpMenu,
; "Alpha Sort" SortMenu,
"ASCII Table" ASCIITable,
"User Interface" UIMenu,
"System command" SystemCommand,
"Piped Sys. command" PipedCommand,
"Filter current file " FIlterCommand)
EditMenu : menu "Edit Menu" (
"Files" FilesMenu,
"Region" RegionMenu,
"Windows" WindowsMenu,
"Jumps" JumpMenu,
"Search & Replace" LocateMenu,
"Glossary" GlossMenu,
"X-Macros & Prog" MacroMenu,
"Print" PrintMenu,
"Miscellaneous" MiscMenu,
"Correct spelling" CorrectMenu,
"Editor settings" EditorSetMenu,
"_",
"Text Formatting" FormatMenu,
"Quit" ExitEditor)