1 #ifndef NEO_MESSAGE_ID_H
2 #define NEO_MESSAGE_ID_H
23 bool operator==(
const MessageId& rhs)
const;
29 void SetParam1(UINT_PTR param) { paramMask |= 0x1; p1 = param; }
30 void SetParam2(UINT_PTR param) { paramMask |= 0x2; p2 = param; }
31 void SetParam3(UINT_PTR param) { paramMask |= 0x4; p3 = param; }
91 inline MessageId::MessageId(UINT pMessage)
113 UINT combinedMask = paramMask & rhs.paramMask;
115 return message == rhs.message
116 && combinedMask == rhs.paramMask
117 && ((combinedMask & 0x1) ? p1 == rhs.p1 :
true)
118 && ((combinedMask & 0x2) ? p2 == rhs.p2 :
true)
119 && ((combinedMask & 0x4) ? p3 == rhs.p3 :
true);
122 inline bool MessageId::operator==(
const MessageId& rhs)
const
124 return message == rhs.message
125 && paramMask == rhs.paramMask
133 if(message != rhs.message)
134 return message < rhs.message;
136 if(paramMask != rhs.paramMask)
137 return paramMask > rhs.paramMask;
150 inline CommandMessageId::CommandMessageId()
155 inline CommandMessageId::CommandMessageId(UINT notifyCode, HWND control)
156 : MessageId(WM_COMMAND)
158 NotifyCode(notifyCode);
162 inline CommandMessageId::CommandMessageId(UINT notifyCode, UINT_PTR idOfControl)
163 : MessageId(WM_COMMAND)
165 NotifyCode(notifyCode);
166 ControlId(idOfControl);
169 inline CommandMessageId::CommandMessageId(UINT notifyCode, UINT_PTR idOfControl, HWND control)
170 : MessageId(WM_COMMAND)
172 NotifyCode(notifyCode);
173 ControlId(idOfControl);
179 inline ButtonMessageId::ButtonMessageId()
182 NotifyCode(BN_CLICKED);
185 inline ButtonMessageId::ButtonMessageId(HWND control)
186 : CommandMessageId(BN_CLICKED, control)
189 inline ButtonMessageId::ButtonMessageId(UINT idOfControl)
190 : CommandMessageId(BN_CLICKED, idOfControl)
195 inline NotifyMessageId::NotifyMessageId()
201 inline NotifyMessageId::NotifyMessageId(UINT notifyCode, HWND control)
202 : CommandMessageId(notifyCode, control)
207 inline NotifyMessageId::NotifyMessageId(UINT notifyCode, UINT_PTR idOfControl)
208 : CommandMessageId(notifyCode, idOfControl)
213 inline NotifyMessageId::NotifyMessageId(UINT notifyCode, UINT_PTR idOfControl, HWND control)
214 : CommandMessageId(notifyCode, idOfControl, control)
221 inline ScrollMessageId::ScrollMessageId(UINT pMessage, HWND scrollbar)
222 : MessageId(pMessage)
224 assert(message == WM_HSCROLL || message == WM_VSCROLL);
225 SetParam1(reinterpret_cast<UINT_PTR>(scrollbar));
Base class for standard Windows controls.
Definition: Control.h:73
Definition: MessageId.h:65
Unified message identifier.
Definition: MessageId.h:14
bool EqualOrSpecializationOf(const MessageId &rhs) const
For map lookup.
Definition: MessageId.h:111
bool operator<(const MessageId &rhs) const
For sorting.
Definition: MessageId.h:131
Definition: MessageId.h:40