/designer/scalecompsdlg.pp

http://github.com/graemeg/lazarus · Puppet · 79 lines · 62 code · 17 blank · 0 comment · 1 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. Author: Mattias Gaertner
  21. Abstract:
  22. Defines TScaleComponentsDialog.
  23. }
  24. unit ScaleCompsDlg;
  25. {$mode objfpc}{$H+}
  26. interface
  27. uses
  28. Classes, SysUtils, LCLIntf, LCLProc, Forms, Controls, Buttons, StdCtrls,
  29. ExtCtrls, LazarusIDEStrConsts, ButtonPanel, Spin;
  30. type
  31. { TScaleComponentsDialog }
  32. TScaleComponentsDialog = class(TForm)
  33. ButtonPanel1: TButtonPanel;
  34. PercentEdit: TSpinEdit;
  35. ScaleLabel: TLabel;
  36. PercentLabel: TLabel;
  37. public
  38. constructor Create(AOwner: TComponent); override;
  39. end;
  40. function ShowScaleComponentsDialog(out ScaleInPercent: integer): TModalResult;
  41. implementation
  42. {$R *.lfm}
  43. function ShowScaleComponentsDialog(out ScaleInPercent: integer): TModalResult;
  44. begin
  45. with TScaleComponentsDialog.Create(nil) do
  46. try
  47. PercentEdit.Value:=100;
  48. Result:=ShowModal;
  49. ScaleInPercent:=PercentEdit.Value;
  50. finally
  51. Free;
  52. end;
  53. end;
  54. { TScaleComponentsDialog }
  55. constructor TScaleComponentsDialog.Create(AOwner: TComponent);
  56. begin
  57. inherited Create(AOwner);
  58. Caption := fdmScaleWord;
  59. ScaleLabel.Caption := lisScalingFactor;
  60. PercentLabel.Caption := '%';
  61. end;
  62. end.