View Single Post
  #12  
Old 29-09-2023, 15:14
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
Quote:
Originally Posted by audiofeel View Post
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;
Reply With Quote
The Following User Says Thank You to hitman797 For This Useful Post:
audiofeel (29-09-2023)