unit U_NDS;

interface

uses
  Windows, U_LNG, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, cxLookAndFeelPainters, StdCtrls, cxButtons, cxControls,
  cxContainer, cxEdit, cxTextEdit, cxMaskEdit, cxSpinEdit, cxDropDownEdit,
  cxCalc, RzButton, siComp, siLngLnk, RzRadChk, cxGraphics, cxLookAndFeels;

type
  TF_NDS = class(TForm)
    Label_Text: TLabel;
    SpinEdit_NDS: TcxSpinEdit;
    Button_OK: TRzBitBtn;
    Button_Cancel: TRzBitBtn;
    lng_Forms: TsiLangLinked;
    cbCanRecalcPrices: TRzCheckBox;
    procedure FormHide(Sender: TObject);
    procedure SpinEdit_NDSKeyUp(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure FormShow(Sender: TObject);
    procedure cxCheckBox1PropertiesChange(Sender: TObject);
    procedure cxCheckBox1MouseEnter(Sender: TObject);
  private
    { Private declarations }
    GForm: TForm;
  public
    { Public declarations }
    FValue: Double;
    function Execute(AValue: Double): Boolean;
    Constructor Create(AOwner: TComponent; AForm: TForm);
    Destructor Destroy; override;
  end;
 {
var
  F_NDS: TF_NDS;}

implementation

{$R *.dfm}

procedure TF_NDS.FormHide(Sender: TObject);
begin
    // ##### При Следующем вsзове, Отображать эту форму в средине Главной #####
    //F_NDS.Position := poMainFormCenter;
    //GValue := SpinEdit_NDS.Value;
end;

procedure TF_NDS.SpinEdit_NDSKeyUp(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
    SpinEdit_NDS.Update;
end;

procedure TF_NDS.FormShow(Sender: TObject);
begin
     //SpinEdit_NDS.Value := GValue;
     SpinEdit_Nds.SetFocus;
end;

constructor TF_NDS.Create(AOwner: TComponent; AForm: TForm);
begin
    GForm := AForm;
    inherited Create(AOwner);
end;

destructor TF_NDS.Destroy;
begin
    inherited;
end;

procedure TF_NDS.cxCheckBox1PropertiesChange(Sender: TObject);
begin
  //
end;

procedure TF_NDS.cxCheckBox1MouseEnter(Sender: TObject);
begin
  //
end;

function TF_NDS.Execute(AValue: Double): Boolean;
begin
  Result := false;
  FValue := AValue;
  SpinEdit_NDS.Value := AValue;
  cbCanRecalcPrices.Checked := True;
  if ShowModal = mrOk then
  begin
    FValue := SpinEdit_NDS.Value;
    Result := true;
  end;
end;

end.
