home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / source8 / u_p_size.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-12-22  |  2.1 KB  |  93 lines

  1. {Part of Imagelib VCL/DLL Library.
  2.  
  3. Written by Jan Dekkers and Kevin Adams}
  4.  
  5. unit U_p_size;
  6.  
  7. interface
  8.  
  9. uses WinTypes, WinProcs, Classes, Graphics, Forms, Controls, Buttons,
  10.   StdCtrls, ExtCtrls, Spin;
  11.  
  12. type
  13.   TPrintersize = class(TForm)
  14.     OKBtn: TBitBtn;
  15.     Bevel1: TBevel;
  16.     WidthSpinEdit: TSpinEdit;
  17.     HeigthSpinEdit: TSpinEdit;
  18.     Label1: TLabel;
  19.     Label2: TLabel;
  20.     Label3: TLabel;
  21.     GroupBox1: TGroupBox;
  22.     RadioButton1: TRadioButton;
  23.     RadioButton2: TRadioButton;
  24.     RadioButton3: TRadioButton;
  25.     RadioButton4: TRadioButton;
  26.     RadioButton5: TRadioButton;
  27.     RadioButton6: TRadioButton;
  28.     procedure FormActivate(Sender: TObject);
  29.     procedure RadioButton1Click(Sender: TObject);
  30.     procedure RadioButton2Click(Sender: TObject);
  31.     procedure RadioButton3Click(Sender: TObject);
  32.     procedure RadioButton4Click(Sender: TObject);
  33.     procedure RadioButton5Click(Sender: TObject);
  34.     procedure RadioButton6Click(Sender: TObject);
  35.   private
  36.     { Private declarations }
  37.     bwt, bht : integer;
  38.   public
  39.     { Public declarations }
  40.   end;
  41.  
  42. var
  43.   Printersize: TPrintersize;
  44.  
  45. implementation
  46.  
  47. {$R *.DFM}
  48.  
  49. procedure TPrintersize.FormActivate(Sender: TObject);
  50. begin
  51.  bwt:= WidthSpinEdit.Value;
  52.  bht:=HeigthSpinEdit.Value;
  53. end;
  54.  
  55.  
  56. procedure TPrintersize.RadioButton1Click(Sender: TObject);
  57. begin
  58.  HeigthSpinEdit.Value:=bht;
  59.  WidthSpinEdit.Value:=bwt;
  60. end;
  61.  
  62. procedure TPrintersize.RadioButton2Click(Sender: TObject);
  63. begin
  64.  HeigthSpinEdit.Value:=bht*2;
  65.  WidthSpinEdit.Value:=bwt*2;
  66. end;
  67.  
  68. procedure TPrintersize.RadioButton3Click(Sender: TObject);
  69. begin
  70.  HeigthSpinEdit.Value:=bht*3;
  71.  WidthSpinEdit.Value:=bwt*3;
  72. end;
  73.  
  74. procedure TPrintersize.RadioButton4Click(Sender: TObject);
  75. begin
  76.  HeigthSpinEdit.Value:=bht*4;
  77.  WidthSpinEdit.Value:=bwt*4;
  78. end;
  79.  
  80. procedure TPrintersize.RadioButton5Click(Sender: TObject);
  81. begin
  82.  HeigthSpinEdit.Value:=bht*5;
  83.  WidthSpinEdit.Value:=bwt*5;
  84. end;
  85.  
  86. procedure TPrintersize.RadioButton6Click(Sender: TObject);
  87. begin
  88.  HeigthSpinEdit.Value:=bht*6;
  89.  WidthSpinEdit.Value:=bwt*6;
  90. end;
  91.  
  92. end.
  93.