summaryrefslogtreecommitdiff
path: root/src/control.cpp
diff options
context:
space:
mode:
authorIan C <ianc@noddybox.co.uk>2005-03-24 00:07:40 +0000
committerIan C <ianc@noddybox.co.uk>2005-03-24 00:07:40 +0000
commit5a11b5f4b59c46e919989a0fdd05d81ba5ac9347 (patch)
tree83e20dd5e93ba6f3afedb76f3fefccbcfb045cc6 /src/control.cpp
parent38ec2689af45b5ef29b5837bac0e4ef45bc75fd6 (diff)
Code updates
Diffstat (limited to 'src/control.cpp')
-rw-r--r--src/control.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/control.cpp b/src/control.cpp
index abcf8fb..b824cca 100644
--- a/src/control.cpp
+++ b/src/control.cpp
@@ -18,8 +18,6 @@
//
// -------------------------------------------------------------------------
//
-// $Log$
-//
#include "w32dlib/control.h"
#include "w32dlib/dialog.h"
@@ -83,12 +81,11 @@ BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
{
if (m_cblist.count(msg)>0)
{
- W32DLibCallback cb=m_cblist[msg];
+ CallbackDetails details=m_cblist[msg];
+ W32DLibCallbackInterface *owner=details.owner;
+ W32DLibCallback cb=details.cb;
- if (cb)
- {
- return cb(msg,wp,lp);
- }
+ return (owner->*cb)(msg,wp,lp);
}
return false;
@@ -97,19 +94,15 @@ BOOL Control::ProcessMessage(UINT msg, WPARAM wp, LPARAM lp)
// ------------------------------------------------------------
//
-void Control::AddCallback(UINT msg, W32DLibCallback callback)
+void Control::AddCallback(UINT msg,
+ W32DLibCallbackInterface *owner,
+ W32DLibCallback callback)
{
- if (callback)
- {
- m_cblist[msg]=callback;
- }
- else
- {
- if (m_cblist.count(msg))
- {
- m_cblist.remove(msg);
- }
- }
+ CallbackDetails details;
+
+ details.owner=owner;
+ details.cb=callback;
+ m_cblist[msg]=details;
}