Metainformationen zur Seite
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen RevisionVorhergehende Überarbeitung | |||
| code:defaultmethods [2026/05/06 13:45] – [Drag & Drop] Harald Schmid | code:defaultmethods [2026/08/24 18:54] (aktuell) – Harald Schmid | ||
|---|---|---|---|
| Zeile 1: | Zeile 1: | ||
| ====== Standard-Funktionen und -Methoden ====== | ====== Standard-Funktionen und -Methoden ====== | ||
| + | |||
| + | ===== Nachrichten und Events ===== | ||
| + | |||
| + | ==== Nachrichten vom Hauptprogramm zum Modul ==== | ||
| + | |||
| + | < | ||
| + | CurrentModule.NotifyModuleI(' | ||
| + | CurrentModule.NotifyModuleS(' | ||
| + | </ | ||
| + | |||
| + | Zum Empfangen der Nachrichten müssen im TInsightsModuleMain die virtuellen Methoden überschrieben werden: | ||
| + | |||
| + | insights.module.base - TinsightsModuleBase | ||
| + | < | ||
| + | procedure NotifyModuleI(const mInfo: string; mInt: Integer); virtual; | ||
| + | procedure NotifyModuleS(const mInfo, mStr: string); virtual; | ||
| + | </ | ||
| + | |||
| + | insights.module.main - TinsightsModuleMain | ||
| + | < | ||
| + | procedure NotifyModuleI(const mInfo: string; mInt: Integer); override; | ||
| + | procedure NotifyModuleS(const mInfo, mStr: string); override; | ||
| + | </ | ||
| + | |||
| + | ==== Nachrichten vom Modul zum Hauptprogramm ==== | ||
| + | |||
| + | Um eine Nachricht aus einem Modul zum Hauptprogramm zu schicken, ruft das Modul die Methode Events.OnReceiveIDInt oder Events.OnReceiveIDStr auf. Diese triggern im Hauptprogramm dann | ||
| + | |||
| + | < | ||
| + | Result.Events.OnReceiveIDInt := formMain.DoReceiveIDInt; | ||
| + | Result.Events.OnReceiveIDStr := formMain.DoReceiveIDStr; | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | procedure TformMain.DoReceiveIDInt(const mEventStr: string; mID: Integer; var mResult: Integer); | ||
| + | begin | ||
| + | if sametext(' | ||
| + | mResult := IfThen(FModuleList.ContainsKey(mID), | ||
| + | end; | ||
| + | |||
| + | procedure TformMain.DoReceiveIDStr(const mEventStr: string; mID: Integer; var mResult: string); | ||
| + | begin | ||
| + | if sametext(' | ||
| + | mResult := formInit.cxMemo1.Lines.Text; | ||
| + | end; | ||
| + | </ | ||
| ===== im Module (TinsightsModuleBase) ===== | ===== im Module (TinsightsModuleBase) ===== | ||