home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 April / Chip_1997-04_cd.bin / prezent / cb / data.z / EXPERTS.DLL / 0 / RCDATA / SNIPETS next >
Text File  |  1997-01-16  |  8KB  |  320 lines

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