Autor Beitrag
freshness
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43

Win XP Pof, Vista
Delphi 2006
BeitragVerfasst: Mi 17.03.04 23:16 
Gibt es eine Möglichkeit in einer Combobox oder ähnliches eine Farbauswahl zu treffen wobei nicht die Farbnamen in Textform drinnenstehen sollten sonder die Farben als solche grafisch dargestellt sind.
:arrow: Genauso wie die Farben dargestellt werden wenn man zum Beispiel in einem Editfeld die Eigenschaft COLOR anklickt.

Thx

Alex
___________________________
Bestes Beispiel eines Oxymoron:
Microsoft works!


Moderiert von user profile iconraziel: Topic aus Datenbanken verschoben am Fr 05.08.2005 um 16:07
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 18.03.04 08:27 
Hallo,

wenn Du Delphi 7 hast, dann schau Dir einmal die Komponente ColorBox auf dem Reiter "Zusätzlich" an...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
freshness Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 43

Win XP Pof, Vista
Delphi 2006
BeitragVerfasst: Do 18.03.04 22:17 
Titel: Das wars was ich gesucht habe !
:oops: Das einfache liegt oft so nahe !
Danke für die Hilfe!
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Fr 05.08.05 14:11 
Und wie löst man selbiges Problem, wenn man nur Delphi 5 hat?
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: Fr 05.08.05 14:15 
Eventuell über zusätzliche Komponenten, z.B. aus der JVCL.

Oder selber das Aussehen jedes Eintrages programmieren per OwnerDraw (aber das erfordert Erfahrung!).
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Fr 05.08.05 14:17 
Was ist die JVCL?
Ok, das mit dem OwnerDraw ist mit dann auch zu umständlich für den doch relativ kleinen Nutzen.
Torry.net ist ja leider offline...
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: Fr 05.08.05 14:22 
user profile iconFinalFantasy hat folgendes geschrieben:
Was ist die JVCL?

:shock: Es existieren ernsthafte Delphi-Nutzer, die die Jedi-VCL nicht kennen?! Und die auch keine Suchmaschine bedienen können...

sourceforge.net/projects/jvcl
und dazu noch
sourceforge.net/projects/jcl
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Fr 05.08.05 14:50 
Ich hab zwar mittlerweile schon einige ColorComboBoxen gefunden, nur die sind alle nur für eine Farbe...
Ich hätte gerne einen Text bei dem die Hintegrundfarbe und die Textfarbe nach meinen Wünschen dargestellt wird, besonders, weil in meinem Fall nur bestimmte Farbkombinationen (Vordergrundfarbe/Hintergrundfarbe) erlaubt sind.
Bei der JVCL scheint auch nichts entsprechendes dabei zu sein.

Es gibt anscheinend doch ernsthafte Nutzer, die die JVCL nicht kennen. Z.B. welche, die Delphi eigentlich nur wegen ihrer Arbeit programmieren, und das erst seit ein paar Wochen. Und da soll man draufkommen nach JVCL zu suchen? Ok ich gebs zu, nachdem du mir den Namen gesagt hast, hätte ich googlen können, was das ist...
LigH
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 239

Win98SE, Win2000SP4
D7
BeitragVerfasst: Fr 05.08.05 15:03 
Du willst also Vordergrund-Hintergrund-Farbkombinationen anbieten?

Hmm... dann doch lieber OwnerDraw (oder evtl. OnDraw*-Ereignisse?); glaube kaum, dass das jemand schon anbietet.
__

Eventuell vielleicht noch 'ne Bitmap-Combobox, mit Beispielbildern?
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Mi 24.08.05 12:20 
Ok, danke für eure Hilfe, habs mit ownerDraw geschafft.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mi 24.08.05 14:32 
Wäre vielleicht nicht schlecht, wenn du den Source hier noch posten würdest, damit andere auch was lernen können (z.B. ich :-P ). Danke.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
FinalFantasy
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 127

Windows XP
Delphi 5 Professional, Visual Studio 7 .NET (C#)
BeitragVerfasst: Do 25.08.05 07:12 
Ok, hier der Code:

ausblenden Delphi-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:
{------------------------------------------------------------------------------
  Zeichnen der Combobox
  Die Stringlist enthält dabei die Werte Textfarbe, Hintergrundfarbe, Beschriftung
  Die Werte sind jeweils mit Strichpunkt separiert und werden mit Explode() getrennt
------------------------------------------------------------------------------}

procedure TfrmFieldEdit.DrawColorBox(Control: TWinControl; Index: Integer;
  Rect: TRect; State: TOwnerDrawState);
var myr: TRect;
    values: TStringList;
begin
  with (Control as TComboBox) do begin
    values := TStringList.Create();
    Explode(';', Items[index], values);
    Canvas.Font.Color := StrToInt(values[0]);       //Schriftfarbe
    Canvas.Brush.Color := StrToInt(values[1]);      //Hintergrundfarbe
    myr := rect;
    inc(myr.Left, 1);                               //1Pixel weisser Rand
    inc(myr.Top, 1);
    dec(myr.Right, 1);
    dec(myr.Bottom, 1);
    Canvas.TextRect(myr, myr.Left,myr.Top, values[2]);  //Text ausgeben
  end;

end;
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Do 25.08.05 09:50 
values sollte unbedingt noch gefree't werden. Und wenn wir schon dabei sind: try..finally..end drumherum.