unit uFormMain;
interface
uses
System.SysUtils,
System.Types,
System.UITypes,
System.Classes,
System.Variants,
FMX.Types,
FMX.Controls,
FMX.Forms,
FMX.Graphics,
FMX.Dialogs,
FMX.StdCtrls,
FMX.Objects,
FMX.Layouts,
FMX.Controls.Presentation,
FMX.ScrollBox,
FMX.Memo;
type
TfrmFormMain = class(TForm)
imgTImage: TImage;
lytLayoutFormMain: TLayout;
lytLayoutTImage: TLayout;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
spdbtnCloseForm: TSpeedButton;
Label9: TLabel;
lblClickMe: TLabel;
procedure imgTImageClick(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure spdbtnCloseFormClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frmFormMain: TfrmFormMain;
implementation
uses
System.TypInfo;
{$R *.fmx}
var
i: Integer;
procedure TfrmFormMain.FormResize(Sender: TObject);
begin
Label1.Text := Format('frmFormMain.BorderStyle = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TFmxFormBorderStyle), Ord(frmFormMain.BorderStyle))]);
Label2.Text := Format('frmFormMain.WindowState = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TWindowState), Ord(frmFormMain.WindowState))]);
Label3.Text := Format('Form.Height=%d X Form.Width=%d', [Self.Height, Self.Width]);
Label4.Text := 'lytLayoutTImage.Position relative to lytLayoutFormMain';
Label5.Text := Format('lytLayoutFormMain.Height=%f X lytLayoutFormMain.Width=%f', [lytLayoutFormMain.Height, lytLayoutFormMain.Width]);
Label6.Text := Format('lytLayoutTImage.Position.Y=%f X lytLayoutTImage.Position.X=%f', [lytLayoutTImage.Position.Y, lytLayoutTImage.Position.X]);
Label7.Text := Format('lytLayoutTImage.Height=%f X lytLayoutTImage.Width=%f', [lytLayoutTImage.Height, lytLayoutTImage.Width]);
Label8.Text := Format('lytLayoutFormMain.Width - (lytLayoutTImage.Position.X + lytLayoutTImage.Width = %f', [lytLayoutFormMain.Width - (lytLayoutTImage.Position.X + lytLayoutTImage.Width)]);
Label9.Text := Format('lytLayoutTImage.Align = %s', [System.TypInfo.GetEnumName(System.TypeInfo(TAlignLayout), Ord(lytLayoutTImage.Align))]);
end;
procedure TfrmFormMain.imgTImageClick(Sender: TObject);
begin
if frmFormMain.WindowState = TWindowState.wsMaximized then
begin
frmFormMain.WindowState := TWindowState.wsNormal;
lblClickMe.Text := 'Click Me!';
end
else
begin
frmFormMain.WindowState := TWindowState.wsMaximized;
lblClickMe.Text := 'Click Me!'#13'Again'#13'Uh! I like...';
end;
end;
procedure TfrmFormMain.spdbtnCloseFormClick(Sender: TObject);
begin
Close;
end;
end.