summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-04-06 09:29:34 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-04-06 09:29:34 +0200
commite26d394fad6479a6729d3bc40526497fd894c7d6 (patch)
tree6c2245ab6d1de51f64796d9d61c7c51c5cf445e0
parent1d2c5e7b82039566b50a851015fd239fa9ca580b (diff)
downloadfpGUI-e26d394fad6479a6729d3bc40526497fd894c7d6.tar.xz
fpgSendMessage now calls fpgDeliverMessage() instead of .Dispatch directly.
This now causes all messages to touch the fpgApplication's MessageHookList as well - if one exists.
-rw-r--r--src/corelib/fpg_msgqueue.inc35
1 files changed, 10 insertions, 25 deletions
diff --git a/src/corelib/fpg_msgqueue.inc b/src/corelib/fpg_msgqueue.inc
index 80e0be96..386178d9 100644
--- a/src/corelib/fpg_msgqueue.inc
+++ b/src/corelib/fpg_msgqueue.inc
@@ -171,12 +171,7 @@ begin
m.Dest := Dest;
m.Params := aparams;
-// try
- m.Dest.Dispatch(m)
-// except
-// on E: Exception do
-// {$IFDEF DEBUG}writeln('fpgSendMessage Caught Exception: ' + E.Message){$ENDIF};
-// end;
+ fpgDeliverMessage(m);
end;
procedure fpgSendMessage(Sender, Dest: TObject; MsgCode: integer); overload;
@@ -190,12 +185,7 @@ begin
m.Sender := Sender;
m.Dest := Dest;
-// try
- m.Dest.Dispatch(m)
-// except
-// on E: Exception do
-// {$IFDEF DEBUG}writeln('fpgSendMessage Caught Exception: ' + E.Message){$ENDIF};
-// end;
+ fpgDeliverMessage(m);
end;
procedure fpgDeliverMessage(var msg: TfpgMessageRec);
@@ -207,21 +197,16 @@ begin
msg.Dest.Free
else
begin
-// try
- msg.Dest.Dispatch(msg);
- if fpgApplication.FMessageHookList.Count > 0 then
+ msg.Dest.Dispatch(msg);
+ if fpgApplication.FMessageHookList.Count > 0 then
+ begin
+ for i := 0 to fpgApplication.FMessageHookList.Count - 1 do
begin
- for i := 0 to fpgApplication.FMessageHookList.Count - 1 do
- begin
- oItem := TMsgHookItem(fpgApplication.FMessageHookList.Items[i]);
- if (msg.Dest = oItem.Dest) and (msg.MsgCode = oItem.MsgCode) then
- oItem.Listener.Dispatch(msg);
- end;
+ oItem := TMsgHookItem(fpgApplication.FMessageHookList.Items[i]);
+ if (msg.Dest = oItem.Dest) and (msg.MsgCode = oItem.MsgCode) then
+ oItem.Listener.Dispatch(msg);
end;
-// except
-// on E: Exception do
-// {$IFDEF DEBUG}writeln('fpgDeliverMessage Caught Exception: ' + E.Message){$ENDIF};
-// end;
+ end;
end;
end;