home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kolekce / d6 / FRCLX.ZIP / SOURCE / FR_Dopt.pas < prev    next >
Pascal/Delphi Source File  |  2001-07-03  |  2KB  |  92 lines

  1.  
  2. {******************************************}
  3. {                                          }
  4. {           FastReport CLX v2.4            }
  5. {             Report options               }
  6. {                                          }
  7. { Copyright (c) 1998-2001 by Tzyganenko A. }
  8. {                                          }
  9. {******************************************}
  10.  
  11. unit FR_Dopt;
  12.  
  13. interface
  14.  
  15. {$I FR.inc}
  16.  
  17. uses
  18.   SysUtils, Types, Classes, QGraphics, QControls, QForms, QDialogs,
  19.   QStdCtrls, FR_Const, QExtCtrls, FR_Ctrls;
  20.  
  21. type
  22.   TfrDocOptForm = class(TForm)
  23.     GroupBox1: TGroupBox;
  24.     CB1: TCheckBox;
  25.     GroupBox2: TGroupBox;
  26.     CB2: TCheckBox;
  27.     Button1: TButton;
  28.     Button2: TButton;
  29.     LB1: TListBox;
  30.     Image1: TImage;
  31.     procedure FormActivate(Sender: TObject);
  32.     procedure FormCreate(Sender: TObject);
  33.     procedure LB1DrawItem(Sender: TObject; Index: Integer; ARect: TRect;
  34.       State: TOwnerDrawState; var Handled: Boolean);
  35.   private
  36.     { Private declarations }
  37.     procedure Localize;
  38.   public
  39.     { Public declarations }
  40.   end;
  41.  
  42.  
  43. implementation
  44.  
  45. {$R *.xfm}
  46.  
  47. uses FR_Prntr, FR_Utils;
  48.  
  49.  
  50. procedure TfrDocOptForm.FormActivate(Sender: TObject);
  51. begin
  52.   LB1.Items.Assign(Prn.Printers);
  53.   LB1.ItemIndex := Prn.PrinterIndex;
  54. end;
  55.  
  56. procedure TfrDocOptForm.Localize;
  57. begin
  58.   Caption := S53370;
  59.   GroupBox1.Caption := S53371;
  60.   CB1.Caption := S53372;
  61.   GroupBox2.Caption := S53373;
  62.   CB2.Caption := S53374;
  63.   Button1.Caption := (SOk);
  64.   Button2.Caption := (SCancel);
  65. end;
  66.  
  67. procedure TfrDocOptForm.FormCreate(Sender: TObject);
  68. begin
  69.   Localize;
  70. end;
  71.  
  72. procedure TfrDocOptForm.LB1DrawItem(Sender: TObject; Index: Integer;
  73.   ARect: TRect; State: TOwnerDrawState; var Handled: Boolean);
  74. var
  75.   r: TRect;
  76. begin
  77.   r := ARect;
  78.   r.Right := r.Left + 18;
  79.   r.Bottom := r.Top + 16;
  80.   OffsetRect(r, 2, 0);
  81.   with LB1.Canvas do
  82.   begin
  83.     FillRect(ARect);
  84.     frDrawTransparent(LB1.Canvas, r.Left, r.Top, Image1.Picture.Bitmap);
  85.     TextOut(ARect.Left + 24, ARect.Top + 1, LB1.Items[Index]);
  86.   end;
  87. end;
  88.  
  89.  
  90. end.
  91.  
  92.