home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / PREVIEW.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  3KB  |  70 lines

  1. //---------------------------------------------------------------------------
  2. // Borland C++Builder
  3. // Copyright (c) 1987, 1997 Borland International Inc.  All Rights Reserved.
  4. //---------------------------------------------------------------------------
  5. //---------------------------------------------------------------------------
  6. #include <vcl\vcl.h>
  7. #pragma hdrstop
  8.  
  9. #include "preview.h"
  10. #include "mainprnt.h"
  11. //---------------------------------------------------------------------------
  12. #pragma link "sampreg"
  13. #pragma resource "*.dfm"
  14. TPrevForm *PrevForm;
  15. //---------------------------------------------------------------------------
  16. __fastcall TPrevForm::TPrevForm(TComponent* Owner)
  17.         : TForm(Owner)
  18. {
  19. }
  20. //---------------------------------------------------------------------------
  21. void __fastcall TPrevForm::ZoomFitBtnClick(TObject *Sender)
  22. {
  23.   QRPreview1->ZoomToFit();
  24.    SpinZoom->Value=QRPreview1->Zoom;
  25. }
  26. //---------------------------------------------------------------------------
  27. void __fastcall TPrevForm::SpinPageChange(TObject *Sender)
  28. {
  29.   QRPreview1->PageNumber=SpinPage->Value;
  30. }
  31. //---------------------------------------------------------------------------
  32. void __fastcall TPrevForm::SpinZoomChange(TObject *Sender)
  33. {
  34.    QRPreview1->Zoom=SpinZoom->Value;
  35. }
  36. //---------------------------------------------------------------------------
  37. void __fastcall TPrevForm::FormShow(TObject *Sender)
  38. {
  39.    SpinPage->MaxValue=QRPrinter->PageCount;
  40.    SpinPage->MinValue=1;
  41.    SpinPage->Value=1;
  42.    QRPreview1->Zoom=100;
  43. }
  44. //---------------------------------------------------------------------------
  45. void __fastcall TPrevForm::ZoomWidthBtnClick(TObject *Sender)
  46. {
  47.   QRPreview1->ZoomToWidth();
  48.    SpinZoom->Value=QRPreview1->Zoom;
  49. }
  50. //---------------------------------------------------------------------------
  51. void __fastcall TPrevForm::SpeedButton1Click(TObject *Sender)
  52. {
  53.   MainPrintForm->TheReport->Print();
  54. }
  55. //---------------------------------------------------------------------------
  56. void __fastcall TPrevForm::SpeedButton2Click(TObject *Sender)
  57. {
  58.   Close();        
  59. }
  60. //---------------------------------------------------------------------------
  61. void __fastcall TPrevForm::ExitBtnClick(TObject *Sender)
  62. {
  63.   Close();        
  64. }
  65. //---------------------------------------------------------------------------
  66. void __fastcall TPrevForm::PrintBtnClick(TObject *Sender)
  67. {
  68.   MainPrintForm->TheReport->Print();        
  69. }
  70. //---------------------------------------------------------------------------