Why does the FormFactor.Width and FormFactor.Height not change when a Delphi FMX application is resized?

  

I’m a long time Delphi VCL developer and I’m just starting to learn FMX. I created a simple little application that displays the ClientHeight, ClientWidth, FormFactor.Width, and FormFactor.Height inside a TMemo in the OnResize event handler.
These are the default sizes:

ClientHeight = 381
ClientWidth = 420
Formactor.Width = 320
FormFactor.Height = 480

How come the FormFactor.Width and FormFactor.Height do not change when the application main window is resized?

Form Code
object Form1: TForm1
Left = 0
Top = 0
BorderIcons = [biSystemMenu]
Caption = ‘Form1’
ClientHeight = 381
ClientWidth = 420
FormFactor.Width = 320
FormFactor.Height = 480
FormFactor.Devices = [Desktop]
OnResize = FormResize
DesignerMasterStyle = 0
object Memo1: TMemo
Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
DataDetectorTypes = []
Align = Center
Anchors = [akLeft, akTop, akRight, akBottom]
Size.Width = 385.000000000000000000
Size.Height = 333.000000000000000000
Size.PlatformDefault = False
TabOrder = 0
Viewport.Width = 381.000000000000000000
Viewport.Height = 329.000000000000000000
end
object StatusBar1: TStatusBar
Position.Y = 359.000000000000000000
ShowSizeGrip = True
Size.Width = 420.000000000000000000
Size.Height = 22.000000000000000000
Size.PlatformDefault = False
TabOrder = 1
end
end

Program Code
unit Unit1;

interface

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

type
TForm1 = class(TForm)
Memo1: TMemo;
StatusBar1: TStatusBar;
procedure FormResize(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.FormResize(Sender: TObject);
begin
Memo1.Lines.clear;
Memo1.Lines.Add(‘ClientHeight:’ + #9#9 + Form1.ClientHeight.ToString);
Memo1.Lines.Add(‘ClientWidth:’ + #9#9 + Form1.ClientWidth.ToString);
Memo1.Lines.Add(‘FormFactor.Width:’ + #9 + Form1.FormFactor.Width.ToString);
Memo1.Lines.Add(‘FormFactor.Height:’ + #9 + Form1.FormFactor.Height.ToString);
end;

end.

Comments are closed.