Autor Beitrag
adler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: So 11.09.05 12:35 
Hallo.

Ich stehe vor einem Problem, wie erkenne ich welches PopUp ich aufrufen möchte.
Also ich will bei verschiedenen TreeView einträgen verschiedene PopUps aufrufen.
Das könnte ich über etwas ähnliches wie Hint machen, aber Hint gibts da anscheint nicht.
Bild kann man den Items auch nicht hinzufügen oder? das wäre gut, wüde besser aussehen und ich könnte checken welches Bild es ist.
Jemand ne Idee??

Danke

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: So 11.09.05 12:55 
Habe eben gesehen man kann Bilder hinzufügen.
Müsste nur wissen wie ich das letzte hinzugefüge Node herausfinden kann.

Danke ;)

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.
tomtom62
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 278

WIN 2000, XP prof
D5 prof.
BeitragVerfasst: Sa 24.09.05 19:53 
Du kannst an jeden Node Daten anhängen. Sieh Dir dazu mal AddObject oder AddChildobject an.
Du könntest in diesen Daten z.b. einen Record definieren und darin eine Variable Typ.

Die kannst Du auslesen und abhängig davon das Popup gestalten.
PLuS
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 98

Win XP, Suse Linux 9.0
D5 Standard, D2005 Personal; Perl; PureBasic
BeitragVerfasst: Sa 24.09.05 20:55 
Ich nehme an, dass du die einzelnen Nodes selber erstellst?!?!

Das ganze tust du wahrscheinlich so:
ausblenden Delphi-Quelltext
1:
TreeView1.Items.Add(NIL'Node-Text');					


Wenn du das ganze allerdings mit einer Variable vom Typ TTreeNode machen würdest, könntest du dem ganzen auch ein Bild aus einer ImageList hinzufügen, ohne irgendwelche Schleifendurchläufe durchzuführen oder Suchvorgänge zu machen, um deinen Node zu finden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var Node: TTreeNode;

...

//erstellen der Node:
Node := TreeView1.Items.Add(NIL'Node-Text');
//Image-ID der ImageList hinzufügen:
Node.ImageIndex := 1;
Node.SelectedIndex := 1;


MfG
PLuS
adler Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 511

Windows XP
Delphi 05 Pers
BeitragVerfasst: Sa 24.09.05 22:28 
Cool Danke

_________________
Wo's nix zu gucken gibt, gibts vielleicht was zu hören.