Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 28-09-2023, 14:00
BLACKFIRE69's Avatar
BLACKFIRE69 BLACKFIRE69 is offline
Registered User
 
Join Date: Mar 2019
Location: In the Hell
Posts: 690
Thanks: 481
Thanked 2,549 Times in 563 Posts
BLACKFIRE69 is on a distinguished road
Quote:
Originally Posted by audiofeel View Post
[B]
Can 't this code be shortened somehow ?
Code:
procedure OnChange(Sender: TObject);
begin
  case Sender of
    TObject(FMXComboColorBox[1].GetObject):
    begin
      FMXRectangle[97].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[7].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[8].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[9].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[10].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[11].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[12].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[13].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[14].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[15].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[16].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[17].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[18].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[20].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[21].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[22].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[23].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[24].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[35].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[36].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[37].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[38].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[39].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[50].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[51].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[52].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[53].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[54].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[62].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[63].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[64].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[65].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[66].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[75].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[84].FillColor(FMXComboColorBox[1].GetColor);
      FMXArc[1].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[85].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[86].FillColor(FMXComboColorBox[1].GetColor);
      FMXRectangle[93].FillColor(FMXComboColorBox[1].GetColor);
    end;



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
      0..11   : MyArr[i]  :=  7 + I;        // 7..18
      12..16  : MyArr[i]  := 20 + (I - 12); // 20..24
      17..21  : MyArr[i]  := 35 + (I - 17); // 35..39
      22..26  : MyArr[i]  := 50 + (I - 22); // 50..54
      27..31  : MyArr[i]  := 62 + (I - 27); // 62..66
      32      : MyArr[32] := 75;            // 75
      33..35  : MyArr[i]  := 84 + (I - 33); // 84..86
      36      : MyArr[36] := 93;            // 93
      37      : MyArr[37] := 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;

Last edited by BLACKFIRE69; 28-09-2023 at 16:50.
Reply With Quote
The Following 2 Users Say Thank You to BLACKFIRE69 For This Useful Post:
audiofeel (28-09-2023), hitman797 (28-09-2023)
Sponsored Links
  #2  
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)
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM BLACKFIRE69 Conversion Tutorials 0 15-11-2023 17:35
Windows Phone Installer similar to razor12911's original design? Kitsune1982 Conversion Tutorials 0 02-07-2020 13:04
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 21:44.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com