home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / tot5.zip / DEMMN9.PAS < prev    next >
Pascal/Delphi Source File  |  1991-02-11  |  9KB  |  152 lines

  1. program DemoMenuNine;
  2. {DEMMN9 - using a EZPull object with sub menus and hotkeys}
  3. USES  DOS, CRT,
  4.       totMENU, totFAST;
  5.  
  6. var
  7.   Env,Watch: MenuOBJ;
  8.   Menu: EZPullArrayOBJ;
  9.   Choice: word;
  10.  
  11. procedure CreateSubMenus;
  12. {}
  13. begin
  14.    with Env do 
  15.    begin
  16.       Init;
  17.       SetForPull;
  18.       AddFullItem(' ~P~references... ',8061,80,'Specify desktop settings',nil);
  19.       AddFullItem(' ~E~ditor...      ',8062,69,'Specify editor settings',nil);
  20.       AddFullItem(' ~M~ouse...       ',8063,77,'Specify mouse settings',nil);
  21.       AddFullItem(' ~S~tartup...     ',8064,83,'Permanently change default startup options',nil);
  22.       AddFullItem(' ~C~olors...      ',8065,67,'Customize IDE colors for windows, menus, etc.',nil);
  23.    end;
  24.    with Watch do
  25.    begin
  26.       Init;
  27.       SetForPull;
  28.       AddFullItem(' ~A~dd watch...       ',7021,65,'Insert a watch expression into the Watch window',nil);
  29.       AddFullItem(' ~D~elete watch       ',7022,68,'Remove the current watch expression from the Watch window',nil);
  30.       AddFullItem(' ~E~dit watch...      ',7023,69,'Edit the current watch expression in the Watch window',nil);
  31.       AddFullItem(' ~R~emove all watches ',7024,82,'Delete all watch expressions from the Watch window',nil);
  32.    end;
  33. end; {CreateSubMenus}
  34.  
  35. procedure CreateMenu;
  36. {}
  37. var
  38.   Mtxt: Array[1..84] of string[100];
  39. begin
  40.    MTxt[1] := '\ ≡ "System Commands';
  41.    MTxt[2] := ' ~A~bout...        "Show version and copyright information"100';
  42.    MTxt[3] := ' ~R~efresh display "Redraw the screen"101';
  43.    MTxt[4] := ' ~C~lear desktop   "Close all windows on the desktop, clear history lists"102';
  44.    MTxt[5] := '\ ~F~ile "File management commands (Open, New, Save, etc.)';
  45.    MTxt[6] := ' ~O~pen...   F3  "Locate and open a file in an edit window"201"317';
  46.    MTxt[7] := ' ~N~ew           "Create a new file in a new Edit window"202';
  47.    MTxt[8] := ' ~S~ave      F2  "Save the file in the active Edit window"203"316';
  48.    MTxt[9] := ' S~a~ve as...    "Save the current file under a different name"204';
  49.    MTxt[10] := ' Save a~l~l      "Save all modified files"205';
  50.    MTxt[11] := '-';
  51.    MTxt[12] := ' ~C~hange dir... "Choose a new default directory"206';
  52.    MTxt[13] := ' ~P~rint         "Print the contents of the active Edit window"207';
  53.    MTxt[14] := ' ~G~et info...   "Show status information"208';
  54.    MTxt[15] := ' ~D~OS shell     "Temporarily exit to DOS"209';
  55.    MTxt[16] := ' E~x~it          "Exit Turbo Pascal"9999';
  56.    MTxt[17] := '\ ~E~dit "Cut-and-paste editing commands"';
  57.    MTxt[18] := '_ ~R~estore line     "Cancel edits to the current line in active Edit window"301';
  58.    MTxt[19] := '-';
  59.    MTxt[20] := '_ Cu~t~    Shift-Del "Remove the selected text and put it in the Clipboard"302';
  60.    MTxt[21] := '_ ~C~opy    Ctrl-Ins "Copy the selected text into the Clipboard"303"9999';
  61.    MTxt[22] := '_ ~P~aste  Shift-Ins "Insert selected text from the Clipboard"304"291';
  62.    MTxt[23] := '_ Copy e~x~ample     "Copy example from the Help window into the ClipBoard"305';
  63.    MTxt[24] := ' ~S~how clipboard   "Open the Clipboard window"306';
  64.    MTxt[25] := '-';
  65.    MTxt[26] := '_ C~l~ear   Ctrl-Del "Delete the selected text"307"262';
  66.    MTxt[27] := '\ ~S~earch "Text and error search commands';
  67.    MTxt[28] := ' ~F~ind...             "Search for text"401';
  68.    MTxt[29] := ' ~R~eplace...          "Search for text and replace it with new text"402';
  69.    MTxt[30] := ' ~S~earch again        "Repeat the last Find or Replace command"403';
  70.    MTxt[31] := ' ~G~oto line number... "Move the cursor to a specified line number"404';
  71.    MTxt[32] := ' ~F~ind procedure...   "Search for a procedure or function while debugging"405';
  72.    MTxt[33] := ' Find e~r~ror...       "Move the cursor to the position of a runtime error"406';
  73.    MTxt[34] := '\ ~R~un "Execute or single-step through a program';
  74.    MTxt[35] := ' ~R~un            Ctrl-F9 "Run the current program"501"358';
  75.    MTxt[36] := '_ ~P~rogram reset  Ctrl-F2 "Halt debugging session and release memory"502"351';
  76.    MTxt[37] := ' ~G~o to cursor        F4 "Run program from the run bar to the cursor position"503"318';
  77.    MTxt[38] := ' ~T~race into          F7 "Execute next statement, stopping within the current proc"504"321';
  78.    MTxt[39] := ' ~S~tep over           F8 "Execute next statement, skipping over the current proc"505"322';
  79.    MTxt[40] := ' P~a~rameters...          "Set command line parameters to be passed to the program"506';
  80.    MTxt[41] := '\ ~C~ompile "Compile to disk or memory';
  81.    MTxt[42] := ' ~C~ompile  Alt-F9 "Compile source file"601"368';
  82.    MTxt[43] := ' ~M~ake         F9 "Rebuild source file and all modified files"602"323';
  83.    MTxt[44] := ' ~B~uild           "Rebuild source file and all files"603';
  84.    MTxt[45] := ' ~D~estination     "Specify whether file is compiled to memory or disk"604';
  85.    MTxt[46] := ' ~P~rimary file... "Define the file that is the focus of make and Build"605';
  86.    MTxt[47] := '\ ~D~ebug "Evaluate expressions, modify data, set breakpoints and watches';
  87.    MTxt[48] := ' ~E~valute/modify...  Ctrl-F4 "Evaluate a variable or expression and display or modify the value"701"353';
  88.    MTxt[49] := ' ~W~atches                   "Add, delete and edit expressions in the watch window"702';
  89.    MTxt[50] := ' ~T~oggle breakpoint  Ctrl-F8 "Set or clear an unconditional breakpoint at the cursor position"703"357';
  90.    MTxt[51] := ' ~B~reakpoints...    "Set conditional breakpoints, view and edit breakpoints"704';
  91.    MTxt[52] := '\ ~O~ptions "Set defaults for compiler, editor, mouse, debugger, etc.';
  92.    MTxt[53] := ' ~C~ompiler            "Set default compiler directives and condl. defines"801';
  93.    MTxt[54] := ' ~M~emory sizes...     "Set default stack and heap sizes for generated programs"802';
  94.    MTxt[55] := ' ~L~inker...           "Set linker options"803';
  95.    MTxt[56] := ' De~b~ugger...         "Set debugger options"804';
  96.    MTxt[57] := ' ~D~irectories...      "Set paths for units, include files, OBJs anfd generated files"805';
  97.    MTxt[58] := '-';
  98.    MTxt[59] := ' ~E~nvironment        "Specify environment settings"806';
  99.    MTxt[60] := '-';
  100.    MTxt[61] := ' ~S~ave options...     "Save all the settings you''ve made in the Options menu"807';
  101.    MTxt[62] := ' ~R~etrieve options... "Load options file previously created with Save Options"808';
  102.    MTxt[63] := '\ ~W~indow "Open, arrange, and list windows';
  103.    MTxt[64] := ' ~S~ize/Move   Ctrl-F5 "Change the size or position of the active window"901"354';  
  104.    MTxt[65] := ' ~Z~oom             F5 "Enlarge or restore the size of the active window"902"319';
  105.    MTxt[66] := ' ~T~ile                "Arrange windows on desktop by tiling"903';
  106.    MTxt[67] := ' C~a~scade             "Arrange windows on desktop by cascading"904';
  107.    MTxt[68] := ' ~N~ext             F6 "Make the next window active"905"320';
  108.    MTxt[69] := ' ~P~revious   Shift-F6 "Make the previous window active"906"345';
  109.    MTxt[70] := ' ~C~lose        Alt-F3 "Close the active window"907"362';
  110.    MTxt[71] := '-';
  111.    MTxt[72] := ' ~W~atch               "Open the watch window"908';
  112.    MTxt[73] := ' ~R~egister            "Open the Register window"909';
  113.    MTxt[74] := ' ~O~utput              "Open the Output window"910';
  114.    MTxt[75] := ' Call stac~k~  Ctrl-F3 "Show the procedures the program called to reach this point"911"352';
  115.    MTxt[76] := ' ~U~ser screen  Alt-F5 "Switch to the full-screen user output"912"364';
  116.    MTxt[77] := '-';
  117.    MTxt[78] := ' ~L~ist...       Alt-0 "Show a list of all open windows"913"385';
  118.    MTxt[79] := '\ ~H~elp "Get online help';
  119.    MTxt[80] := ' ~C~ontents               "Show table of contents of online Help"1001';
  120.    MTxt[81] := ' ~I~ndex         Shift-F1 "Show index for online Help"1002"340';
  121.    MTxt[82] := ' ~T~opic Search   Ctrl-F1 "Display help on the word at the cursor"1003"350';
  122.    MTxt[83] := ' ~P~revious Topic  Alt-F1 "Redisplay the last-viewed online Help screen"1004"360';
  123.    MTxt[84] := ' ~H~elp on Help           "How to use online Help"1005';
  124.    with Menu do
  125.    begin
  126.       Init;
  127.       AssignList(MTxt,84,100);
  128.    end;
  129. end; {CreateMenu}
  130.  
  131. begin
  132.    Screen.PartClear(1,2,80,24,white,'░'); {paint the screen}
  133.    Screen.PartClear(1,1,80,1,31,' ');
  134.    Screen.PartClear(1,25,80,25,31,' ');
  135.    Screen.WritePlain(9,25,'│');
  136.    CreateMenu;
  137.    CreateSubMenus;
  138.    with Menu do
  139.    begin
  140.       SubMenu(7)^.SetSubMenu(2,@Watch);
  141.       SubMenu(8)^.SetSubMenu(7,@Env);
  142.       Choice := Push(289,0,0);   {Pass Alt-F to make menu pull down on File}
  143.       Done;
  144.       Env.Done;
  145.       Watch.Done;
  146.    end;
  147.    GotoXY(25,15);
  148.    if Choice = 0 then
  149.       Writeln('You escaped')
  150.    else
  151.       Writeln('You selected menu item ',Choice);
  152. end.