unit PopupFrm;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
  Dialogs, ComCtrls, StdCtrls, ExtCtrls;

type
  TfrmPopup = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Button1: TButton;
    Button2: TButton;
    cal: TMonthCalendar;
    procedure FormDeactivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation
uses TEMainFrm;

{$R *.dfm}

procedure TfrmPopup.FormDeactivate(Sender: TObject);
begin
  Close;
end;

procedure TfrmPopup.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  Action := caFree;
  frmTemplateEditor.rve.SmartPopupProperties.SetButtonState(False);
end;

procedure TfrmPopup.Button1Click(Sender: TObject);
begin
  frmTemplateEditor.ChangeDate(cal.Date);
  Close;
end;

procedure TfrmPopup.Button2Click(Sender: TObject);
begin
  Close;
end;

end.
