File: unit_imp.pas

package info (click to toggle)
optgeo 2.25-1
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 6,948 kB
  • sloc: pascal: 58,877; xml: 63; makefile: 58
file content (165 lines) | stat: -rw-r--r-- 4,232 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
unit Unit_imp;

{$mode objfpc}{$H+}

interface

uses
  Classes, SysUtils, LazFileUtils, LResources, Forms, Controls, Graphics, Dialogs,
  StdCtrls, ExtCtrls, Spin, Buttons,UnitScaleFont,Printers,UChaines;

type

  { Tconfigimpression }
  tgraphehorizontal=(tgauche,tdroite,tcentreh);
tgraphevertical=(thaut,tbas,tcentrev);


  Tconfigimpression = class(TForm)
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    CheckBoxrespect: TCheckBox;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    RadioGrouporientation: TRadioGroup;
    RadioGroupevertical: TRadioGroup;
    radiogroupehorizontal: TRadioGroup;
    spinpourcentagevertical: TSpinEdit;
    spinpourcentagehorizontal: TSpinEdit;
    Spinnombrecopies: TSpinEdit;
    procedure BitBtn1Click(Sender: TObject);
    procedure BitBtn2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private  encreation:boolean;
    { private  encreation:boolean; declarations }
  public
    { public declarations }
  end; 

var
  configimpression: Tconfigimpression;
   abandonimpression,respect_imprimante:boolean;
 graphehorizontal:tgraphehorizontal;
  graphevertical:tgraphevertical;
  taillegraphehorizontal,taillegraphevertical,nombrecopies:integer;

implementation
  uses ray1;
{ Tconfigimpression }

procedure Tconfigimpression.BitBtn1Click(Sender: TObject);
begin
  abandonimpression:=false;
if radiogroupehorizontal.itemindex=1 then graphehorizontal:=tgauche;
if  radiogroupehorizontal.itemindex=0 then graphehorizontal:=tdroite;
if  radiogroupehorizontal.itemindex=2 then graphehorizontal:=tcentreh;
if radiogroupevertical.itemindex=0 then graphevertical:=thaut;
if radiogroupevertical.itemindex=1 then graphevertical:=tbas;
if radiogroupevertical.itemindex=2 then graphevertical:=tcentrev;
taillegraphehorizontal:=spinpourcentagehorizontal.value;
taillegraphevertical:=spinpourcentagevertical.value;
nombrecopies:=spinnombrecopies.value;
if radiogrouporientation.ItemIndex=0 then
orientation_impression:=poportrait else
orientation_impression:=polandscape;
respect_imprimante:=checkboxrespect.Checked;
end;

procedure Tconfigimpression.BitBtn2Click(Sender: TObject);
begin

end;

procedure Tconfigimpression.FormCreate(Sender: TObject);
begin
   encreation:=true;

CHECKBOXRESPECT.CAPTION
:=rsRespecterLes;


GROUPBOX1.CAPTION
:=rsPosition;


GROUPBOX2.CAPTION
:=rsNombreDeCopi;


GROUPBOX3.CAPTION
:=rsTailleEnDeLa;


GROUPBOX4.CAPTION
:=rsRapportHaute;


LABEL1.CAPTION
:=rsNombre;


LABEL2.CAPTION
:=rsHorizontalem;


LABEL3.CAPTION
:=rsVerticalemen;




RADIOGROUPORIENTATION.CAPTION
:=rsOrientation;


  configimpression.Caption :=rsConfiguratio;
  GroupBox1.Caption := rsPosition;
   radiogroupehorizontal.Caption := rsHorizontale;

  // radiogroupehorizontal.Items.clear;
   radiogroupehorizontal.Items[0]:=rsDroite;
     radiogroupehorizontal.Items[1]:=rsGauche;
     radiogroupehorizontal.Items[2]:=rsCentr;

    RadioGroupevertical.Caption := rsVerticale;
    //RadioGroupevertical.Items.clear;
    RadioGroupevertical.Items[0]:=rsHaut;
     RadioGroupevertical.Items[1]:=rsBas;
     RadioGroupevertical.Items[2]:=rsCentr;

     GroupBox2.Caption := rsNombreDeCopi;
     Label1.Caption := rsNombre;
     GroupBox3.Caption := rsTailleEnDeLa;
     Label2.Caption := rsHorizontalem;
     Label3.Caption := rsVerticalemen;
     RadioGrouporientation.Caption := rsOrientation;
     //RadioGrouporientation.Items.clear;
     RadioGrouporientation.Items[0]:=rsPortrait;
      RadioGrouporientation.Items[1]:= rsPaysage;
       BitBtn2.Caption := rsAnnuler;
       BitBtn1.Caption := rsOK;


end;

procedure Tconfigimpression.FormShow(Sender: TObject);
begin
 // if encreation then begin scalefont(self); encreation:=false; end;
end;

initialization
  {$I unit_imp.lrs}
 grapheHorizontal:=tcentreh;
 graphevertical:=tcentrev;
 taillegraphehorizontal:=90;
 taillegraphevertical:=90;
 nombrecopies:=1;
 orientation_impression:=polandscape;
end.