andrea-magni / TFrameStand

TFrameStand and TFormStand components for Delphi FireMonkey (FMX)
Mozilla Public License 2.0
265 stars 78 forks source link

Hide attribute not work #61

Closed kabiri closed 3 years ago

kabiri commented 3 years ago

i add [BeforeShow] and [Hide] and callback function BeforeShow and callbackwork but Hide not work in D10.4.2

 private
    [FormInfoAttribute] FI: TFormInfo<TfrmQuestion>;
    FOnQuestionResult: TProc<Boolean>;
    { Private declarations }
  public
    [BeforeShow]
    procedure AfterShow;
    [Hide]
    procedure BeforeClose;
andrea-magni commented 3 years ago

I am trying to reproduce the issue with Delphi 11 Alexandria so please check if everything is the same with 10.4.2 (if you are still on that version, of course).

First of all, please note the [Hide] attribute means you want that method to be called in order to hide that visual combination (form+stand or frame+stand). Once you define one of this custom hide methods, the default behavior is gone.

If you want to do something before hiding the visual combination, you can follow this example:

uses ..., FrameStand, SubjectStand, ...;

public [Hide] procedure MyHideProc([SubjectInfo] Info: TSubjectInfo);

procedure TTextFrame.MyHideProc(Info: TSubjectInfo); begin // do something here Info.DefaultHide; // default behavior (actually hides the combination) end;

Feel free to reopen this issue if this does not solve your question. Thanks

Andrea