home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "Main.h"
- #include "About.h"
- #include "Report.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TMainForm *MainForm;
- //---------------------------------------------------------------------------
- __fastcall TMainForm::TMainForm(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::FileOpen(TObject *Sender)
- {
- if (OpenDialog->Execute())
- {
- Caption = "Print Text Example - " + OpenDialog->FileName;
- RichEdit1->Lines->LoadFromFile (OpenDialog->FileName);
-
- RepForm->VividReport->ReportTitle = OpenDialog->FileName;
- ((TAbsRichText *)RepForm->VRLabel3->Data)->RichText->LoadFromFile (OpenDialog->FileName);
- SpeedButton2->Enabled = (((TAbsRichText *)RepForm->VRLabel3->Data)->TextLength != 0);
- SpeedButton6->Enabled = SpeedButton2->Enabled;
- }
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::FilePrint(TObject *Sender)
- {
- if (RepForm->VividReport->PrintSetup ())
- {
- RepForm->VividReport->Print ();
- }
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::FilePrintSetup(TObject *Sender)
- {
- RepForm->VividReport->PrinterSetup ();
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::FileExit(TObject *Sender)
- {
- Close();
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::HelpAbout(TObject *Sender)
- {
- AboutBox->ShowModal ();
- }
- //----------------------------------------------------------------------------
- void __fastcall TMainForm::PreviewClick(TObject *Sender)
- {
- RepForm->VividReport->PrintPreview (RepForm->VRPreview);
- }
- //---------------------------------------------------------------------------
-