summaryrefslogtreecommitdiff
path: root/src/w32dlib/control.h
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/w32dlib/control.h
parent38ec2689af45b5ef29b5837bac0e4ef45bc75fd6 (diff)
Code updates
Diffstat (limited to 'src/w32dlib/control.h')
-rw-r--r--src/w32dlib/control.h29
1 files changed, 17 insertions, 12 deletions
diff --git a/src/w32dlib/control.h b/src/w32dlib/control.h
index bd1d39c..7aef528 100644
--- a/src/w32dlib/control.h
+++ b/src/w32dlib/control.h
@@ -20,22 +20,16 @@
//
#ifndef W32DLIB_CONTROL_H
-#define W32DLIB_CONTROL_H "$Id$"
+#define W32DLIB_CONTROL_H "$Id$"
#include "w32dlib/base.h"
namespace W32DLib
{
- /// \brief Defines a callback.
- ///
- /// Return TRUE if the message was handled.
- ///
- typedef BOOL (*W32DLibCallback)(UINT msg, WPARAM wp, LPARAM lp);
-
/// \brief The base Control class.
///
- class Control
+ class Control : public W32DLibCallbackInterface
{
public:
@@ -80,12 +74,17 @@ namespace W32DLib
protected:
- /// \brief Add or remove a callback for the control.
+ /// \brief Add a callback for the control.
///
/// \param msg The Windows event message to respond to.
- /// \param callback The callback. Pass NULL to remove the callback.
+ /// \param owner The class (generally a Dialog derived one) in which
+ /// the callback resides. The class must be derived from
+ /// W32DLibCallbackInterface.
+ /// \param callback The callback.
///
- void AddCallback(UINT msg, W32DLibCallback callback);
+ void AddCallback(UINT msg,
+ W32DLibCallbackInterface *owner,
+ W32DLibCallback callback);
/// \brief Filled in by the constructor with the parent dialog.
///
@@ -97,7 +96,13 @@ namespace W32DLib
private:
- typedef std::map<UINT,W32DLibCallback> CallbackList;
+ struct CallbackDetails
+ {
+ W32DLibCallbackInterface *owner;
+ W32DLibCallback cb;
+ };
+
+ typedef std::map<UINT,CallbackDetails> CallbackList;
CallbackList m_cblist;