NewImageUnit.pas 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. unit NewImageUnit;
  2. (* ***** BEGIN LICENSE BLOCK *****
  3. * Version: MPL 1.1
  4. *
  5. * The contents of this file are subject to the Mozilla Public License Version
  6. * 1.1 (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. * http://www.mozilla.org/MPL/
  9. *
  10. * Software distributed under the License is distributed on an "AS IS" basis,
  11. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12. * for the specific language governing rights and limitations under the
  13. * License.
  14. *
  15. * The Original Code is Graphics32
  16. *
  17. * The Initial Developer of the Original Code is
  18. * Alex A. Denisov
  19. *
  20. * Portions created by the Initial Developer are Copyright (C) 2000-2004
  21. * the Initial Developer. All Rights Reserved.
  22. *
  23. * Contributor(s):
  24. *
  25. * ***** END LICENSE BLOCK ***** *)
  26. interface
  27. {$IFDEF FPC}
  28. {$MODE Delphi}
  29. {$ENDIF}
  30. {$IFNDEF FPC}
  31. {$DEFINE Windows}
  32. {$ENDIF}
  33. uses
  34. {$IFDEF FPC}LCLIntf, LResources, {$ENDIF}
  35. SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls,
  36. ComCtrls, Buttons;
  37. type
  38. TFrmNewImage = class(TForm)
  39. BtnCancel: TButton;
  40. BtnOK: TButton;
  41. BtnSelect: TButton;
  42. BtnUpDownHeight: TUpDown;
  43. BtnUpDownWidth: TUpDown;
  44. ColorDialog: TColorDialog;
  45. EdtImageHeight: TEdit;
  46. EdtImageWidth: TEdit;
  47. LblBackgroundColor: TLabel;
  48. LblHeight: TLabel;
  49. LblHeightUnit: TLabel;
  50. LblWidth: TLabel;
  51. LblWidthUnit: TLabel;
  52. PnlColor: TPanel;
  53. procedure BtnSelectClick(Sender: TObject);
  54. end;
  55. var
  56. FrmNewImage: TFrmNewImage;
  57. implementation
  58. {$IFDEF FPC}
  59. {$R *.lfm}
  60. {$ELSE}
  61. {$R *.dfm}
  62. {$ENDIF}
  63. { TNewImageForm }
  64. procedure TFrmNewImage.BtnSelectClick(Sender: TObject);
  65. begin
  66. with ColorDialog do
  67. begin
  68. Color := PnlColor.Color;
  69. if Execute then PnlColor.Color := Color;
  70. end;
  71. end;
  72. end.