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:

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

enter image description here

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.

Upvotes: 0

Views: 777

Answers (1)

I was reading the documentation that comes with Delphi by pressing [F1]. This was only the technical reference. The help file has a link to the "Current Docwiki Article". I clicked this link and it took me to the "RAD Studio Technical Library" section of the wiki. The search box in this wiki on searches within the library section.

As a result I now have a much better understanding of how to use all three sections of the RAD Studio docwiki. More information about out to use the docwiki to it fullest can be found here. https://capecodgunny.blogspot.com/2021/04/turbo-boost-your-delphi-knowledge.html

Upvotes: 1

Related Questions