andrea-magni / TFrameStand

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

the program in TFrameStand-master\demos\Dialog do not compile (E2010 Incompatible types) #84

Closed gitu12 closed 1 year ago

gitu12 commented 1 year ago

Hello Andrea, Congratulations on your wonderful framework. outstanding :)

one of the projects do not compile. The error is: [dcc32 Error] Forms.Main.pas(100): E2010 Incompatible types: 'System.SysUtils.TProc' and 'Procedure'

the error is in:

procedure TMainForm.FormCreate(Sender: TObject); begin // this action will be tied to the rectangle implementing // the "faded" background of the stand (see 'background_cancel') // element in StyleBook1 and also tied to Button_cancel TButton // on the frame

FrameStand1.CommonActions.Add('*_cancel', , procedure (AInfo: TFrameInfo) begin if (AInfo.Frame is TColorDialogFrame) then TColorDialogFrame(AInfo.Frame).Cancel; end ); end;

Can you help with a solution? Thank you very much!

gitu12 commented 1 year ago

i forgot to mention the error is in delphi 11.3 patch 1

drcrck commented 1 year ago

, procedure (AInfo: TFrameInfo) -> , procedure (AInfo: TSubjectInfo)

gitu12 commented 1 year ago

Thank you drcrck Here is the full fix courtesy of ChatGPT :)

procedure TMainForm.FormCreate(Sender: TObject); begin // this action will be tied to the rectangle implementing // the "faded" background of the stand (see 'background_cancel') // element in StyleBook1 and also tied to Button_cancel TButton // on the frame FrameStand1.CommonActions.Add('*_cancel' , procedure (AInfo: SubjectStand.TSubjectInfo) // <-- change here begin if (AInfo is TFrameInfo) then // <-- change here TColorDialogFrame((AInfo as TFrameInfo).Frame).Cancel; // <-- change here end ); end;