diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-03-24 00:07:40 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-03-24 00:07:40 +0000 |
commit | 5a11b5f4b59c46e919989a0fdd05d81ba5ac9347 (patch) | |
tree | 83e20dd5e93ba6f3afedb76f3fefccbcfb045cc6 /src/w32dlib/control.h | |
parent | 38ec2689af45b5ef29b5837bac0e4ef45bc75fd6 (diff) |
Code updates
Diffstat (limited to 'src/w32dlib/control.h')
-rw-r--r-- | src/w32dlib/control.h | 29 |
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; |