Quote:
Originally Posted by audiofeel
Sorry, I forgot to mention that there are three colorbox and three colors .
|
Code:
var
MyArr: array of Integer;
procedure FMXInnoInit;
var
I: Integer;
begin
SetArrayLength(MyArr, 38);
for I := 0 to 37 do
begin
case I of
I=(0..11) : MyArr[i] := 7 + I; // 7..18 // 7 + 11 = 18;
I=(12..16) : MyArr[i] := 20 + (I - 12); // 20..24 // 20 + (16 - 12)= 24;
I=(17..21) : MyArr[i] := 35 + (I - 17); // 35..39 // 35 + (21 - 17)= 39;
I=(22..26) : MyArr[i] := 50 + (I - 22); // 50..54 // 50 + (26 - 22)= 54;
I=(27..31) : MyArr[i] := 62 + (I - 27); // 62..66 // 62 + (31 - 27)= 66;
I=(32) : MyArr[32] := 75; // 75 // 75;
I=(33..35) : MyArr[i] := 84 + (I - 33); // 84..86 // 84 + (35 - 33)= 86;
I=(36) : MyArr[36] := 93; // 93 // 93;
I=(37) : MyArr[37] := 97; // 97 // 97;
end;
end;
end;
procedure OnChange(Sender: TObject);
var
I: Integer;
begin
case Sender of
TObject(FMXComboColorBox[1].GetObject):
begin
FMXArc[1].FillColor(FMXComboColorBox[1].GetColor);
for I := Low(MyArr) to High(MyArr) do
FMXRectangle[MyArr[I]].FillColor(FMXComboColorBox[1].GetColor);
end;
end;
end;