![]() |
Re: Einem Event zugewiesene Ereignisprozedur ermitteln?
Ich hab sowas ähnliches mal in der Art gelöst:
Delphi-Quellcode:
Jetzt nur so aus dem Kopf hingeschustert. Vielleicht kannst du dir ja was rausziehen. :-)
type
TActionType = (atFileNew, atFileOpen, ...); TActionTypes = set of TActionType; TMyActions = record strict private FActions: array[TActionType] of TAction; private function GetAction(AType: TActionType): TAction; public procedure CreateActions(ATypes: TActionTypes); // Erstellt die gewünschten Aktionen property Actions[AType: TActionType]: TAction read GetAction; // Falls du von außen was mit der Aktion anstellen willst. end; procedure TMyActions.CreateActions(ATypes: TActionTypes); var t: TActionType; begin for t in ATypes do begin FActions[t] := TAction.Create(...); // ... end; end; function TMyActions.GetAction(AType: TActionType): TAction; begin Result := FActions[AType]; end; |
Re: Einem Event zugewiesene Ereignisprozedur ermitteln?
Zitat:
Delphi-Quellcode:
const
ACTION_CUT = $00; ACTION_COPY = $01; ACTION_PASTE = $02; ACTION_DELETE = $03; ACTION_SELECTALL = $04; ACTION_FIND = $05; ACTION_REPLACE = $06; ACTION_TOUPPERCASE = $07; ACTION_TOLOWERCASE = $08; ... case Item.Tag of ACTION_CUT: DoSomeThing; ACTION_COPY: DoSomeThingElse; else DoSomethingOther; end; |
Re: Einem Event zugewiesene Ereignisprozedur ermitteln?
Zitat:
Viele Grüße, Michael |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:44 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