Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Algorithmen, Datenstrukturen und Klassendesign (https://www.delphipraxis.net/78-algorithmen-datenstrukturen-und-klassendesign/)
-   -   Delphi ShortCut als Text im Objektinspektor (https://www.delphipraxis.net/196990-shortcut-als-text-im-objektinspektor.html)

Thomas Feichtner 6. Jul 2018 13:38

ShortCut als Text im Objektinspektor
 
Hallo zusammen,

ich erstelle mir gerade eine Komponente.
Als eine der Eigenschaften habe TShortCut als Property. Jedoch wird im Objektinspektor nicht F10 angzeigt sonder ich kann nur einen numerischen Wert eingeben. Was mach ich hier falsch?
Ich hätte auch schon bei der TAction geschaut aber nichts entsprechendes gefunden.

himitsu 6. Jul 2018 14:00

AW: ShortCut als Text im Objektinspektor
 
Ich dachte dass dieser Property automatisch an allen TShortCut hängt. (bei uns ist es jedenfalls so)
Delphi-Quellcode:
// unit VCLEditors

procedure Register;
begin
  RegisterPropertyEditor(TypeInfo(TShortCut), TDeineKlasse, 'DeinProperty', TShortCutProperty);
Normaler Weise sind die typspezifischen Standardeditoren "automatisch" für alle alle Klassen und Property jenes Types registriert,
also quasi so
Delphi-Quellcode:
RegisterPropertyEditor(TypeInfo(TShortCut), nil, '', TShortCutProperty);
.

Thomas Feichtner 10. Jul 2018 09:06

AW: ShortCut als Text im Objektinspektor
 
Danke, das war es.

Ich habe als Eigenschaft nicht ShortCut sondern einen eigenen Namen.
Delphi-Quellcode:
  RegisterPropertyEditor(TypeInfo(TShortCut), TmgmButtonEditProperties, 'Btn1ShortCut', TShortCutProperty);


Alle Zeitangaben in WEZ +1. Es ist jetzt 14:09 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz