PageRenderTime 35ms CodeModel.GetById 15ms app.highlight 14ms RepoModel.GetById 2ms app.codeStats 1ms

/designer/scalecompsdlg.pp

http://github.com/graemeg/lazarus
Pascal | 79 lines | 35 code | 15 blank | 29 comment | 0 complexity | cd804d908ccdca2bfb9f0e1c5963585d MD5 | raw file
 1{
 2 ***************************************************************************
 3 *                                                                         *
 4 *   This source is free software; you can redistribute it and/or modify   *
 5 *   it under the terms of the GNU General Public License as published by  *
 6 *   the Free Software Foundation; either version 2 of the License, or     *
 7 *   (at your option) any later version.                                   *
 8 *                                                                         *
 9 *   This code is distributed in the hope that it will be useful, but      *
10 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
12 *   General Public License for more details.                              *
13 *                                                                         *
14 *   A copy of the GNU General Public License is available on the World    *
15 *   Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also      *
16 *   obtain it by writing to the Free Software Foundation,                 *
17 *   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.        *
18 *                                                                         *
19 ***************************************************************************
20 
21  Author: Mattias Gaertner
22
23  Abstract:
24    Defines TScaleComponentsDialog.
25}
26unit ScaleCompsDlg;
27
28{$mode objfpc}{$H+}
29
30interface
31
32uses
33  Classes, SysUtils, LCLIntf, LCLProc, Forms, Controls, Buttons, StdCtrls,
34  ExtCtrls, LazarusIDEStrConsts, ButtonPanel, Spin;
35
36type
37
38  { TScaleComponentsDialog }
39
40  TScaleComponentsDialog = class(TForm)
41    ButtonPanel1: TButtonPanel;
42    PercentEdit: TSpinEdit;
43    ScaleLabel: TLabel;
44    PercentLabel: TLabel;
45  public
46    constructor Create(AOwner: TComponent);  override;
47  end;
48
49function ShowScaleComponentsDialog(out ScaleInPercent: integer): TModalResult;
50
51implementation
52
53{$R *.lfm}
54
55function ShowScaleComponentsDialog(out ScaleInPercent: integer): TModalResult;
56begin
57  with TScaleComponentsDialog.Create(nil) do
58  try
59    PercentEdit.Value:=100;
60    Result:=ShowModal;
61    ScaleInPercent:=PercentEdit.Value;
62  finally
63    Free;
64  end;
65end;
66
67{ TScaleComponentsDialog }
68
69constructor TScaleComponentsDialog.Create(AOwner: TComponent);
70begin
71  inherited Create(AOwner);
72
73  Caption := fdmScaleWord;
74
75  ScaleLabel.Caption := lisScalingFactor;
76  PercentLabel.Caption := '%';
77end;
78
79end.