unit UnitFrmPreviewPopup;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Vcl.ExtCtrls;

type
  TfrmPreviewPopup = class(TForm)
    procedure FormPaint(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    	procedure UpdatePreview;
        procedure DrawIt;
  end;

var
  frmPreviewPopup: TfrmPreviewPopup;

implementation

uses UnitFramePopup, UnitFrmConfig;

{$R *.dfm}

{ TfrmPreviewPopup }

procedure TfrmPreviewPopup.DrawIt;
begin

end;

procedure TfrmPreviewPopup.FormPaint(Sender: TObject);
begin
    self.UpdatePreview;
end;

procedure TfrmPreviewPopup.UpdatePreview;
var ac : TACPopup;
begin
	ac := TACPopup.Create(self);
    ac.Name := '';
    //ac.ParentWindow := self.handle;

    ac.SetCanvas(Canvas);
    ac.IncludeEmpty := true;
    ac.FullMode :=FrmConfig.cbfullmode.checked;
    ac.AutoPopulate;
    ac.DrawOnCanvas();
    self.ClientWidth  := ac.Width;
    self.ClientHeight := ac.Height;

    ac.Free;
end;

end.
