"const A = array of TArrays" = Gehirnmatsch
Hi,
Mir brummt es im Gehirn und die IDE schiert laufend ab. Ich habe volgendes:
Delphi-Quellcode:
Jetzt möcht ich gern noch für jeden Button, pro Farbe ein TextColor mit hinterlegen.
type
TBtnColors = array [0..3] of COLORREF; TColorBntState = (cbsUp, cbsDown); TColorBtn = record TextColor: COLORREF; // <--<< Colors: array [cbsUp..cbsDown] of TBtnColors; end; TColorButtonColors = (cbcRed, cbcBlue, cbcSilver); const BtnColorDef : array [cbcRed..cbcSilver] of TColorBtn = ( // Red (($D08C8CD2, $D050508A, $D007074C, $D014149D), ($D06F6FA9, $D04B4B64, $D01C1C2C, $D01F1F4A) ), // Blue (($D0D28C8C, $D08A5050, $D04C0707, $D09D1414), ($D0A96F6F, $D0644B4B, $D02C1C1C, $D04A1F1F) ), // Silver (($D0D2D2D2, $D08A8A8A, $D04C4C4C, $D09D9D9D), ($D0A9A9A9, $D0646464, $D02C2C2C, $D04A4A4A) ) ); Wo pack ich's hin ? :gruebel: |
Re: "const A = array of TArrays" = Gehirnmatsch
Also ich würd das erstmal anders mit den Arrays deklarieren;
Delphi-Quellcode:
Hm...eigentlich hast du es ja schon die $-Zahlen sind ja schon Farben :mrgreen:
type
TBtnColors = array [0..3] of COLORREF; TColorBntState = (cbsUp, cbsDown); TColorButtonColors = (cbcRed, cbcBlue, cbcSilver); TColorBtn = record TextColor: COLORREF; // <--<< Colors: array [TColorBntState] of TBtnColors; end; const BtnColorDef : array [TColorButtonColors] of TColorBtn = ( // Red (($D08C8CD2, $D050508A, $D007074C, $D014149D), ($D06F6FA9, $D04B4B64, $D01C1C2C, $D01F1F4A) ), // Blue (($D0D28C8C, $D08A5050, $D04C0707, $D09D1414), ($D0A96F6F, $D0644B4B, $D02C1C1C, $D04A1F1F) ), // Silver (($D0D2D2D2, $D08A8A8A, $D04C4C4C, $D09D9D9D), ($D0A9A9A9, $D0646464, $D02C2C2C, $D04A4A4A) ) ); TColorBtn steht doch für ein Button oder? und mit BtnColorDef machst du ja eine Ansammlung dieser Farben, für cbcRed, cbcBlue und cbcSilver. So mit TextColor im Record hast du ja schon deine Textfarbe für den Button. Also weis ich nicht was du willst?? Oder hab ich das irgendwie voll falsch verstanden? |
Re: "const A = array of TArrays" = Gehirnmatsch
Delphi-Quellcode:
ColorBtn = record
TextColor: COLORREF; // <--<< Colors: array [cbsUp..cbsDown] of TBtnColors; end;
Code:
und das ganze dann noch 3 Mal für Red, Blue und Silver wiederholt ... glaub ich
(TextColor: {COLORREF};
*Colors: (({COLORREF}, {COLORREF}, {COLORREF}, {COLORREF}), ({COLORREF}, {COLORREF}, {COLORREF}, {COLORREF}))) fang einfach klein an und arbeite dich dann nach außen hoch, bzw verschachtele das immer mehr also
Delphi-Quellcode:
=
ColorBtn = record
TextColor: TYP; Colors: TYP; end;
Code:
(TextColor: CONST; Colors: CONST)
|
Re: "const A = array of TArrays" = Gehirnmatsch
Zitat:
Irgend wie hab ich den Eintruck ich müsste Win mal neu starten. :gruebel: |
Re: "const A = array of TArrays" = Gehirnmatsch
lol ne er meint es in der Form
Delphi-Quellcode:
const
BtnColorDef : array [TColorButtonColors] of TColorBtn = ( // Red ( TextColor: $000000; //Hier jeweils dein Farbencode :mrgreen: Colors:(($D08C8CD2, $D050508A, $D007074C, $D014149D), ($D06F6FA9, $D04B4B64, $D01C1C2C, $D01F1F4A)) ), // Blue ( TextColor: $000000; //Hier jeweils dein Farbencode :mrgreen: Colors:(($D0D28C8C, $D08A5050, $D04C0707, $D09D1414), ($D0A96F6F, $D0644B4B, $D02C1C1C, $D04A1F1F)) ), // Silver ( TextColor: $000000; //Hier jeweils dein Farbencode :mrgreen: Colors:(($D0D2D2D2, $D08A8A8A, $D04C4C4C, $D09D9D9D), ($D0A9A9A9, $D0646464, $D02C2C2C, $D04A4A4A)) ) ); |
Re: "const A = array of TArrays" = Gehirnmatsch
Jo, meint er. :thumb:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:45 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz