home *** CD-ROM | disk | FTP | other *** search
/ Delphi Anthology / aDELPHI.iso / Runimage / Delphi50 / Bin / exptdemo.dll / RCDATA / SNIPETS < prev    next >
Text File  |  1999-08-11  |  6KB  |  296 lines

  1. program %s;
  2.  
  3. uses
  4.   Forms,
  5.   Main in 'MAIN.PAS' {MainForm};
  6.  
  7. {$R *.RES}
  8.  
  9. begin
  10.   Application.Initialize;
  11.   Application.CreateForm(TMainForm, MainForm);
  12.   Application.Run;
  13. end.
  14. |unit Main;
  15.  
  16. interface
  17.  
  18. uses
  19.   SysUtils, Windows, Messages, Classes, Graphics, Controls,
  20.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls, Menus;
  21.  
  22. type
  23.   TMainForm = class(TForm)
  24. |  end;
  25.  
  26. var
  27.   MainForm: TMainForm;
  28.  
  29. implementation
  30.  
  31. {$R *.DFM}
  32.  
  33. |begin
  34.   Application.OnHint := ShowHint;
  35. end;
  36.  
  37. |begin
  38.   StatusLine.SimpleText := Application.Hint;
  39. end;
  40.  
  41. |begin
  42.   { Add code to create a new file }
  43. end;
  44.  
  45. |begin
  46.   if OpenDialog.Execute then
  47.   begin
  48.     { Add code to open OpenDialog.FileName }
  49.   end;
  50. end;
  51.  
  52. |begin
  53.    { Add code to save current file under current name }
  54. end;
  55.  
  56. |begin
  57.   if SaveDialog.Execute then
  58.   begin
  59.     { Add code to save current file under SaveDialog.FileName }
  60.   end;
  61. end;
  62.  
  63. |begin
  64.   if PrintDialog.Execute then
  65.   begin
  66.     { Add code to print current file }
  67.   end;
  68. end;
  69.  
  70. |begin
  71.   PrintSetupDialog.Execute;
  72. end;
  73.  
  74. |begin
  75.   Close;
  76. end;
  77.  
  78. |begin
  79.   { Add code to perform Edit Undo }
  80. end;
  81.  
  82. |begin
  83.   { Add code to perform Edit Cut }
  84. end;
  85.  
  86. |begin
  87.   { Add code to perform Edit Copy }
  88. end;
  89.  
  90. |begin
  91.   { Add code to perform Edit Paste }
  92. end;
  93.  
  94. |begin
  95.   Tile;
  96. end;
  97.  
  98. |begin
  99.   Cascade;
  100. end;
  101.  
  102. |begin
  103.   ArrangeIcons;
  104. end;
  105.  
  106. |begin
  107.   Application.HelpCommand(HELP_CONTENTS, 0);
  108. end;
  109.  
  110. |const
  111.   EmptyString: PChar = '';
  112. begin
  113.   Application.HelpCommand(HELP_PARTIALKEY, Longint(EmptyString));
  114. end;
  115.  
  116. |begin
  117.   Application.HelpCommand(HELP_HELPONHELP, 0);
  118. end;
  119.  
  120. |begin
  121.   { Add code to show program's About Box }
  122. end;
  123.  
  124. |object MainForm: TMainForm
  125.   Left = 214
  126.   Top = 112
  127.   Width = 409
  128.   Height = 249
  129.   Caption = 'MainForm'
  130.   Font.Color = clWindowText
  131.   Font.Height = -11
  132.   Font.Name = 'MS Sans Serif'
  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: TStatusBar
  275.     Align = alBottom
  276.     Height = 23
  277.     Font.Color = clBlack
  278.     Font.Height = -11
  279.     Font.Name = 'MS Sans Serif'
  280.     ParentFont = False
  281.     SimplePanel = True
  282.   end
  283. |  object SpeedBar: TPanel
  284.     Align = alTop
  285.     Height = 33
  286. |    object SpeedButton%d: TSpeedButton
  287.       Left = %d
  288.       Top = 4
  289.       Width = 25
  290.       Height = 25
  291.       OnClick = %s
  292.       Hint = '%s'   
  293.       NumGlyphs = 2
  294.       Glyph.Data = {
  295. |
  296.