Autor Beitrag
Matthias-K
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Sa 31.07.04 13:41 
guten tag,

ich schreibe mir grad eine komponente.

bei dieser komponente möchte ich, das diverse eigenschaften mit standartwerten vorbelegt sind, und NICHT geändert werden kann! diese eigenschaften sollen einfach nicht vorhanden sein!

geht das irgendwie?

mfg matthias


Moderiert von user profile iconPeter Lustig: Topic aus VCL (Visual Component Library) verschoben am Sat 31.07.2004 um 15:08
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 31.07.04 13:56 
Welche Eigenschaften sind das und von welcher Komponente leitest du ab..?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Matthias-K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Sa 31.07.04 14:03 
mal angenommen, die komponente ist ein label. und die eigenschaft meinetwegen caption!

ist es zwar nicht, aber ist im prinzip das selbe.
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 31.07.04 14:16 
Äh.. wenn du willst das man dir hilft wären genaue Angaben ganz hilfreich..! :? Weil "im prinzip dasselb" ist oft was ganz andres (vor allem in so einer Situation)..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Matthias-K Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 271

Win95, Win98, Win2000, WinXP, Linux
D2, D4 Client/Server, D5 Enterprise, D6 Enterprise, D7 Enterprise, Delphi2005, C/C++ 3.0, C/C ++ 5.0, C/C++ 6.0
BeitragVerfasst: Sa 31.07.04 14:40 
also, es sind mehrere komponenten.

zum einen ein button, den ich häufig benutze, den will ich eine standart caption vergeben. weiterhin will ich die größe des buttons setzen. da der button auch von anderen verwendet werden soll, will ich die größe, die als standart in diesem programm dient, fest setzen, das kein anderer Programmierer diese ändern kann.

und das ist bei mehrereren komponenten der fall.

mfg matthias
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Sa 31.07.04 16:12 
Hm.. also grad beim TButton schauts schlecht aus...

In den meisten Fällen (wie zb beim TLabel) gibt es die TCustom*-Klasse (zb TCustomLabel). TCustomLabel enthält bereits den gesamten Code, veröffentlicht aber noch nicht alle Eigenschaften. In der Deklaration von TLabel findet man keine neuen Eigenschaften, Methoden etc, sondern hier werden einfach nur mehr die Eigenschaften veröffentlicht, die bei TCustomLabel noch als protected deklariert sind. Der Sinn dieser TCustom*-Klassen ist also genau der, dass man neue Komponenten von diesen Klassen ableiten und dann wirklich nur die Eigenschaften veröffentlicht, die man auch veröffentlichen will.
Aber gerade beim TButton gibt es sowas nicht..

Ein andrer (schmutziger) Trick ist es, eine neue Eigenschaft mit demselben Namen einzuführen und dadurch die alte Eigenschaft zu verdecken. Über inherited kann man dann innerhalb der Klasse auch auf die Original-Eigenschaft zugreifen...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!