Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Problem to create a modal form - SOLVED
#9
Hi Stéphane,

This was a tough one.

There is a bug when there are multiple levels of frames like this. We have already fixed the bug so the fix will be available in the next release.

There is an easy workaround for you, while the fix is not available:

After creating the IWModalCard you can notify the owner form directly that there was a change (i.e. you have created a control youself), doing:

IWForm.RehashPending := True;

In your project you don't have direct access to the parent main form, however you can obtain it using the owner of the TIWFrameCard itself.

So it would be like:


Code:
uses
  uHome, IWForm;  // add IWForm here

procedure TIWFrameCard.IWButtonCardAsyncClick(Sender: TObject;
  EventParams: TStringList);
var
  oModal: TIWFrameModal;
begin
 
  with IWModalCard do
  begin
    Reset;
    //use region from uCard
    oModal := TIWFrameModal.Create(Self);
    oModal.Name := Owner.Name + '_FrameModal';
    oModal.Parent := IWRegionCardModal;
    oModal.IWLabelTitle.Caption := 'From button ' + (Sender As TIWButton).Tag.ToString;
    ContentElement := IWRegionCardModal;
    Autosize := True;
    HasHeader := False;
    HasFooter := False;
    CloseButtonVisible := False;
    Show;
  end;

  // Add this new code
  if (Self.Owner is TIWForm) then
    TIWForm(Self.Owner).RehashPending := True;
end;

Please have in mind that after the update this workaround is redundant and should be removed.

Cheers
Reply


Messages In This Thread
RE: Problem to create a modal form - by StephB - 07-07-2023, 09:58 AM
RE: Problem to create a modal form - by StephB - 07-13-2023, 04:41 PM
RE: Problem to create a modal form - by StephB - 08-01-2023, 03:32 PM
RE: Problem to create a modal form - by Alexandre Machado - 08-04-2023, 01:04 AM
RE: Problem to create a modal form - by StephB - 08-04-2023, 12:28 PM
RE: Problem to create a modal form - by StephB - 08-07-2023, 02:03 PM
RE: Problem to create a modal form - by StephB - 08-08-2023, 08:40 AM
RE: Problem to create a modal form - by StephB - 08-09-2023, 05:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)