unit FMain;
interface
uses
System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
System.DateUtils,
FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs, FMX.Objects,
FMX.Layouts, FMX.Controls.Presentation, FMX.StdCtrls;
type
TFormCircles =
class(TForm)
CircleTemplate: TCircle;
LayoutZiffer: TLayout;
Text1: TText;
Layout1: TLayout;
CircleInner: TCircle;
Rectangle1: TRectangle;
procedure FormCreate(Sender: TObject);
procedure LayoutZifferClick(Sender: TObject);
procedure Rectangle1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
FormCircles: TFormCircles;
implementation
{$R *.fmx}
procedure TFormCircles.FormCreate(Sender: TObject);
const
Gap = 50;
var
C, X: Integer; LA : TLayout; T: TText;
aw: extended; NewCircle, PrevCircle: TCircle;
procedure CreateCircleNumbers (StartNr: Integer; Circle: TCircle);
var
L: integer;
begin
for L := StartNr
to 23
do begin
// Eine Kopie des Layouts incl. Kindobjekte erstellen
LA := TLayOut (circleTemplate.FindStyleResource('
number', true));
if LA <>
NIL then begin
LA.Parent := circle;
LA.height := Circle.Height;
LA.RotationAngle := L * 15;
// Nur ein Child vorhanden, ist die TText-Komponente
T := TText (LA.Children[0]);
if T <>
NIL then begin
inc (c);
T.Text := (c).ToString;
end;
end;
end;
end;
begin
c := 1; aw := CircleTemplate.width;
// create first inner circle
CreateCircleNumbers (1, CircleTemplate);
PrevCircle := CircleTemplate;
// create next outer circles
for X := 1
to 9
do begin
NewCircle := TCircle (Layout1.FindStyleResource('
circletemplate', true));
NewCircle.parent := LayOut1;
NewCircle.SendToBack;
aw := aw + Gap;
NewCircle.Width := aw;
NewCircle.Height := aw;
CreateCircleNumbers (0, NewCircle);
PrevCircle := NewCircle;
end;
//Layout1.RotationAngle := -90;
end;
procedure TFormCircles.LayoutZifferClick(Sender: TObject);
begin
end;
procedure TFormCircles.Rectangle1Click(Sender: TObject);
begin
RotationAngle := L * 15;
end;
end.