home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / delphi / cbsuite.lzh / SU1SRC.ZIP / FDEMO02.PAS < prev    next >
Pascal/Delphi Source File  |  1995-11-23  |  4KB  |  140 lines

  1. unit Fdemo02;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, PrnWin, DBCtrls, Grids,
  8.   DBGrids, DB, DBTables, ExtCtrls, CB_Types, DBPrnWin, CB_MFunc;
  9.  
  10. type
  11.   TForm02 = class(TForm)
  12.     VPanel1: TBitBtn;
  13.     ScrollBox1: TScrollBox;
  14.     Exit: TBitBtn;
  15.     Panel1: TPanel;
  16.     Panel3: TPanel;
  17.     Panel2: TPanel;
  18.     VPanel2: TBitBtn;
  19.     VPanel3: TBitBtn;
  20.     VAll: TBitBtn;
  21.     Memo1: TMemo;
  22.     Edit1: TEdit;
  23.     Label1: TLabel;
  24.     RadioGroup1: TRadioGroup;
  25.     RadioButton1: TRadioButton;
  26.     RadioButton2: TRadioButton;
  27.     Panel4: TPanel;
  28.     Memo2: TMemo;
  29.     Image1: TImage;
  30.     Shape1: TShape;
  31.     Label2: TLabel;
  32.     Button1: TButton;
  33.     DataSource1: TDataSource;
  34.     Table1: TTable;
  35.     DBGrid1: TDBGrid;
  36.     Label3: TLabel;
  37.     Panel5: TPanel;
  38.     DBImage1: TDBImage;
  39.     AllSame: TBitBtn;
  40.     Table1NAME: TStringField;
  41.     Table1SIZE: TSmallintField;
  42.     Table1WEIGHT: TSmallintField;
  43.     Table1AREA: TStringField;
  44.     Table1BMP: TBlobField;
  45.     BitBtn1: TBitBtn;
  46.     DBPrintWin1: TDBPrintWin;
  47.     procedure VPanel1Click(Sender: TObject);
  48.     procedure VPanel2Click(Sender: TObject);
  49.     procedure VPanel3Click(Sender: TObject);
  50.     procedure VAllClick(Sender: TObject);
  51.     procedure AllSameClick(Sender: TObject);
  52.     procedure BitBtn1Click(Sender: TObject);
  53.     procedure ExitClick(Sender: TObject);
  54.     procedure Button1Click(Sender: TObject);
  55.   private
  56.     { Private declarations }
  57.   public
  58.     { Public declarations }
  59.   end;
  60.  
  61. var
  62.   Form02: TForm02;
  63.  
  64. implementation
  65.  
  66. {$R *.DFM}
  67.  
  68. procedure TForm02.VPanel1Click(Sender: TObject);
  69. begin
  70.     DBPrintWin1.HeaderStringCenter := 'Printing of Panel1';
  71.     DBPrintWin1.BeginPrint;
  72.     DBPrintWin1.DrawWindow(2,poCenter,Panel1);
  73.    DBPrintWin1.EndPrint;
  74. end;
  75.  
  76. procedure TForm02.VPanel2Click(Sender: TObject);
  77. begin
  78.     DBPrintWin1.HeaderStringCenter := 'Printing of Panel2';
  79.     DBPrintWin1.BeginPrint;
  80.     DBPrintWin1.DrawWindow(2,poCenter,Panel2);
  81.    DBPrintWin1.EndPrint;
  82. end;
  83.  
  84. procedure TForm02.VPanel3Click(Sender: TObject);
  85. begin
  86.     DBPrintWin1.HeaderStringCenter := 'Printing of Panel3';
  87.     DBPrintWin1.BeginPrint;
  88.     DBPrintWin1.DrawWindow(2,poCenter,Panel3);
  89.    DBPrintWin1.EndPrint;
  90. end;
  91.  
  92. procedure TForm02.VAllClick(Sender: TObject);
  93. begin
  94.     DBPrintWin1.HeaderStringCenter := 'All Panels on separate Pages';
  95.     DBPrintWin1.BeginPrint;
  96.     DBPrintWin1.DrawWindow(2,poCenter,Panel1);
  97.    DBPrintWin1.NewPage;
  98.     DBPrintWin1.DrawWindow(2,poCenter,Panel2);
  99.    DBPrintWin1.NewPage;
  100.     DBPrintWin1.DrawWindow(2,poCenter,Panel3);
  101.    DBPrintWin1.EndPrint;
  102. end;
  103.  
  104. procedure TForm02.AllSameClick(Sender: TObject);
  105. begin
  106.     DBPrintWin1.HeaderStringCenter := 'All Panels on same Page - Portrait';
  107.     DBPrintWin1.Orientation := Portrait;
  108.     DBPrintWin1.BeginPrint;
  109.     DBPrintWin1.DrawWindow(1,poCenter,Panel1);
  110.     DBPrintWin1.DrawWindow(4,poCenter,Panel2);
  111.     DBPrintWin1.DrawWindow(6.5,poCenter,Panel3);
  112.    DBPrintWin1.EndPrint;
  113. end;
  114.  
  115. procedure TForm02.BitBtn1Click(Sender: TObject);
  116. begin
  117.     DBPrintWin1.HeaderStringCenter := 'All Panels on same Page - Landscape';
  118.     DBPrintWin1.Orientation := Landscape;
  119.     DBPrintWin1.BeginPrint;
  120.     DBPrintWin1.DrawWindowAt(1,1,Panel1);
  121.     DBPrintWin1.DrawWindowAt(5.5,1,Panel2);
  122.     DBPrintWin1.DrawWindow(4.5,poCenter,Panel3);
  123.    DBPrintWin1.EndPrint;
  124.  
  125. end;
  126.  
  127. procedure TForm02.ExitClick(Sender: TObject);
  128. begin
  129.     Close;
  130. end;
  131.  
  132. procedure TForm02.Button1Click(Sender: TObject);
  133. begin
  134.     MessageBeep(MB_ICONEXCLAMATION);
  135.     MessageDlg('This is to show that buttons can be included', mtInformation,
  136.       [mbOk], 0);
  137. end;
  138.  
  139. end.
  140.