Autor Beitrag
Aya
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: So 13.10.02 15:28 
Hi,

ich hab mir eine Komponente von einem TCustomControl abgeleitet, und auf diesem wiederum unter anderem ein TPanel erstellt.

Nun möchte ich, das wenn meine Kompo auf der Form ist, und ich z.B. ein Label auf das Panel innerhalb meiner Kompo packe, das dieses auch sichtbar ist wenn ich das Programm ausführer.

Denn wenn ich das Prog starte scheint das Label immer hinter das Panel, oder sogar komplett hinter meine Komponente zu rutschen...

Weiß jemand woran das liegt??

Au'revoir,
Aya
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: So 13.10.02 18:14 
Ich weiß leider nicht, woran es liegt, aber du könntes mal versuchen während der Laufzeit dem Label als Parent das Panel zuzuweisen... nur so ne spontane Idee... (kann mir aber nicht vorstellen, dass es funktioniert :wink:).

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: So 13.10.02 18:19 
hi, klar.. das funktioniert.. :)

nur, wenn ich nehmen wir mal an 500 Komponenten auf meiner Kompo hab... ai ai, viel arbeit :)

Au'revoir,
Aya
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: So 13.10.02 18:52 
O'rallY hat folgendes geschrieben:
(kann mir aber nicht vorstellen, dass es funktioniert ).

Aber natürlich habe ich gewusst das es funktioniert! :mrgreen: (ähh, hoffe ich zumindest :wink:).

Aya hat folgendes geschrieben:

nur, wenn ich nehmen wir mal an 500 Komponenten auf meiner Kompo hab... ai ai, viel arbeit :)

muss nicht sein, guck dir mal dieses Topic an. Da gehts darum, wie man einfach auf viele Kompos zugreifen kann. Hilft dir das weiter?

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: So 13.10.02 18:58 
Hi,

mh.. na ja, nicht direkt... denn da muß man trotzdem noch wissen welche Art von Komponente und so es ist.. :)

Au'revoir,
Aya
O'rallY
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 563



BeitragVerfasst: So 13.10.02 19:07 
Hmm, stimmt. Denkfehler von mir. Ok, im Moment fällt mir leider nichts mehr ein... *g*.

_________________
.oO'rallY
Linux is like a tipi: No gates, no windows and a gnu-eating apache inside...
Alfons-G
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 307

Win XP Prof, Linux, Win 7
D5 Prof, D7 Architect, D2005 Architect, D2007 Architect
BeitragVerfasst: Mo 14.10.02 18:38 
Naja Aya, Du wirst ja nicht 100 grundverschiedene Komponenten auf Deiner Form haben ;)
Da Parent eine Eigenschaft von TControl ist, kannst Du mit
ausblenden Quelltext
1:
2:
3:
4:
if Element is TControl then
  begin
  (Element as TControl).Parent := MeinPanel;
end;
darauf zugreifen.

:idea:

_________________
Alfons Grünewald
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Mo 14.10.02 23:31 
Hi,

also mal angenommen ich habe anstatt nur einem Panel gleich drei... :)

Woher soll ich dann wissen auf welchem von den 3 Panels mein z.B. Label liegt?? gut, ich könnte es über die Koordinaten rausbekommen, aber wirklich das wahre ist das nich, oder? ;)

Es gibt doch dieses ControlStyle.. damit hatte ich es hinbekommen das man überhaupt erstmal Komponenten auf meine vom TCustomControl abgeleitete Komponente packen konnte... vieleicht etwas derartiges für mein aktuelles problem? :)

Au'revoir,
Aya
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Di 15.10.02 00:47 
Hi nochmal :)

also ich hab grad mal so überlegt bei welchen Komponente es sowas schon gibt... und, na ja... im grunde beim TPageControl

Denn das ist eine Komponente in der dann mehrere andere Komponenten erstellt werden, auf welchen man wiederum selber Komponente plazieren kann... ich hab grad mal den Quelltest vom TPageControl und TTabSheet durchgewühlt, aber irgendwie find ich nix richtiges :(

Weiß jemand was?

Au'revoir,
Aya
Hoda
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 27



BeitragVerfasst: Di 15.10.02 08:33 
Hi Aya,
ein kleiner Tipp. :roll:
Aya hat folgendes geschrieben:
Woher soll ich dann wissen auf welchem von den 3 Panels mein z.B. Label liegt??

Wie währe es den mit "Findcomponent('MeinLabel')" :wink:
ausblenden Quelltext
1:
with FindComponent('MeinLabel') as TLabel do...					


Gruß
Hoda
Aya Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1964
Erhaltene Danke: 15

MacOSX 10.6.7
Xcode / C++
BeitragVerfasst: Di 15.10.02 20:01 
Hi,

also mir is grad wieder was aufgefallen... ich wollte den Parent von dem Label ändern (das Label welches auf dem Panel in meiner Komponente ist), und bekomme eine Access Violation.. :)

ich hab dann mal in der *.dfm datei nachgeguckt, scheint so als würde das Label garnicht erstellt werden.. zummindest taucht es in der dfm datei nicht auf....

hat jemand ne Idee wie ich es evtl anders lösen könnte???
Das ich das Panel am unteren rand hab liegt daran, da es als Align alBottom hat, denn wenn man auf meiner Komponente ein z.B. Memo feld mit alClient legt soll der untere bereicht freibleiben.. (Siehe mein anderen Eintrag hier im Forum)

Au'revoir,
Aya