home *** CD-ROM | disk | FTP | other *** search
- unit Fdemo03;
-
- interface
-
- uses
- SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, DBCtrls, DBTables, DB, Mask, Grids, DBGrids,
- ExtCtrls, Buttons, TabNotBk, PrnWin, CB_Types, DBPrnWin, CB_MFunc;
-
- type
- TForm03 = class(TForm)
- TabbedNotebook1: TTabbedNotebook;
- View: TBitBtn;
- Panel1: TPanel;
- DBGrid1: TDBGrid;
- DBEdit1: TDBEdit;
- DBImage1: TDBImage;
- DataSource1: TDataSource;
- Table1: TTable;
- Table1SpeciesNo: TFloatField;
- Table1Category: TStringField;
- Table1Common_Name: TStringField;
- Table1SpeciesName: TStringField;
- Table1Lengthcm: TFloatField;
- Table1Length_In: TFloatField;
- Table1Notes: TMemoField;
- Table1Graphic: TGraphicField;
- DBMemo1: TDBMemo;
- Exit: TBitBtn;
- Memo1: TMemo;
- Shape1: TShape;
- Image1: TImage;
- Both: TBitBtn;
- BothBorders: TBitBtn;
- Memo2: TMemo;
- DBPrintWin1: TDBPrintWin;
- procedure ViewClick(Sender: TObject);
- procedure ExitClick(Sender: TObject);
- procedure BothClick(Sender: TObject);
- procedure BothBordersClick(Sender: TObject);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form03: TForm03;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm03.ViewClick(Sender: TObject);
- begin
- DBPrintWin1.BeginPrint;
- DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
- DBPrintWin1.EndPrint;
- end;
-
- procedure TForm03.ExitClick(Sender: TObject);
- begin
- Close;
- end;
-
- procedure TForm03.BothClick(Sender: TObject);
- var
- Saved: string;
- begin
- Saved := TabbedNotebook1.ActivePage;
- DBPrintWin1.Orientation := Portrait;
- DBPrintWin1.BeginPrint;
- TabbedNotebook1.ActivePage := 'Page 1';
- DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
- TabbedNotebook1.ActivePage := 'Page 2';
- DBPrintWin1.DrawWindow(5,poCenter,TabbedNotebook1);
- DBPrintWin1.EndPrint;
- TabbedNotebook1.ActivePage := Saved;
- end;
-
- procedure TForm03.BothBordersClick(Sender: TObject);
- var
- Saved: string;
- begin
- DBPrintWin1.FrameObjects := True;
- Saved := TabbedNotebook1.ActivePage;
- DBPrintWin1.BeginPrint;
-
- { Make visible, print and make invisible }
- Memo2.Visible := True;
- DBPrintWin1.DrawWindow(1,poCenter,Memo2);
- Memo2.Visible := False;
-
- { Select Page to print }
- TabbedNotebook1.ActivePage := 'Page 1';
- DBPrintWin1.DrawWindow(2,poCenter,TabbedNotebook1);
-
- { Select new Page to print }
- TabbedNotebook1.ActivePage := 'Page 2';
- DBPrintWin1.DrawWindow(2+DBPrintWin1.GetControlHeight(TabbedNotebook1),poCenter,TabbedNotebook1);
- DBPrintWin1.EndPrint;
-
- { Select Page that was active previously }
- TabbedNotebook1.ActivePage := Saved;
- DBPrintWin1.FrameObjects := False;
- end;
-
- end.
-