home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / borland / cb / setup / cbuilder / data.z / DEMOPRE.CPP < prev    next >
C/C++ Source or Header  |  1997-02-28  |  3KB  |  75 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 "DemoPre.h"
  10. //---------------------------------------------------------------------------
  11. #pragma resource "*.dfm"
  12. TPrevForm *PrevForm;
  13. //---------------------------------------------------------------------------
  14. __fastcall TPrevForm::TPrevForm(TComponent* Owner)
  15.   : TForm(Owner)
  16. {
  17. }
  18. //---------------------------------------------------------------------------
  19. void __fastcall TPrevForm::FormShow(TObject *Sender)
  20. {
  21.    UpDown1->Max=(short)QRPrinter->PageCount;
  22.    UpDown1->Min=1;
  23.    UpDown1->Position=1;
  24.    QRPreview1->Zoom=100;
  25. }
  26. //---------------------------------------------------------------------
  27. void __fastcall TPrevForm::Button1Click(TObject *Sender)
  28. {
  29.   QRPreview1->ZoomToFit();
  30.   UpDown2->Position=(short)QRPreview1->Zoom;
  31. }
  32. //---------------------------------------------------------------------
  33. void __fastcall TPrevForm::Button2Click(TObject *Sender)
  34. {
  35.   QRPreview1->ZoomToWidth();
  36.   UpDown2->Position=(short)QRPreview1->Zoom;
  37. }
  38. //---------------------------------------------------------------------
  39. void __fastcall TPrevForm::UpDown1Click(TObject *Sender, TUDBtnType Button)
  40. {
  41.     char buf[3];
  42.  
  43.     Edit1->Text=itoa(UpDown1->Position, buf, 10);
  44.     QRPreview1->PageNumber=UpDown1->Position;
  45. }
  46. //---------------------------------------------------------------------------
  47. void __fastcall TPrevForm::UpDown2Click(TObject *Sender, TUDBtnType Button)
  48. {
  49.     char buf[3];
  50.  
  51.     Edit2->Text=itoa(UpDown2->Position, buf, 10);
  52.     QRPreview1->Zoom=UpDown2->Position;
  53. }
  54. //---------------------------------------------------------------------------
  55. void __fastcall TPrevForm::Edit1KeyUp(TObject *Sender, WORD &Key,
  56.     TShiftState Shift)
  57. {
  58.     if (atoi(Edit1->Text.c_str()))
  59.     {
  60.         UpDown1->Position=(short)atoi(Edit1->Text.c_str());
  61.         QRPreview1->PageNumber=UpDown1->Position;
  62.     }
  63. }
  64. //---------------------------------------------------------------------------
  65. void __fastcall TPrevForm::Edit2KeyUp(TObject *Sender, WORD &Key,
  66.     TShiftState Shift)
  67. {
  68.     if (atoi(Edit2->Text.c_str()))
  69.     {
  70.         UpDown2->Position=(short)atoi(Edit2->Text.c_str());
  71.         QRPreview1->Zoom=UpDown2->Position;
  72.     }
  73. }
  74. //---------------------------------------------------------------------------
  75.