home *** CD-ROM | disk | FTP | other *** search
/ PC Expert 29 / Pce29cd.iso / RUNIMAGE / DELPHI40 / DEMOS / EXPERTS / STRINGS.RES / SNIPETS.bin next >
Text File  |  1998-06-16  |  6KB  |  295 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, Windows, 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.SimpleText := 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.   PixelsPerInch = 96
  133.   TextHeight = 13
  134. |  Menu = MainMenu
  135. |  FormStyle = fsMDIForm
  136. |  ShowHint = True
  137. |  OnCreate = FormCreate
  138. |  object MainMenu: TMainMenu
  139.     Left = 220
  140.     Top = 40
  141. |    object FileMenu: TMenuItem
  142.       Caption = '&File'
  143.       object FileNewItem: TMenuItem
  144.         Caption = '&New'
  145.         Hint = 'Create a new file'
  146.         OnClick = FileNew
  147.       end
  148.       object FileOpenItem: TMenuItem
  149.         Caption = '&Open...'
  150.         Hint = 'Open an existing file'
  151.         OnClick = FileOpen
  152.       end
  153.       object FileSaveItem: TMenuItem
  154.         Caption = '&Save'
  155.         Hint = 'Save current file'
  156.         OnClick = FileSave
  157.       end
  158.       object FileSaveAsItem: TMenuItem
  159.         Caption = 'Save &As...'
  160.         Hint = 'Save current file under a new name'
  161.         OnClick = FileSaveAs
  162.       end
  163.       object N1: TMenuItem
  164.         Caption = '-'
  165.       end
  166.       object FilePrintItem: TMenuItem
  167.         Caption = '&Print'
  168.         Hint = 'Print current file'
  169.         OnClick = FilePrint
  170.       end
  171.       object FilePrintSetupItem: TMenuItem
  172.         Caption = 'P&rint Setup...'
  173.         Hint = 'Change printer setup'
  174.         OnClick = FilePrintSetup
  175.       end
  176.       object N4: TMenuItem
  177.         Caption = '-'
  178.       end
  179.       object FileExitItem: TMenuItem
  180.         Caption = 'E&xit'
  181.         Hint = 'Exit this application'
  182.         OnClick = FileExit
  183.       end
  184.     end
  185. |    object EditMenu: TMenuItem
  186.       Caption = '&Edit'
  187.       object EditUndoItem: TMenuItem
  188.         Caption = '&Undo'
  189.         Hint = 'Undo the last action'
  190.         OnClick = EditUndo
  191.       end
  192.       object N2: TMenuItem
  193.         Caption = '-'
  194.       end
  195.       object EditCutItem: TMenuItem
  196.         Caption = 'Cu&t'
  197.         Hint = 'Delete selected item'
  198.         OnClick = EditCut
  199.       end
  200.       object EditCopyItem: TMenuItem
  201.         Caption = '&Copy'
  202.         Hint = 'Copy selected item to clipboard'
  203.         OnClick = EditCopy
  204.       end
  205.       object EditPasteItem: TMenuItem
  206.         Caption = '&Paste'
  207.         Hint = 'Paste contents of clipboard'
  208.         OnClick = EditPaste
  209.       end
  210.     end
  211. |    object WindowMenu: TMenuItem
  212.       Caption = '&Window'
  213.       object WindowTileItem: TMenuItem
  214.         Caption = '&Tile'
  215.         Hint = 'Tile all windows'
  216.         OnClick = WindowTile
  217.       end
  218.       object WindowCascadeItem: TMenuItem
  219.         Caption = '&Cascade'
  220.         Hint = 'Cascade all windows'
  221.         OnClick = WindowCascade
  222.       end
  223.       object WindowArrangeItem: TMenuItem
  224.         Caption = '&Arrange All'
  225.         Hint = 'Arrange minimized windows'
  226.         OnClick = WindowArrange
  227.       end
  228.     end
  229. |    object HelpMenu: TMenuItem
  230.       Caption = '&Help'
  231.       object HelpContentsItem: TMenuItem
  232.         Caption = '&Contents'
  233.         Hint = 'Display the help contents screen'
  234.         OnClick = HelpContents
  235.       end
  236.       object HelpSearchItem: TMenuItem
  237.         Caption = '&Search for Help On...'
  238.         Hint = 'Search help file for a topic'
  239.         OnClick = HelpSearch
  240.       end
  241.       object HelpHowToUseItem: TMenuItem
  242.         Caption = '&How to Use Help'
  243.         Hint = 'Help on using the help system'
  244.         OnClick = HelpHowToUse
  245.       end
  246.       object N3: TMenuItem
  247.         Caption = '-'
  248.       end
  249.       object HelpAboutItem: TMenuItem
  250.         Caption = '&About...'
  251.         Hint = 'Show program information'
  252.         OnClick = HelpAbout
  253.       end
  254.     end
  255. |  object OpenDialog: TOpenDialog
  256.     Filter = '%s'
  257.     Left = 230
  258.     Top = 87
  259.   end
  260. |  object SaveDialog: TSaveDialog
  261.     Filter = '%s'
  262.     Left = 204
  263.     Top = 125
  264.   end
  265. |  object PrintDialog: TPrintDialog
  266.     Left = 262
  267.     Top = 127
  268.   end
  269. |  object PrintSetupDialog: TPrinterSetupDialog
  270.     Left = 276
  271.     Top = 93
  272.   end
  273. |  object StatusLine: TStatusBar
  274.     Align = alBottom
  275.     Height = 23
  276.     Font.Color = clBlack
  277.     Font.Height = -11
  278.     Font.Name = 'MS Sans Serif'
  279.     ParentFont = False
  280.     SimplePanel = True
  281.   end
  282. |  object SpeedBar: TPanel
  283.     Align = alTop
  284.     Height = 33
  285. |    object SpeedButton%d: TSpeedButton
  286.       Left = %d
  287.       Top = 4
  288.       Width = 25
  289.       Height = 25
  290.       OnClick = %s
  291.       Hint = '%s'   
  292.       NumGlyphs = 2
  293.       Glyph.Data = {
  294. |
  295.