home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / sprint / texmac.zip / MENUS.SPM < prev    next >
Text File  |  1991-11-24  |  12KB  |  440 lines

  1. ; Scribe compatible Sprint Alternative User Interface v. 1.01
  2. ; Copyright (c) 1988 Borland International.  All Rights Reserved.
  3. ; NAME: Menu.UIM
  4. ; VERSION: 1.
  5. ; DESCRIPTION: Menus and Keystroke macros used by the user
  6. ;    interface, merged from SP & FWII
  7. ; LAST UPDATE: September 9, 1988. RDT: 1/6/91
  8.  
  9. ; -----------------------------------------------------------------
  10. ; Deletions
  11. ; -----------------------------------------------------------------
  12. ; Variables
  13. ; -----------------------------------------------------------------
  14. ; Forward Declarations
  15. ; -----------------------------------------------------------------
  16. ; Automatically-Called Macro Definitions
  17. ; -----------------------------------------------------------------
  18. ; General Macros
  19. ; -----------------------------------------------------------------
  20. ; Menus
  21.  
  22. PrintMenu : WPPrintMenu
  23.  
  24. FormatMenu : ScribeFormatMenu
  25.  
  26. AltPrintMenu : TeXDVIMenu
  27.  
  28. AltFormatMenu : TexFormatMenu
  29.  
  30. UIMenu :
  31.     menu "User Interface" {
  32.     "Function Keys"        KeyReMap,
  33.     "Reset Shortcuts"    MacroClear,
  34.     "_",
  35.     "Load"            UIOpen,
  36.     "Save"            UIWriteAs
  37.     }
  38.  
  39. ToneMenu :
  40.     do    {
  41.         infobox "Tone" {
  42.         soundfreq "Pitch\>%d Hz  ",
  43.         sounddur "Length\>%d msec",
  44.         "_",
  45.         "UP\>Higher Pitch",
  46.         "DOWN\>Lower Pitch",
  47.         "LEFT\>Shorter Length",
  48.         "RIGHT  \>Longer Length"
  49.             }
  50.         MenuKey case {
  51.         '^[', abortkey    abort,
  52.         148h    soundfreq + 20->soundfreq        ; up
  53.             if (soundfreq > 2000) (2000->soundfreq),
  54.         14bh    sounddur - 10 ->sounddur        ; left
  55.             if (sounddur < 10) (10->sounddur),
  56.         14dh    sounddur + 10 ->sounddur        ; right
  57.             if (sounddur > 400) (400->sounddur),
  58.         150h    soundfreq - 20->soundfreq        ; down
  59.             if (soundfreq < 20) (20->soundfreq)
  60.             }
  61.         if !keypressed (1 Bell) SetOvlModf
  62.         }
  63.  
  64. CustOptMenu :
  65.     do    {
  66.         menu "Options" {
  67.         EraseSwap   "Preserve Editing Session\>%[YES%:NO%]"
  68.             !EraseSwap->EraseSwap,
  69.         ((swapdelay>>1)&7FFFH)/500 "Background Save Period\>%[   OFF%:%2u Sec%]"
  70.             3 rangeget 60 "Background save period (in seconds)" -> swapdelay
  71.             swapdelay * 1000 -> swapdelay,
  72.         (menudelay/100) "Menu Display Delay\>%[NO DELAY%:%4u%]"
  73.             menudelay/100 rangeget 100
  74.             "Delay before menu display (in tenths of seconds)"
  75.             * 100 -> menudelay,
  76.         (BIGDOS ==16)   "DOS Shell Size\>%[SMALL%:LARGE%]"
  77.             if (BIGDOS == 16) (0->BIGDOS) else (16->BIGDOS)
  78.             SetOvlModf,
  79.         "_",
  80.         overwrite "Insert Mode\>%[INSERT%:OVERWRITE%]" ToggleIns,
  81.         "Tone"        ToneMenu
  82.             }
  83.         SetOvlModf
  84.         }
  85.  
  86. ; ---------- Help Menu Functions ----------
  87. HelpTemplate :
  88. ;    draw
  89. ;    infobox(
  90. ;    "","","","","","","   Legend:","","",
  91. ;    "   Unshifted (edit)",
  92. ;    " ^ Ctrl      (file)",
  93. ;    " + SHIFT     (window)",
  94. ;    " ~ Alt ",
  95. ;    "","","","","","","") (
  96. ;        infobox "Sprint Template" (
  97. ;        "F1      Help       │ Glossary Recall F2",
  98. ;        "^    Correct Bad   │    Save File\>^",
  99. ;        "+    SPELL MENU    │  WINDOW RESIZE\>+",
  100. ;        "~     Thesaurus    │",
  101. ;        "_┼",
  102. ;        "F3  Toggle Select  │      Copy       F4",
  103. ;        "^     Open File    │   Close File\>^",
  104. ;        "+    OPEN WINDOW   │  CLOSE WINDOW\>+",
  105. ;        "_┼",
  106. ;        "F5      Move       │      Paste      F6",
  107. ;        "^     File Back    │    File Fwd\>^",
  108. ;        "+       ZOOM       │   NEXT WINDOW\>+",
  109. ;        "_┼",
  110. ;        "F7   Search Fwd    │      Replace    F8",
  111. ;        "^     Paginate     │      Preview\>^",
  112. ;        "+   SCROLL ALL UP  │  SCROLL ALL DOWN\>+",
  113. ;        "_┼",
  114. ;        "F9   Go to Line    │    Main Menu   F10",
  115. ;        "^     Pick File    │",
  116. ;        "+     CLOSE ALL    │"
  117. ;        )
  118. ;         (0 wait) KeyGet redraw abort)
  119.  
  120. HelpKeyFunction :
  121.     HelpDisk
  122.     int ktmp
  123.     0-> int quit
  124.     do {
  125.         message "\nPress the key you want help on ("
  126.         -abortkey + 27 status "%[Esc%:%27-~+c%] twice to quit): "
  127.         KeyGet -> ktmp = abortkey? (1->quit) : (0->quit)
  128.         draw
  129.         ktmp keyhelp 2 help Q0
  130.         } while(!quit)
  131.  
  132. ; Context Coercion for help
  133. LastHelp :
  134.  
  135. HelpMenu :
  136.     HelpDisk
  137.     menu "Help" {
  138.         "Function Keys" HelpTemplate,
  139.         "Index" 2 help "",
  140.         "Last Help" LastHelp 1 help,
  141.         "Keyboard Help" HelpKeyFunction
  142.         }
  143.  
  144. ThesMenu :
  145.     int t
  146.     if ((0 subchar engine) != 't') {
  147.         status "\nLoading thesaurus..."
  148.         set Q0 "thesaur.eng" NeedDisk
  149.         set engine "thesaur AMERICAN.THS"
  150.         }
  151.     mark {
  152.         if !istoken (r to istoken)
  153.         r past istoken
  154.         copy past istoken QD ; 'original' word
  155.         copy past istoken Q0 ; 'previous' word
  156.         set Q4 Q0            ; initial prev word is same as Q0
  157.         do {
  158.             (128+256+1 runengine past istoken) -> t
  159.             if (t=0) break
  160.             if (t&128) {
  161.                 delete past istoken
  162.                 insert QD
  163.                 r past istoken
  164.                 }
  165.             if (t&256) {
  166.                 delete past istoken
  167.                 insert Q0
  168.                 r past istoken
  169.                 }
  170.             set Q0 Q4
  171.             copy past istoken Q4 ; 'previous' word
  172.             }
  173.         if !t {
  174.             draw message "\nNot in thesaurus."
  175.             }
  176.         }
  177.  
  178. CorrectMenu : menu "Spelling" {
  179.     "Rest of File"        CorrectRest,
  180.     "Paragraph"        CorrectPara,
  181.     "Word"            CorrectWord,
  182.     "Block"            CorrectRegion,
  183.     "_",
  184.     "Last Bad Word"    CorrectLastBad,
  185.     "Every Bad Word"    CorrectAllBad,
  186.     "_",
  187.     AutoCorrect "AutoSpell\>%[OFF%:ON%]"
  188.         if !AutoCorrect (
  189.             0->BadWordPending
  190.             set QE ""
  191.             if !stopped LoadSpeller
  192.             1->AutoCorrect
  193.             )
  194.         else (0->AutoCorrect)
  195.         abort,
  196.     (0 GetDictionary) "Main Dictionary\>" Q0 0 SetDictionary abort,
  197.     (1 GetDictionary) "User Dictionary\>" Q0 1 SetDictionary abort,    
  198.     "_",
  199.     "Thesaurus" ThesMenu
  200.     }
  201.  
  202. DiskDirectory :
  203.     menu "File Manager" {
  204.     "Copy"            FileCopy,
  205.     "Rename-Move"        FileRename,
  206.     "Delete"        FileDelete,
  207.     "_",    ; cd,
  208.     "Set  Directory"        SetCurrentDir,
  209.     "Quick Directory"    set Q0 "" message "\nDir name: " set Q0 call "command /c cdx" Q0,
  210.     "Goto Directory"    DirectoryNew abort,
  211.     "List Directory"    call "command /c Dirmagic"
  212.         }
  213.  
  214. FilesMenu : menu "Files" (
  215.     "Open"        FileOpen,
  216.     "Next"        FileFwd,
  217.     "Previous"    FileBack,
  218.     "Close"        FileClose,
  219.     "Revert to saved" RevertToSaved,
  220.     "Save"        FileSave,
  221.     "Write as ..."    FileWrite,
  222.     "Insert file"    FileInsert,
  223.     "Block write"    RegionWrite,
  224.     "List open files" FilePick,
  225. ;    "Goto directory" DirectoryGoTo,
  226.     "_" cd,
  227.     "Manage Files" DiskDirectory)
  228.  
  229. MacroMenu : menu "Macros" (
  230.     "Enter"            MacroExecute,
  231.     "Assign to key"        KeyAssignMacro,
  232.     "Load from disk"    MacroLoad,
  233.     "Compile current"    MacroRunFile,
  234.     "Misc. Macros"        PickCommandMenu,
  235.     "Key Binding"        KeyReport,
  236.     "Binding report"    KeyReportAll,
  237. ;    "_Key Record",
  238. ;    "Begin"            MacroCollBegin KeyRecordMsg,
  239. ;    "Halt"            MacroCollHalt,
  240. ;    "Do"            MacroCollDo,
  241. ;    "Iterate"        MacroCollRepeat,
  242. ;    "Get  (from disk)"    MacroCollLoad,
  243. ;    "Save (to disk)"    MacroCollSave,
  244.     "_",
  245. ;    "Run DOS Command"    SystemCommand,
  246.     "Value of current char."    CharValue
  247.     )
  248.  
  249. ; interesting history here. early on, gloss was only for text
  250. ; blocks. it was then expanded for key recordings, hence some confusion
  251.  
  252. GlossMenu :
  253.         menu "Glossary" {
  254.         "Recall"            GlossLookup4,
  255.         "Assign to Key"            KeyAssignGloss,
  256.         "_",
  257.         "Define Region"            GlossDefine1,
  258.         "Keyboard Record"        KeyRecordGloss,
  259.         "Erase"                GlossDelete,
  260.         "_",
  261.         "Merge"                GlossMerge,
  262.         "List"                GlossList,
  263.         (set QD QA mark { 
  264.             to QD
  265.             to current = '.'        ; remove extension
  266.             erase toend
  267.             r (past IsAlpha erase toend)    ; remove home directory
  268.             })
  269.         "Glossary\>" QD        GlossChange abort
  270.         }
  271.  
  272. RegionMenu : menu "Region" (
  273.     "Select one end" ToggleSelect,
  274.     "Copy"            BlockCopy,
  275.     "Delete"        BlockDelete,
  276.     "Undelete"        BlockPaste,
  277.     ColMode "Mode: <%[Region%:Column%]>" ToggleColMode,
  278. ;    "Write region to file"    RegionWrite,
  279.     "Go to other end"    swapmark,
  280.     "Re-select"        ReSelect,
  281.     "_",
  282.     "Fence Region"        MatchSelect,
  283.     "Append & Copy"        AppendCopy,
  284.     "Append & Delete"    AppendDelete,
  285.     "Indent 1 tab"        RegionIndent,
  286.     "Outdent 1 tab"        RegionOutdent,
  287.     "EnTab  (Space->Tab)"    RegionEntab,
  288.     "DeTab  (Tab->Space)"    RegionDetab,
  289.     "Wrap Region"        RegionFill,
  290.     "alpha Sort"        SortMenu)
  291.  
  292. ScreenMenu :
  293.     do {
  294.         menu "Screen" {
  295.         (tct 10 = 32) "Paragraph Marks\>%[ON%:OFF%]"
  296.             ((tct 10 = 32) ? 17 : 32)->tct 10,
  297.         (tct 9 = 32) "Tabs\>%[ON%:OFF%]"
  298.             ((tct 9 = 32) ? 16 : 32)->tct 9,
  299.         (tct 32 = 32) "Spaces\>%[ON%:OFF%]"
  300.             ((tct 32 = 32) ? 250 : 32)->tct 32->tct 31,
  301. ;        (tct 28 = 32) "Non-Breaking Spaces\>%[ON%:OFF%]"
  302. ;            ((tct 28 = 32) ? 30 : 32)->tct 28,
  303.         raw "Codes\>%[OFF%:ON%]"
  304.             ++raw if !raw readruler,    ; in case user changed
  305.         "_",
  306.         !statline "Bottom Status Line\>%[ON%:OFF%]"
  307.             (statline ? (0->statline) : (1->statline)),
  308.         "Colors"    SetColors
  309.             }
  310.         }
  311.  
  312. ;may need to set rightmargin here
  313. EditorSetMenu : 
  314. ;    do { ; if I wanted to cycle
  315.     menu "Editor Settings" (
  316.     WordWrap "Wrap mode\>%[Off%;Normal%;TeX%]"
  317.             (WordWrap+1)%3->WordWrap->flag4 abort,
  318.     ALineLength "Line length\>%d"
  319.            ALineLength get "Line length"->ALineLength,
  320.     AutoIndent  "Auto-Indent\>%[Off%:On%]"
  321.             !AutoIndent->AutoIndent,
  322.     overwrite "Overwrite mode  \>%[Ins%:Ovr%]" ToggleIns,
  323.     tabsize "Tab interval\>%d" tabsize get "Tab spacing"->tabsize,
  324.     swapdelay "Swap Delay\>%d" 300 get->swapdelay,
  325.     menudelay "Menu Pop Up Delay\>%d" 30 get->menudelay,
  326.     "_",
  327.         (tct 10 = 32) "Paragraph Marks\>%[On%:Off%]"
  328.             ((tct 10 = 32) ? 17 : 32)->tct 10,
  329.         (tct 9 = 32) "Tabs\>%[On%:Off%]"
  330.             ((tct 9 = 32) ? 16 : 32)->tct 9,
  331.         (tct 32 = 32) "Spaces\>%[On%:Off%]"
  332.             ((tct 32 = 32) ? 250 : 32)->tct 32->tct 31,
  333.         raw "Codes\>%[Off%:On%]"
  334.             ++raw if !raw readruler,    ; in case user changed
  335.         !statline "Bottom Status Line\>%[On%:Off%]"
  336.             (statline ? (0->statline) : (1->statline)),
  337.         "_",
  338.         "Colors"    SetColors)
  339. ;    }
  340.  
  341. WindowsMenu : menu "Windows" (
  342.     "Next window" WindowFwd,
  343.     "Previous window" WindowBack,
  344.     "Split window" WindowOpen,
  345.     "Close window" WindowClose,
  346.      "All Close"          WindowCloseAll,
  347.     "Grow window" WindowResize,
  348.     zoom "%[Z%:Unz%]oom"        WindowZoom,
  349.      "_",
  350.     "Y-Previous PageUp" ScrollPrevUp,
  351.     "V-Previous PageDown" ScrollPrevDown,
  352.      "Up, Scroll All"      WindowUp,    ; confusing terms again
  353.      "Down, Scroll All"     WindowDown,
  354.      "_",
  355.      "Left Scroll"       ScrollLeft,
  356.      "Right Scroll"      ScrollRight)
  357.  
  358. JumpMenu : menu "Jumps" (
  359.     "Line Go to"        LineJump,
  360.     "Go to The Mark"    swapmark,
  361. ;        Mnum "_Current BookMark: %d",
  362.         "_",
  363.     (Mnum+1)%10      "Auto BookMark:   %d" MarkerMark,       ; shows current mark
  364.     (NextMnum+1)%10  "Next Marker:     %d" MarkerFwd,        ; next mark in jump ring
  365.     (NextMnum)%10    "Previous Marker: %d" MarkerBack,
  366.     "Jump to # Mark"    MarkerJump,
  367. ;    "Mark by #"        MarkerSet
  368.     "_",
  369.     "Top of file"        FileStart,
  370.     "Bottom of file"    FileEnd
  371.     )
  372.  
  373. LocateMenu :
  374.        menu "Search & Replace" (
  375.     "Search"    Find,
  376.     "Locate Next"    LocateNext,
  377. ;    "Back Locate"    LocateBack,
  378.     "Incremental Locate"    LocateInc,
  379.     "Auto Locate"    LocateAuto,
  380.     "_",
  381.     "Query Replace"    QueryReplace,
  382.     "Block Replace" ReplaceRegion,
  383. ;    "Fast Replace"   ReplaceAll,
  384.     SearchDirection "_Dir: %[Rev%: FWD%]",
  385.     "Forward"    1->SearchDirection abort,
  386.     "Reverse"    0->SearchDirection abort
  387.         )
  388.  
  389. ShortCutsMenu : menu "Shortcuts" {
  390.     "X- Set Mark"        ToggleSelect,
  391.     "G- Go to other end"    swapmark,
  392.     "C- Copy region"    BlockCopy,
  393.     "D- Delete region"    BlockDelete,
  394.     "U- Undelete"        BlockPaste,
  395.     "_",
  396.     "W- Next Sentence"    SentenceFwd,
  397.     "B- Previous Sentence"    SentenceBack,
  398.     "N- Next paragraph"    ParagraphFwd,
  399.     "P- Previous paragraph" ParagraphBack,
  400.     "Y- Scroll up"        ScrollBack,
  401.     "V- Scroll down"    ScrollFwd,
  402.     "E- End of file"    FileEnd,
  403.     "S- Start of file"    FileStart,
  404.     "F- File Fwd"        FileFwd,
  405.     "R- File Rev"        FileBack,
  406.     "_",
  407.     "T- Transpose words"    WordTranspose,
  408.     "K- Delete to eol"    delete toeol
  409.     }
  410.  
  411. MiscMenu : menu "Miscellaneous" (
  412.     "Wrap paragraph" Reformat,    ; or reformat, ParagraphFill
  413.     "Global Wrap"    FileFill,
  414.     "Display refresh" ScreenCenter,
  415.     "Help"        HelpMenu,
  416. ;    "Alpha Sort"    SortMenu,
  417.     "ASCII Table"    ASCIITable,
  418.     "User Interface"    UIMenu,
  419.     "System command" SystemCommand,
  420.     "Piped Sys. command" PipedCommand,
  421.     "Filter current file "     FIlterCommand)
  422.  
  423. EditMenu : menu "Edit Menu" (
  424.     "Files"            FilesMenu,
  425.     "Region"        RegionMenu,
  426.     "Windows"        WindowsMenu,
  427.     "Jumps"            JumpMenu,
  428.     "Search & Replace"        LocateMenu,
  429.     "Glossary"        GlossMenu,
  430.     "X-Macros & Prog"    MacroMenu,
  431.     "Print"            PrintMenu,
  432.     "Miscellaneous"        MiscMenu,
  433.     "Correct spelling"    CorrectMenu,
  434.     "Editor settings"    EditorSetMenu,
  435.     "_",
  436.     "Text Formatting"    FormatMenu,
  437.     "Quit"            ExitEditor)
  438.  
  439.