Autor Beitrag
Porter
Hält's aus hier
Beiträge: 2

WinXP
Delphi 5 prof.
BeitragVerfasst: Mi 11.08.04 10:17 
Hallo zusammen!

Soll unser Firmeninternes Config-Programm etwas modifizieren!

Hat auch alles geklappt, aber trotzdem bin ich nicht gluecklich!

Habe mir unter www.delphi-gems.com/ den ColerPickerButton runtergeladen, und habe den Quellcode dann veraendert auf unsere Beduerfnisse!

Bin aber trotzdem noch nicht gluecklich, da ich alle Farben von Hand eingeben muss, will aber lieber mit einer Schleife die Hexa werte aus einer .ini beziehen! Damit ich später auch auf 256 usw erweitern kann! Schleifen akzeptiert delphi aber nicht bei const array. Oder vielleicht doch?

Schon mal danke fuer die Hilfe!
ausblenden volle Höhe Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
implementation

uses ActnList, ImgList;

const DRAW_BUTTON_UP = 8208;
      DRAW_BUTTON_DOWN = 8720;

type TColorEntry = record
       Name: PChar;
       case Boolean of
         True: (R, G, B, reserved: Byte);
         False: (Color: COLORREF);
     end;

const DefaultColorCount = 256;
      // these colors are the same as used in Office 97/2000
      DefaultColors : array[0..DefaultColorCount - 1] of TColorEntry = (
        (Name: 'Color0'; Color: $000000),
        (Name: 'Color1'; Color: $800000),
        (Name: 'Color2'; Color: $008000),
        (Name: 'Color3'; Color: $808000),
        (Name: 'Color4'; Color: $000080),
        (Name: 'Color5'; Color: $800080),
        (Name: 'Color6'; Color: $008080),
        (Name: 'Color7'; Color: $C0C0C0),
        (Name: 'Color8'; Color: $808080),
        (Name: 'Color9'; Color: $FF0000),
        (Name: 'Color10'; Color: $00FF00),
        (Name: 'Color11'; Color: $FFFF00),
        (Name: 'Color12'; Color: $0000FF),
        (Name: 'Color13'; Color: $FF00FF),
        (Name: 'Color14'; Color: $00FFFF),
        (Name: 'Color15'; Color: $FFFFFF)
      );
DelphiFreund
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 120

Win XP
D7 Enterprise
BeitragVerfasst: Mi 11.08.04 11:08 
Natürlich nicht, dann müsstest du's als Variable deklarieren, den eine Konstante ist konstant, das heißt der Wert muss schon von anfangan feststehen.


Gruß DelphiFreund

_________________
Irren ist menschlich...
NeWsOfTzzz
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 233


D4 Prof
BeitragVerfasst: Mi 11.08.04 11:12 
Dann mach es doch einfach zu ner Variable, du hast doch keine Nachteile dadurch ausser du bist so blöd und vergisst irgendwann dass man die nicht ändern darf und änderst die irgendwann lol
Porter Threadstarter
Hält's aus hier
Beiträge: 2

WinXP
Delphi 5 prof.
BeitragVerfasst: Mi 11.08.04 12:39 
Danke! fuer eure tipps! Bin eben doch noch ein Delphi neuling! war eigentlich nur zu faul die 256 konstanten runter zu tippen! habe das aber eh jetzt schon mit einem kleinen seperaten programm geschafft! so sind es halt nur 4 zeilen im gegensatz zu 256!

Trotzdem danke! :D