Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TMultiView on Frame causes AV

When placing a TMultiview control on a frame and trying to re-open that frame in the IDE causes an AV and unable to view it.

It is a known issue and reported to EMB. The issue has been reported to the new Quality Portal here: https://quality.embarcadero.com/browse/RSP-9621. Note that you need to be logged on to view this report. For those that don't have an account, here is what the report looks like as of the time of writing:

enter image description here

Does anyone know of a workaround, or can come up with a workaround?

like image 426
Donovan Boddy Avatar asked Oct 20 '22 22:10

Donovan Boddy


1 Answers

There is workaround that will enable you to view and edit that frame, but it involves some manual handling of both .pas and .fmx files

Let's say you have created frame with TMultiView component on it.

Your .pas file looks like:

unit Unit3;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants, 
  FMX.Types, FMX.Graphics, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls, FMX.MultiView;

type
  TFrame3 = class(TFrame)
    MultiView1: TMultiView;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

implementation

{$R *.fmx}

end.

and your .fmx file looks like:

object Frame3: TFrame3
  Size.Width = 561.000000000000000000
  Size.Height = 408.000000000000000000
  Size.PlatformDefault = False
  TabOrder = 0
  object MultiView1: TMultiView
    Size.Width = 250.000000000000000000
    Size.Height = 408.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 0
  end
end

In order to successfully open your frame you have to open both files in some editor like Notepad. Replace TFrame with TForm in your .pas file class declaration,

  TFrame3 = class(TForm)

then cut out TFrame specific properties from .fmx file (and store it somewhere because you will need to copy them back after you completed the editing)

  Size.Width = 561.000000000000000000
  Size.Height = 408.000000000000000000
  Size.PlatformDefault = False
  TabOrder = 0

Now you can freely open your Frame (Form) in IDE, and do whatever you need with it. After you are done, save the files, close them in IDE and again edit .pas and .fmx files in Notepad.

  TFrame3 = class(TFrame)

and replace TForm specific properties that IDE inserted with your original TFrame ones

  Left = 0
  Top = 0
  ClientHeight = 480
  ClientWidth = 640
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop, iPhone, iPad]
  DesignerMasterStyle = 0
like image 56
Dalija Prasnikar Avatar answered Oct 22 '22 21:10

Dalija Prasnikar