File: unitconfigpostscript.pas

package info (click to toggle)
optgeo 2.25-1
  • links: PTS
  • area: main
  • in suites: buster
  • size: 6,948 kB
  • sloc: pascal: 58,877; xml: 63; makefile: 58
file content (177 lines) | stat: -rw-r--r-- 4,960 bytes parent folder | download | duplicates (3)
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
166
167
168
169
170
171
172
173
174
175
176
177
unit UnitConfigPostScript;

{$mode objfpc}

interface

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

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

  TFormConfigPostScript = class(TForm)
  BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    CheckBoxrespect: TCheckBox;
    ComboBox1: TComboBox;
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    GroupBox3: TGroupBox;
    GroupBox4: TGroupBox;
    GroupBox5: TGroupBox;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    RadioGrouporientation: TRadioGroup;
    RadioGroupevertical: TRadioGroup;
    radiogroupehorizontal: TRadioGroup;
    SpinEdit_resx: TSpinEdit;
    SpinEdit_resy: TSpinEdit;
    spinpourcentagevertical: TSpinEdit;
    spinpourcentagehorizontal: TSpinEdit;
    procedure BitBtn1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private   encreation:boolean;
    { private declarations }
  public
    { public declarations }
  end; 

var
  FormConfigPostScript: TFormConfigPostScript;

 graphehorizontal:tgraphehorizontal;
  graphevertical:tgraphevertical;
  taillegraphehorizontal,taillegraphevertical:integer;
implementation
 uses Ray1;
{ TFormConfigPostScript }

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

 CHECKBOXRESPECT.CAPTION
 :=rsRespecterLes;


 GROUPBOX1.CAPTION
 :=rsPosition;




 GROUPBOX3.CAPTION
 :=rsTailleEnDeLa;


 GROUPBOX4.CAPTION
 :=rsRapportHaute;


 LABEL1.CAPTION
 :=rsNombre;


 LABEL2.CAPTION
 :=rsHorizontalem;


 LABEL3.CAPTION
 :=rsVerticalemen;

 groupbox5.Caption:=rsRSolutions;
   label1.Caption:=rsHorizontale2;
   label4.Caption:=rsVerticale2;

   combobox1.Items.Clear;
   combobox1.Items.Add(rsA4);
   combobox1.Items.Add(rsA3);
   combobox1.Items.Add(rsA22);
   combobox1.Items.Add(rsA1);
   combobox1.Items.Add(rsA0);
   combobox1.Items.Add(rsA5);
   combobox1.Items.Add(rsLetter);
   combobox1.Items.Add(rsLegal);
   combobox1.Items.Add(rsLedger);

 RADIOGROUPORIENTATION.CAPTION
 :=rsOrientation;


   FormConfigPostScript.caption :=rsPropriTSDuFi;

    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;


      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 TFormConfigPostScript.BitBtn1Click(Sender: TObject);
begin
  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;

if radiogrouporientation.ItemIndex=0 then
or_ps:=portrait else
or_ps:=paysage;
respect_ps:=checkboxrespect.Checked;

 if combobox1.Items[combobox1.ItemIndex]=rsA4 then p_ps:=A4;
  if combobox1.Items[combobox1.ItemIndex]=rsA3 then p_ps:=A3;
   if combobox1.Items[combobox1.ItemIndex]=rsA22 then p_ps:=A2;
    if combobox1.Items[combobox1.ItemIndex]=rsA1 then p_ps:=A1;
     if combobox1.Items[combobox1.ItemIndex]=rsA0 then p_ps:=A0;
      if combobox1.Items[combobox1.ItemIndex]=rsA5 then p_ps:=A5;
       if combobox1.Items[combobox1.ItemIndex]=rsLegal then p_ps:=Legal;
        if combobox1.Items[combobox1.ItemIndex]=rsLetter then p_ps:=Letter;
         if combobox1.Items[combobox1.ItemIndex]=rsLedger then p_ps:=Ledger;
   res_ps_x:=spinedit_resx.Value;
   res_ps_y:=spinedit_resy.Value;
end;

initialization
  {$I unitconfigpostscript.lrs}
 grapheHorizontal:=tcentreh;
 graphevertical:=tcentrev;
 taillegraphehorizontal:=90;
 taillegraphevertical:=90;
  or_ps:=paysage;
  p_ps:=A4;
 res_ps_x:=72;
  res_ps_y:=72;
end.