home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
delphi
/
cbsuite.lzh
/
SU1SRC.ZIP
/
FDEMO02.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-11-23
|
4KB
|
140 lines
unit Fdemo02;
interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, PrnWin, DBCtrls, Grids,
DBGrids, DB, DBTables, ExtCtrls, CB_Types, DBPrnWin, CB_MFunc;
type
TForm02 = class(TForm)
VPanel1: TBitBtn;
ScrollBox1: TScrollBox;
Exit: TBitBtn;
Panel1: TPanel;
Panel3: TPanel;
Panel2: TPanel;
VPanel2: TBitBtn;
VPanel3: TBitBtn;
VAll: TBitBtn;
Memo1: TMemo;
Edit1: TEdit;
Label1: TLabel;
RadioGroup1: TRadioGroup;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Panel4: TPanel;
Memo2: TMemo;
Image1: TImage;
Shape1: TShape;
Label2: TLabel;
Button1: TButton;
DataSource1: TDataSource;
Table1: TTable;
DBGrid1: TDBGrid;
Label3: TLabel;
Panel5: TPanel;
DBImage1: TDBImage;
AllSame: TBitBtn;
Table1NAME: TStringField;
Table1SIZE: TSmallintField;
Table1WEIGHT: TSmallintField;
Table1AREA: TStringField;
Table1BMP: TBlobField;
BitBtn1: TBitBtn;
DBPrintWin1: TDBPrintWin;
procedure VPanel1Click(Sender: TObject);
procedure VPanel2Click(Sender: TObject);
procedure VPanel3Click(Sender: TObject);
procedure VAllClick(Sender: TObject);
procedure AllSameClick(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure ExitClick(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form02: TForm02;
implementation
{$R *.DFM}
procedure TForm02.VPanel1Click(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'Printing of Panel1';
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindow(2,poCenter,Panel1);
DBPrintWin1.EndPrint;
end;
procedure TForm02.VPanel2Click(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'Printing of Panel2';
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindow(2,poCenter,Panel2);
DBPrintWin1.EndPrint;
end;
procedure TForm02.VPanel3Click(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'Printing of Panel3';
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindow(2,poCenter,Panel3);
DBPrintWin1.EndPrint;
end;
procedure TForm02.VAllClick(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'All Panels on separate Pages';
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindow(2,poCenter,Panel1);
DBPrintWin1.NewPage;
DBPrintWin1.DrawWindow(2,poCenter,Panel2);
DBPrintWin1.NewPage;
DBPrintWin1.DrawWindow(2,poCenter,Panel3);
DBPrintWin1.EndPrint;
end;
procedure TForm02.AllSameClick(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'All Panels on same Page - Portrait';
DBPrintWin1.Orientation := Portrait;
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindow(1,poCenter,Panel1);
DBPrintWin1.DrawWindow(4,poCenter,Panel2);
DBPrintWin1.DrawWindow(6.5,poCenter,Panel3);
DBPrintWin1.EndPrint;
end;
procedure TForm02.BitBtn1Click(Sender: TObject);
begin
DBPrintWin1.HeaderStringCenter := 'All Panels on same Page - Landscape';
DBPrintWin1.Orientation := Landscape;
DBPrintWin1.BeginPrint;
DBPrintWin1.DrawWindowAt(1,1,Panel1);
DBPrintWin1.DrawWindowAt(5.5,1,Panel2);
DBPrintWin1.DrawWindow(4.5,poCenter,Panel3);
DBPrintWin1.EndPrint;
end;
procedure TForm02.ExitClick(Sender: TObject);
begin
Close;
end;
procedure TForm02.Button1Click(Sender: TObject);
begin
MessageBeep(MB_ICONEXCLAMATION);
MessageDlg('This is to show that buttons can be included', mtInformation,
[mbOk], 0);
end;
end.