![]() |
Neue Komponente: Objektinspektor: Keine Expandierung möglich
Hi,
ich möchte mir eine neue Komponente erstellen. Dieses soll ein erweitertes StringGrid sein. Nun stehe ich vor dem Problem eine "aufklappbare" Eigenschaft im Objektinspektor korrekt zu integrieren. Diese Eigenschaft ist einfach ein weiteres Objekt mit mehreren Properties. Die Eigenschaft "CellColors" wird im Objektinspektor auch angezeigt, es wird auch das + Zeichen zum aufklappen gezeigt, aber beim Klick auf das + kommt die Meldung: "Keine Expandierung möglich". Was mache ich also falsch? Hier einmal der Code (die relevanten Stellen) dazu:
Delphi-Quellcode:
gruß
type
TCellColors = class(TObject) private FColorEvenRow: TColor; FColorFixedCell: TColor; FColorSelection: TColor; FColorOddRow: TColor; procedure SetColorEvenRow(const Value: TColor); procedure SetColorFixedCell(const Value: TColor); procedure SetColorSelection(const Value: TColor); procedure SetColorOddRow(const Value: TColor); public constructor Create; overload; published property ColorFixedCell: TColor read FColorFixedCell write SetColorFixedCell; property ColorSelection: TColor read FColorSelection write SetColorSelection; property ColorEvenRow: TColor read FColorEvenRow write SetColorEvenRow; property ColorOddRow: TColor read FColorOddRow write SetColorOddRow; end; TAGStringGrid = class(TStringGrid) private FCellColors: TCellColors; procedure SetCellColors(const Value: TCellColors); { Private-Deklarationen } protected { Protected-Deklarationen } procedure DrawCell(ACol, ARow: Longint; ARect: TRect; AState: TGridDrawState); override; public { Public-Deklarationen } constructor Create(AOwner: TComponent); override; destructor Destroy; reintroduce; published { Published-Deklarationen } { Diese Eigenschaft soll im Objektinspektor bearbeitbar sein! Also, wie muss ich das deklarieren? } property CellColors: TCellColors read FCellColors write SetCellColors; end; procedure Register; angos |
Re: Neue Komponente: Objektinspektor: Keine Expandierung mög
Vieleicht so:
Delphi-Quellcode:
Eventuell noch Assign() überschreiben.
TCellColors = class(TPersistent)
|
Re: Neue Komponente: Objektinspektor: Keine Expandierung mög
Vielen Dank. Das wars!
Gruß angos |
Alle Zeitangaben in WEZ +1. Es ist jetzt 14:34 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz