home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / CODEGEN.TXT < prev    next >
Text File  |  1997-01-16  |  8KB  |  321 lines

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