Autor Beitrag
pmw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Di 13.08.02 10:23 
Hallo!

Wenn ich eine neue Komponente mit dem Vorfahrentyp TPanel erstelle, wie kann ich dann alle Eigenschaften und Ereignisse im Objektinspektor entfernen, außer Left, Top, Width, Height, Enabled, Visible und Align?

Viele Grüße
Martin Winandy
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 13.08.02 10:30 
Hallo,

das geht nicht. Du kannst nur Eigenschaften Freigeben.
Du kannst aber von tCustomPanel ableiten. Das ist das selbe nur das noch alle eigenschaften Protected sind. Dann kannst du die, die du brauchst selber freigeben.

Gruß
Klabautermann
pmw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Di 13.08.02 10:46 
Hallo!

Danke für die Antwort! Wie kann ich Enabled, Visible und Align freigeben?

Viele Grüße
Martin Winandy
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Di 13.08.02 11:01 
Hallo,

anz einfach, du zählst sie unter public oder publisched auf (wahrscheinlich willst du published damit es im opbejktinspector erscheint).

Also so:

ausblenden Quelltext
1:
2:
3:
4:
published
  property Enabled;
  property Visible;
  property Align;


Gruß
Klabautermann
Tino
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Veteran
Beiträge: 9839
Erhaltene Danke: 45

Windows 8.1
Delphi XE4
BeitragVerfasst: Di 13.08.02 11:04 
Hallo,

mach es doch so (wie Klabautermann schon geschrieben hat) das Du Deine Komponente von tCustomPanel ableitest und die Eigenschaften die im Objektinspektor dargestellt werden sollen musst Du in die Published-Section unterbrigen.

So musste es ungefähr aussehen:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
Type 
  tMyPanel = Class (tCustomPanel)
      Published
        Property Left;
        Property Top;
        Property Widht;
        { ... }
    End;

Gruß
TINO

Nachtrag: Tja... da war wohl Klabautermann etwas schneller :D
pmw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Di 13.08.02 11:17 
Hallo!

Danke für die Antwort! Ich habe noch eine Frage: Wie kann ich beim Erzeugen meiner Komponente die Größen Width und Height bestimmen?

Viele Grüße
Martin Winandy
Renegade
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 358

Win XP Pro, Win 7 Beta
BDS 2006
BeitragVerfasst: Di 13.08.02 11:21 
Moin erstmal!

Das solltest du im OnCreate (tMyPanel.create(sender: tObject)) unterbringen können.

Gruß

_________________
Sokrates (468 v.Chr. - 399 v.Chr.)
"Es ist keine Schande, nichts zu wissen, wohl aber, nichts lernen zu wollen."
pmw Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 65



BeitragVerfasst: Di 13.08.02 11:48 
Danke!