Autor Beitrag
Grafix
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Di 28.04.09 16:14 
Hey,

also, wie gewünscht, neues Thema ;)
Wie kann ich meine Tabelle in tabelleform (lol) ausgeben? So ähnlich wie bei PHP hab ich mir das vorgestellt, DBGrid ist mir jedoch zu plumb und unflexibel (oder kann man das visuell anpassen?!), gibts da andere Möglichkeiten (kein Memo^^)?
lg
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.04.09 16:39 
Was verstehst du unter visuell anpassen?

_________________
Markus Kinzler.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Di 28.04.09 16:40 
es sollen nur bestimmte Spalten ausgegeben werden, die dann einzeln angeklickt werden können um weitere Details der gewählten Zeile zu zeigen...
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.04.09 16:49 
Schau dir mal die Eigenschaft .Columns an. Dort kannst du du anzuzeigenden Spalten auswählen.
Nähere Informationen könnte man per Hint anzeigen lassen

_________________
Markus Kinzler.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Di 28.04.09 16:50 
mhm ok, dass könnte schon mal helfen.
Kann ich dynamisch labels erzeugen?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.04.09 16:53 
Was meinst du mit Labels? Spalten?

_________________
Markus Kinzler.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Di 28.04.09 16:54 
naja ein TLabel, dass ich mit einer Schleife zur Laufzeit erstelle und positioniere... ist sowas möglich?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Di 28.04.09 17:02 
Ja.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
Label := TLabel.Create(<Owner>);
Label.Parent := Parent;
Label.Top := <Oberer Rand>;
Label.Left :=<Linker Rand>:
Label.Caption := '<Text>';
...

_________________
Markus Kinzler.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Di 28.04.09 17:05 
yeah, dass war was ich gesucht hab =) thx!
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 12:35 
mhm dein Code hat einen Fehler in Zeile 1 oder? Es kommt folgende Meldung:

[Error]statement expected but 'label' found
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.04.09 12:45 
Wie heißt denn Dein Label?
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 12:46 
naja, ich habe es nicht gesetzt, es soll ja zur Laufzeit erst erstellt werden...
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.04.09 12:49 
Ich meinte ja auch die Variable. Hoffentlich nicht einfach "Label", oder?
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 12:58 
... erwischt, wie dumm von mir... Nagut, ich habs jetzt verbessert, als was muss ich die Variable denn deklarieren? Als TLabel? oder als TQRLabel?
Und er akzeptiert es jetzt, aber ich kann es nicht sehen, nachdem er es eigentlich erstellt hat -.-
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.04.09 13:00 
TQRLabel ist ja von Quickreport. TLabel sollte richtig sein, wenn Du den nicht nutzt. Und zur Sichtbarkeit: hast Du auch den richtigen Parent angegeben?
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 13:08 
habs hinbekommen, irgendwie funktionierts nicht, wenn ich Visible nicht auf True setzte..
Nochwas^^: kann ich ein Array als Variable für TLabel nehmen?
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.04.09 13:11 
Wie meinst Du das? Ein Array of TLabel oder wie?
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 13:12 
ich möchte soviele TLabels erzeugen, wie Datensätze in der Datenbank sind. Da dass ja dynamisch sein muss, brauche ich auch X Labels, die ich ja nicht alle vorher deklarieren kann. Mir fällt nur leider keine möglichkeit ein, dass zu realisieren...
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Do 30.04.09 13:17 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
var MyLabel: TLabel;
    oben: integer;
begin
  Dataset.Open;
  oben := 10;
  while not Dataset.EOF do
    begin
      MyLabel := TLabel.Create(self);
      MyLabel.Top := oben;
      //... usw. wie oben
      inc(oben,10);
      Dataset.Next;
    end;
end;

So legst Du entsprechend viele Labels an, die mit einem Abstand von 10 Pixeln untereinander liegen.
Grafix Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122

Windows 7 Professional
Delphi 2009, PHP, Prolog, Python, Java
BeitragVerfasst: Do 30.04.09 13:21 
klasse funktioniert!! Danke!