home *** CD-ROM | disk | FTP | other *** search
/ PC Format Collection 48 / SENT14D.ISO / tech / delphi / disk15 / experts.pak / CODEGEN.TXT < prev    next >
Encoding:
Text File  |  1995-08-24  |  6.1 KB  |  298 lines

  1. program %s;
  2.  
  3. uses
  4.   Forms,
  5.   Main in 'MAIN.PAS' {MainForm};
  6.  
  7. {$R *.RES}
  8.  
  9. begin
  10.   Application.CreateForm(TMainForm, MainForm);
  11.   Application.Run;
  12. end.
  13. |unit Main;
  14.  
  15. interface
  16.  
  17. uses
  18.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  19.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Menus;
  20.  
  21. type
  22.   TMainForm = class(TForm)
  23. |  end;
  24.  
  25. var
  26.   MainForm: TMainForm;
  27.  
  28. implementation
  29.  
  30. {$R *.DFM}
  31.  
  32. |begin
  33.   Application.OnHint := ShowHint;
  34. end;
  35.  
  36. |begin
  37.   StatusLine.Caption := Application.Hint;
  38. end;
  39.  
  40. |begin
  41.   { Add code to create a new file }
  42. end;
  43.  
  44. |begin
  45.   if OpenDialog.Execute then
  46.   begin
  47.     { Add code to open OpenDialog.FileName }
  48.   end;
  49. end;
  50.  
  51. |begin
  52.    { Add code to save current file under current name }
  53. end;
  54.  
  55. |begin
  56.   if SaveDialog.Execute then
  57.   begin
  58.     { Add code to save current file under SaveDialog.FileName }
  59.   end;
  60. end;
  61.  
  62. |begin
  63.   if PrintDialog.Execute then
  64.   begin
  65.     { Add code to print current file }
  66.   end;
  67. end;
  68.  
  69. |begin
  70.   PrintSetupDialog.Execute;
  71. end;
  72.  
  73. |begin
  74.   Close;
  75. end;
  76.  
  77. |begin
  78.   { Add code to perform Edit Undo }
  79. end;
  80.  
  81. |begin
  82.   { Add code to perform Edit Cut }
  83. end;
  84.  
  85. |begin
  86.   { Add code to perform Edit Copy }
  87. end;
  88.  
  89. |begin
  90.   { Add code to perform Edit Paste }
  91. end;
  92.  
  93. |begin
  94.   Tile;
  95. end;
  96.  
  97. |begin
  98.   Cascade;
  99. end;
  100.  
  101. |begin
  102.   ArrangeIcons;
  103. end;
  104.  
  105. |begin
  106.   Application.HelpCommand(HELP_CONTENTS, 0);
  107. end;
  108.  
  109. |const
  110.   EmptyString: PChar = '';
  111. begin
  112.   Application.HelpCommand(HELP_PARTIALKEY, Longint(EmptyString));
  113. end;
  114.  
  115. |begin
  116.   Application.HelpCommand(HELP_HELPONHELP, 0);
  117. end;
  118.  
  119. |begin
  120.   { Add code to show program's About Box }
  121. end;
  122.  
  123. |object MainForm: TMainForm
  124.   Left = 214
  125.   Top = 112
  126.   Width = 409
  127.   Height = 249
  128.   Caption = 'MainForm'
  129.   Font.Color = clWindowText
  130.   Font.Height = -11
  131.   Font.Name = 'MS Sans Serif'
  132.   Font.Style = [fsBold]
  133.   PixelsPerInch = 96
  134.   TextHeight = 13
  135. |  Menu = MainMenu
  136. |  FormStyle = fsMDIForm
  137. |  ShowHint = True
  138. |  OnCreate = FormCreate
  139. |  object MainMenu: TMainMenu
  140.     Left = 220
  141.     Top = 40
  142. |    object FileMenu: TMenuItem
  143.       Caption = '&File'
  144.       object FileNewItem: TMenuItem
  145.         Caption = '&New'
  146.         Hint = 'Create a new file'
  147.         OnClick = FileNew
  148.       end
  149.       object FileOpenItem: TMenuItem
  150.         Caption = '&Open...'
  151.         Hint = 'Open an existing file'
  152.         OnClick = FileOpen
  153.       end
  154.       object FileSaveItem: TMenuItem
  155.         Caption = '&Save'
  156.         Hint = 'Save current file'
  157.         OnClick = FileSave
  158.       end
  159.       object FileSaveAsItem: TMenuItem
  160.         Caption = 'Save &As...'
  161.         Hint = 'Save current file under a new name'
  162.         OnClick = FileSaveAs
  163.       end
  164.       object N1: TMenuItem
  165.         Caption = '-'
  166.       end
  167.       object FilePrintItem: TMenuItem
  168.         Caption = '&Print'
  169.         Hint = 'Print current file'
  170.         OnClick = FilePrint
  171.       end
  172.       object FilePrintSetupItem: TMenuItem
  173.         Caption = 'P&rint Setup...'
  174.         Hint = 'Change printer setup'
  175.         OnClick = FilePrintSetup
  176.       end
  177.       object N4: TMenuItem
  178.         Caption = '-'
  179.       end
  180.       object FileExitItem: TMenuItem
  181.         Caption = 'E&xit'
  182.         Hint = 'Exit this application'
  183.         OnClick = FileExit
  184.       end
  185.     end
  186. |    object EditMenu: TMenuItem
  187.       Caption = '&Edit'
  188.       object EditUndoItem: TMenuItem
  189.         Caption = '&Undo'
  190.         Hint = 'Undo the last action'
  191.         OnClick = EditUndo
  192.       end
  193.       object N2: TMenuItem
  194.         Caption = '-'
  195.       end
  196.       object EditCutItem: TMenuItem
  197.         Caption = 'Cu&t'
  198.         Hint = 'Delete selected item'
  199.         OnClick = EditCut
  200.       end
  201.       object EditCopyItem: TMenuItem
  202.         Caption = '&Copy'
  203.         Hint = 'Copy selected item to clipboard'
  204.         OnClick = EditCopy
  205.       end
  206.       object EditPasteItem: TMenuItem
  207.         Caption = '&Paste'
  208.         Hint = 'Paste contents of clipboard'
  209.         OnClick = EditPaste
  210.       end
  211.     end
  212. |    object WindowMenu: TMenuItem
  213.       Caption = '&Window'
  214.       object WindowTileItem: TMenuItem
  215.         Caption = '&Tile'
  216.         Hint = 'Tile all windows'
  217.         OnClick = WindowTile
  218.       end
  219.       object WindowCascadeItem: TMenuItem
  220.         Caption = '&Cascade'
  221.         Hint = 'Cascade all windows'
  222.         OnClick = WindowCascade
  223.       end
  224.       object WindowArrangeItem: TMenuItem
  225.         Caption = '&Arrange All'
  226.         Hint = 'Arrange minimized windows'
  227.         OnClick = WindowArrange
  228.       end
  229.     end
  230. |    object HelpMenu: TMenuItem
  231.       Caption = '&Help'
  232.       object HelpContentsItem: TMenuItem
  233.         Caption = '&Contents'
  234.         Hint = 'Display the help contents screen'
  235.         OnClick = HelpContents
  236.       end
  237.       object HelpSearchItem: TMenuItem
  238.         Caption = '&Search for Help On...'
  239.         Hint = 'Search help file for a topic'
  240.         OnClick = HelpSearch
  241.       end
  242.       object HelpHowToUseItem: TMenuItem
  243.         Caption = '&How to Use Help'
  244.         Hint = 'Help on using the help system'
  245.         OnClick = HelpHowToUse
  246.       end
  247.       object N3: TMenuItem
  248.         Caption = '-'
  249.       end
  250.       object HelpAboutItem: TMenuItem
  251.         Caption = '&About...'
  252.         Hint = 'Show program information'
  253.         OnClick = HelpAbout
  254.       end
  255.     end
  256. |  object OpenDialog: TOpenDialog
  257.     Filter = '%s'
  258.     Left = 230
  259.     Top = 87
  260.   end
  261. |  object SaveDialog: TSaveDialog
  262.     Filter = '%s'
  263.     Left = 204
  264.     Top = 125
  265.   end
  266. |  object PrintDialog: TPrintDialog
  267.     Left = 262
  268.     Top = 127
  269.   end
  270. |  object PrintSetupDialog: TPrinterSetupDialog
  271.     Left = 276
  272.     Top = 93
  273.   end
  274. |  object StatusLine: TPanel
  275.     Align = alBottom
  276.     Height = 23
  277.     Alignment = taLeftJustify
  278.     BorderWidth = 2
  279.     Font.Color = clBlack
  280.     Font.Height = -11
  281.     Font.Name = 'MS Sans Serif'
  282.     Font.Style = []
  283.     ParentFont = False
  284.   end
  285. |  object SpeedBar: TPanel
  286.     Align = alTop
  287.     Height = 33
  288. |    object SpeedButton%d: TSpeedButton
  289.       Left = %d
  290.       Top = 4
  291.       Width = 25
  292.       Height = 25
  293.       OnClick = %s
  294.       Hint = '%s'   
  295.       NumGlyphs = 2
  296.       Glyph.Data = {
  297. |
  298.