NewImageUnit.pas 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. {$R *.dfm}
  59. { TNewImageForm }
  60. procedure TFrmNewImage.BtnSelectClick(Sender: TObject);
  61. begin
  62. with ColorDialog do
  63. begin
  64. Color := PnlColor.Color;
  65. if Execute then PnlColor.Color := Color;
  66. end;
  67. end;
  68. end.