I’m doing a touch system (Windows) that needs numeric keyboard to insert user, manual entry, password, exit system. I prefered to create Button, but the attribute Font are not working.
I created a class:
unit uKeyboard;
interface
uses
FMX.Edit, FMX.StdCtrls, FMX.Layouts, SysUtils;
type
TKeyboard = class(TObject)
btnk : array [0..9] of TButton;
btnx : TButton;
btnbs : TButton;
edtk : TEdit;
procedure OnClickB (Sender : TObject);
procedure OnClickX (Sender : TObject );
procedure OnClickBS (Sender : TObject );
public
constructor Create (var GLayout1 : TGridLayout; var EdtText : TEdit);
destructor Destroy; override;
end;
implementation
constructor TKeyboard.Create(var GLayout1: TGridLayout; var EdtText: TEdit);
var
i : Integer;
begin
edtk := EdtText;
GLayout1.ItemWidth := Round(GLayout1.Width/3);
GLayout1.ItemHeight := Round(GLayout1.Height/4);
for i := 9 downto 0 do
begin
btnk[i] := TButton.Create(GLayout1);
with btnk[i] do
begin
Parent := GLayout1;
TextSettings.Font.Size := 40;
Text := IntToStr(i);
OnClick := OnClickB;
end;
end;
…
Inside Main Unit:
uses
uKeyboard, …;
var
Keyboard : TKeyboard;
// OnClickButton
Keyboard := TKeyboard.Create(GridLayout4,EdtRelease);
The Font is not 40: