![]() |
Dropdown-Liste im IO für "type String"
Hallo,
ich habe in einer Komponente eine Eigenschaft vom Typ String (bzw. vom Typ TXYString = type String). Ich möchte nun analog zur Eigenschaft TFontName eine Dropdown-Auswahl im Objektionspektor realisieren, wo ich vorgegebene Werte auswählen kann. Ich vermute, ich muss da einen Propertyeditor schreiben. Kann mir jemand einen Tipp geben? Gruß xaromz |
Re: Dropdown-Liste im IO für "type String"
so wie ich es der Hilfe entnommen habe musst du GetValues und GetAttributes deines PropertyEditors überschreiben.
|
Re: Dropdown-Liste im IO für "type String"
|
Re: Dropdown-Liste im IO für "type String"
Delphi-Quellcode:
type
TPSMyStringsEditor = class(TStringProperty) public function GetAttributes(): TPropertyAttributes; override; procedure GetValues(Proc: TGetStrProc); override; end; procedure Register(); implementation procedure Register(); begin RegisterPropertyEditor(TypeInfo(TMyStrings), nil, '', TPSMyStringsEditor); end; function TPSMyStringsEditor.GetAttributes(): TPropertyAttributes; begin result := [paValueList]; end; procedure TPSMyStringsEditor.GetValues(Proc: TGetStrProc); begin if Assigned(Proc) then begin Proc('Eintrag1'); Proc('Eintrag2'); Proc('Eintrag3'); Proc('Eintrag4'); end; end; |
Re: Dropdown-Liste im IO für "type String"
Hallo,
danke, genau was ich gesucht habe. Gruß xaromz |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:43 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