home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 February / Chip_2004-02_cd1.bin / program / delphi / navody / d56 / ec1vr2.exe / #setuppath# / CB6 / MultiLevelHeader / Main.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2003-12-09  |  2.4 KB  |  66 lines

  1. //---------------------------------------------------------------------------
  2. #include <vcl\vcl.h>
  3. #pragma hdrstop
  4.  
  5. #include "Main.h"
  6. #include "About.h"
  7. #include "Report.h"
  8. #include "FileCtrl.hpp"
  9. //---------------------------------------------------------------------------
  10. #pragma resource "*.dfm"
  11. TMainForm *MainForm;
  12. //---------------------------------------------------------------------------
  13. __fastcall TMainForm::TMainForm(TComponent* Owner)
  14.     : TForm(Owner)
  15. {
  16.   DebtsTable->Active = true;
  17.   TotalQuery->Active = true;
  18. }
  19. //---------------------------------------------------------------------------
  20. void __fastcall TMainForm::DebtsTableCalcFields(TDataSet *DataSet)
  21. {
  22.   DebtsTableYear->AsCurrency = DebtsTableFirstQuarter->AsCurrency +
  23.                   DebtsTableSecondQuarter->AsCurrency +
  24.                   DebtsTableThirdQuarter->AsCurrency +
  25.                   DebtsTableFourthQuarter->AsCurrency +
  26.                   DebtsTableYear->AsCurrency;
  27. }
  28. //---------------------------------------------------------------------------
  29. void __fastcall TMainForm::TotalQueryCalcFields(TDataSet *DataSet)
  30. {
  31.   TotalQueryYear->AsCurrency = TotalQueryFirst->AsCurrency +
  32.                   TotalQuerySecond->AsCurrency +
  33.                   TotalQueryThird->AsCurrency +
  34.                   TotalQueryFourth->AsCurrency;
  35. }
  36. //---------------------------------------------------------------------------
  37. void __fastcall TMainForm::ExitActionExecute(TObject *Sender)
  38. {
  39.   Close();
  40. }
  41. //---------------------------------------------------------------------------
  42. void __fastcall TMainForm::AboutActionExecute(TObject *Sender)
  43. {
  44.   AboutBox->ShowModal ();
  45. }
  46. //---------------------------------------------------------------------------
  47. void __fastcall TMainForm::PrintSetupActionExecute(TObject *Sender)
  48. {
  49.   RepForm->VividReport->PrinterSetup ();
  50. }
  51. //---------------------------------------------------------------------------
  52. void __fastcall TMainForm::PrintActionExecute(TObject *Sender)
  53. {
  54.   if (RepForm->VividReport->PrintSetup ())
  55.   {
  56.     RepForm->VividReport->Print ();
  57.   }
  58. }
  59. //---------------------------------------------------------------------------
  60. void __fastcall TMainForm::PrintPreviewActionExecute(TObject *Sender)
  61. {
  62.   RepForm->VividReport->PrintPreview (RepForm->VRPreview);
  63. }
  64. //---------------------------------------------------------------------------
  65.  
  66.