Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

907 lines
23 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows/NT **/
  3. /** Copyright(c) Microsoft Corp., 1991 **/
  4. /**********************************************************************/
  5. /*
  6. bltevent.hxx
  7. Event types, as used by the client-window classes
  8. EVENT
  9. FOCUS_EVENT
  10. CONTROL_EVENT
  11. SCROLL_EVENT
  12. TIMER_EVENT
  13. ACTIVATION_EVENT
  14. SIZE_EVENT
  15. MOVE_EVENT
  16. KEY_EVENT
  17. VKEY_EVENT
  18. CHAR_EVENT
  19. MOUSE_EVENT
  20. FILE HISTORY:
  21. beng 01-May-1991 Created
  22. beng 10-May-1991 Implementations added
  23. beng 14-May-1991 More implementations added;
  24. GENERIC_EVENT removed
  25. beng 08-Oct-1991 Win32 conversion
  26. beng 05-Dec-1991 Added scroll events
  27. beng 18-May-1992 Added QMOUSEACT_EVENT
  28. beng 28-May-1992 All WORD2DWORD replaced with UINT
  29. */
  30. #ifndef _BLT_HXX_
  31. #error "Don't include this file directly; instead, include it through blt.hxx"
  32. #endif // _BLT_HXX_
  33. #ifndef _BLTEVENT_HXX_
  34. #define _BLTEVENT_HXX_
  35. #include "bltmisc.hxx"
  36. /*************************************************************************
  37. NAME: EVENT
  38. SYNOPSIS: Base class in EVENT hierarchy
  39. INTERFACE:
  40. QueryMessage() - return wMsg arg
  41. QueryWParam() - return wParam arg
  42. QueryLParam() - reutrn lParam arg
  43. SendTo() - passes the event along, via SendMessage
  44. PostTo() - passes the event along, via PostMessage
  45. CAVEATS:
  46. Do not use this class unless you know what you are doing.
  47. Otherwise you may hose Win16-Win32 single-source compatibility.
  48. NOTES:
  49. Should these members be protected? Need to make some friends.
  50. HISTORY:
  51. beng 01-May-1991 Created
  52. beng 10-May-1991 Added friend decl's
  53. beng 14-May-1991 Made APP_WINDOW's dispatcher
  54. a friend, too
  55. Folded in GENERIC_EVENT
  56. beng 08-Oct-1991 Win32 conversion
  57. beng 27-May-1992 Added SendTo, PostTo
  58. **************************************************************************/
  59. DLL_CLASS EVENT
  60. {
  61. private:
  62. // C7 CODEWORK - make these "const" when we leave Glock
  63. UINT _nMsg;
  64. WPARAM _wParam;
  65. LPARAM _lParam;
  66. public:
  67. EVENT( UINT nMsg, WPARAM wParam, LPARAM lParam )
  68. : _nMsg(nMsg), _wParam(wParam), _lParam(lParam) {}
  69. UINT QueryMessage() const { return _nMsg; }
  70. WPARAM QueryWParam() const { return _wParam; }
  71. LPARAM QueryLParam() const { return _lParam; }
  72. LRESULT SendTo( HWND hwndDest ) const
  73. { return ::SendMessage( hwndDest, _nMsg, _wParam, _lParam ); }
  74. BOOL PostTo( HWND hwndDest ) const
  75. { return ::PostMessage( hwndDest, _nMsg, _wParam, _lParam ); }
  76. };
  77. /*************************************************************************
  78. NAME: CONTROL_EVENT
  79. SYNOPSIS: Describe a message sent by a control to its owner
  80. INTERFACE: QueryCid() - return control ID of notifier
  81. QueryCode() - return code passed by control
  82. QueryHwnd() - return hwnd of sending control.
  83. PARENT: EVENT
  84. USES: CID
  85. CAVEATS:
  86. NOTES:
  87. This event maps to WM_COMMAND. So if QueryHwnd is 0, it
  88. actually came from a menu item, in which case the CID is
  89. actually a MID.
  90. HISTORY:
  91. beng 10-May-1991 Implemented
  92. beng 07-Oct-1991 Renamed QueryCid for CONTROL_WINDOW compat
  93. beng 08-Oct-1991 Win32 conversion
  94. beng 15-Oct-1991 Added QueryHwndSender
  95. **************************************************************************/
  96. DLL_CLASS CONTROL_EVENT: public EVENT
  97. {
  98. public:
  99. CONTROL_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  100. : EVENT( wMsg, wParam, lParam ) {}
  101. // This alternate ctor lets BLT assemble a phony notification event
  102. // portably.
  103. CONTROL_EVENT( CID cid, UINT nNotification )
  104. #if defined(WIN32)
  105. : EVENT(WM_COMMAND, (WPARAM)MAKELONG(cid, (WORD)nNotification), (LPARAM)0) {}
  106. #else
  107. : EVENT(WM_COMMAND, (WPARAM)cid, (LPARAM)MAKELONG(0, nNotification)) {}
  108. #endif
  109. CID QueryCid() const
  110. {
  111. #if defined(WIN32)
  112. return (CID)LOWORD(QueryWParam());
  113. #else
  114. return (CID)QueryWParam();
  115. #endif
  116. }
  117. UINT QueryCode() const
  118. {
  119. #if defined(WIN32)
  120. return (UINT)HIWORD(QueryWParam());
  121. #else
  122. return (UINT)HIWORD(QueryLParam());
  123. #endif
  124. }
  125. HWND QueryHwnd() const
  126. {
  127. #if defined(WIN32)
  128. return (HWND) QueryLParam();
  129. #else
  130. return (HWND) LOWORD(QueryLParam());
  131. #endif
  132. }
  133. };
  134. /* This is a WIN32 manifest. See wincon.h. */
  135. #ifdef FOCUS_EVENT
  136. #undef FOCUS_EVENT
  137. #endif
  138. /*************************************************************************
  139. NAME: FOCUS_EVENT
  140. SYNOPSIS: Describe losing or gaining the input focus
  141. INTERFACE: QueryOtherHwnd() - returns hwnd of window which
  142. gained or lost the focus
  143. PARENT: EVENT
  144. CAVEATS:
  145. Note that the interface returns a Windows HWND, not a WINDOW.
  146. NOTES:
  147. Too much hassle to provide a WINDOW* - will do only
  148. at explicit request of clients.
  149. This event maps to WM_SETFOCUS and WM_KILLFOCUS.
  150. HISTORY:
  151. beng 10-May-1991 Implemented
  152. beng 08-Oct-1991 Win32 conversion
  153. **************************************************************************/
  154. DLL_CLASS FOCUS_EVENT: public EVENT
  155. {
  156. public:
  157. FOCUS_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  158. : EVENT( wMsg, wParam, lParam ) {}
  159. HWND QueryOtherHwnd() const { return (HWND) QueryWParam(); }
  160. };
  161. /*************************************************************************
  162. NAME: SCROLL_EVENT
  163. SYNOPSIS: Describe activity in a scrollbar
  164. INTERFACE: QueryCommand() - returns one of
  165. scmdLineDown
  166. scmdLineUp
  167. scmdPageDown
  168. scmdPageUp
  169. scmdThumbPos
  170. scmdThumbTrack
  171. scmdBottom
  172. scmdTop
  173. IsVertical() - TRUE if vertical scrollbar
  174. IsHorizontal() - TRUE if horizontal scrollbar
  175. PARENT: CONTROL_EVENT
  176. NOTES:
  177. If command is scmdThumbPos or scmdThumbTrack, then this
  178. object is actually a SCROLL_THUMB_EVENT.
  179. HISTORY:
  180. beng 11-Oct-1991 Documented
  181. beng 05-Dec-1991 Ported to Win32
  182. beng 18-May-1992 Added IsVertical, IsHorizontal
  183. **************************************************************************/
  184. DLL_CLASS SCROLL_EVENT: public CONTROL_EVENT
  185. {
  186. public:
  187. SCROLL_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  188. : CONTROL_EVENT( wMsg, wParam, lParam ) {}
  189. enum SCROLL_COMMAND
  190. {
  191. scmdLineDown = 0,
  192. scmdLineUp,
  193. scmdPageDown,
  194. scmdPageUp,
  195. scmdThumbPos,
  196. scmdThumbTrack,
  197. scmdBottom,
  198. scmdTop
  199. };
  200. SCROLL_COMMAND QueryCommand() const
  201. #if defined(WIN32)
  202. { return (SCROLL_COMMAND)LOWORD(QueryWParam()); }
  203. #else
  204. { return (SCROLL_COMMAND)QueryWParam(); }
  205. #endif
  206. BOOL IsVertical() const
  207. { return (QueryMessage() == WM_VSCROLL); }
  208. BOOL IsHorizontal() const
  209. { return (QueryMessage() == WM_HSCROLL); }
  210. };
  211. /*************************************************************************
  212. NAME: SCROLL_EVENT
  213. SYNOPSIS: Describe thumb activity in a scrollbar
  214. INTERFACE: QueryCommand() - returns one of
  215. tcmdThumbPos
  216. tcmdThumbTrack
  217. QueryPos() - returns position within scrollbar
  218. PARENT: SCROLL_EVENT
  219. NOTES:
  220. See also SCROLL_EVENT::IsVertical() et al.
  221. HISTORY:
  222. beng 11-Oct-1991 Documented
  223. beng 05-Dec-1991 Ported to Win32
  224. **************************************************************************/
  225. DLL_CLASS SCROLL_THUMB_EVENT: public SCROLL_EVENT
  226. {
  227. public:
  228. SCROLL_THUMB_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  229. : SCROLL_EVENT( wMsg, wParam, lParam ) {}
  230. enum THUMB_COMMAND
  231. {
  232. tcmdThumbPos=4,
  233. tcmdThumbTrack
  234. };
  235. THUMB_COMMAND QueryCommand() const
  236. #if defined(WIN32)
  237. { return (THUMB_COMMAND)LOWORD(QueryWParam()); }
  238. #else
  239. { return (THUMB_COMMAND)QueryWParam(); }
  240. #endif
  241. UINT QueryPos() const
  242. #if defined(WIN32)
  243. { return HIWORD(QueryWParam()); }
  244. #else
  245. { return LOWORD(QueryLParam()); }
  246. #endif
  247. };
  248. /*************************************************************************
  249. NAME: TIMER_EVENT
  250. SYNOPSIS: Describe the detonation of a fuse
  251. INTERFACE: QueryID() - state which timer did it
  252. PARENT: EVENT
  253. USES: TIMER_ID
  254. NOTES:
  255. This event maps to WM_TIMER.
  256. HISTORY:
  257. beng 07-Oct-1991 Returns TIMER_ID instead of WORD
  258. beng 08-Oct-1991 Win32 conversion
  259. **************************************************************************/
  260. DLL_CLASS TIMER_EVENT: public EVENT
  261. {
  262. public:
  263. TIMER_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  264. : EVENT( wMsg, wParam, lParam ) {}
  265. TIMER_ID QueryID() const { return (TIMER_ID)QueryWParam(); }
  266. };
  267. /*************************************************************************
  268. NAME: ACTIVATION_EVENT
  269. SYNOPSIS: Describe the activation of a window
  270. INTERFACE: IsActivating() - returns TRUE if window will be active
  271. PARENT: EVENT
  272. NOTES:
  273. This event maps to WM_ACTIVATE.
  274. HISTORY:
  275. beng 07-Oct-1991 Added header
  276. beng 08-Oct-1991 Win32 conversion
  277. **************************************************************************/
  278. DLL_CLASS ACTIVATION_EVENT: public EVENT
  279. {
  280. public:
  281. ACTIVATION_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  282. : EVENT( wMsg, wParam, lParam ) {}
  283. #if defined(WIN32)
  284. BOOL IsActivating() const { return (LOWORD(QueryWParam()) != 0); }
  285. #else
  286. BOOL IsActivating() const { return (QueryWParam() != 0); }
  287. #endif
  288. };
  289. /*************************************************************************
  290. NAME: SIZE_EVENT
  291. SYNOPSIS: Received after the window is resized
  292. INTERFACE: IsMaximized()
  293. IsMinimized()
  294. IsNormal()
  295. QueryHeight()
  296. QueryWidth()
  297. PARENT: EVENT
  298. NOTES:
  299. Maybe add a XYDIMENSION QueryDim method?
  300. This event maps to WM_SIZE.
  301. HISTORY:
  302. beng 15-May-1991 Documented
  303. beng 08-Oct-1991 Win32 conversion
  304. **************************************************************************/
  305. DLL_CLASS SIZE_EVENT: public EVENT
  306. {
  307. public:
  308. SIZE_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  309. : EVENT( wMsg, wParam, lParam ) {}
  310. BOOL IsMaximized() const { return (QueryWParam() == SIZEFULLSCREEN); }
  311. BOOL IsMinimized() const { return (QueryWParam() == SIZEICONIC); }
  312. BOOL IsNormal() const { return (QueryWParam() == SIZENORMAL); }
  313. UINT QueryWidth() const { return LOWORD(QueryLParam()); }
  314. UINT QueryHeight() const { return HIWORD(QueryLParam()); }
  315. };
  316. /*************************************************************************
  317. NAME: MOVE_EVENT
  318. SYNOPSIS: Received after a window is moved
  319. INTERFACE: QueryPos()
  320. PARENT: EVENT
  321. USES: XYPOINT
  322. NOTES:
  323. This event maps to WM_MOVE.
  324. HISTORY:
  325. beng 15-May-1991 Changed QueryPos to return XYPOINT
  326. beng 08-Oct-1991 Win32 conversion
  327. **************************************************************************/
  328. DLL_CLASS MOVE_EVENT: public EVENT
  329. {
  330. public:
  331. MOVE_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  332. : EVENT( wMsg, wParam, lParam ) {}
  333. XYPOINT QueryPos() const { return XYPOINT(QueryLParam()); }
  334. };
  335. /* This is a WIN32 manifest. See wincon.h. */
  336. #ifdef KEY_EVENT
  337. #undef KEY_EVENT
  338. #endif
  339. /*************************************************************************
  340. NAME: KEY_EVENT
  341. SYNOPSIS: Describe a keystroke (literal)
  342. INTERFACE: QueryRepeat()
  343. QueryScan()
  344. IsExtended()
  345. IsAltContext()
  346. IsDownPreviously()
  347. IsInTransition()
  348. PARENT: EVENT
  349. CAVEATS:
  350. If these seem confusing, well, the SDK ain't no clearer.
  351. NOTES:
  352. This event maps to the common base of WM_CHAR,
  353. WN_KEYUP, and WM_KEYDOWN.
  354. HISTORY:
  355. beng 07-Oct-1991 Added header
  356. beng 08-Oct-1991 Win32 conversion
  357. **************************************************************************/
  358. DLL_CLASS KEY_EVENT: public EVENT
  359. {
  360. public:
  361. KEY_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  362. : EVENT( wMsg, wParam, lParam ) {}
  363. UINT QueryRepeat() const { return LOWORD(QueryLParam()); }
  364. BYTE QueryScan() const { return LOBYTE(HIWORD(QueryLParam())); }
  365. BOOL IsExtended() const
  366. { return HIBYTE(HIWORD(QueryLParam())) & 0x1; }
  367. BOOL IsAltContext() const
  368. { return HIBYTE(HIWORD(QueryLParam())) & 0x20; }
  369. BOOL IsDownPreviously() const
  370. { return HIBYTE(HIWORD(QueryLParam())) & 0x40; }
  371. BOOL IsInTransition() const
  372. { return HIBYTE(HIWORD(QueryLParam())) & 0x80; }
  373. };
  374. /*************************************************************************
  375. NAME: VKEY_EVENT
  376. SYNOPSIS: Describes a translated-into-virtual-kbd keystroke
  377. INTERFACE: QueryVKey() - returns the virtual key value
  378. PARENT: KEY_EVENT
  379. CAVEATS:
  380. For the literal pre-translation keystroke, use the KEY_EVENT
  381. within. Note that a virtual keystroke may be synthesized from
  382. multiple hard keystrokes, in which case you only get the last
  383. key here.
  384. NOTES:
  385. This event maps to WM_KEYUP and WM_KEYDOWN.
  386. HISTORY:
  387. beng 07-Oct-1991 Added header
  388. beng 08-Oct-1991 Win32 conversion
  389. **************************************************************************/
  390. DLL_CLASS VKEY_EVENT: public KEY_EVENT
  391. {
  392. public:
  393. VKEY_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  394. : KEY_EVENT( wMsg, wParam, lParam ) {}
  395. WPARAM QueryVKey() const { return QueryWParam(); }
  396. };
  397. /*************************************************************************
  398. NAME: CHAR_EVENT
  399. SYNOPSIS: Even more translation - this time, to ANSI charset
  400. INTERFACE: QueryChar()
  401. PARENT: KEY_EVENT
  402. CAVEATS:
  403. See VKEY_EVENT
  404. NOTES:
  405. This event maps to WM_CHAR.
  406. HISTORY:
  407. beng 07-Oct-1991 Added header
  408. beng 08-Oct-1991 Win32 conversion
  409. **************************************************************************/
  410. DLL_CLASS CHAR_EVENT: public KEY_EVENT
  411. {
  412. public:
  413. CHAR_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  414. : KEY_EVENT( wMsg, wParam, lParam ) {}
  415. #if defined(WIN32)
  416. TCHAR QueryChar() const
  417. {
  418. #if defined(UNICODE)
  419. return LOWORD(QueryWParam());
  420. #else
  421. return LOBYTE(LOWORD(QueryWParam()));
  422. #endif
  423. }
  424. #else
  425. WCHAR QueryChar() const { return (WCHAR)QueryWParam(); }
  426. #endif
  427. };
  428. /* This is a WIN32 manifest. See wincon.h. */
  429. #ifdef MOUSE_EVENT
  430. #undef MOUSE_EVENT
  431. #endif
  432. /*************************************************************************
  433. NAME: MOUSE_EVENT
  434. SYNOPSIS: Describe mouse activity
  435. INTERFACE:
  436. QueryPos() - return position of mouse relative to window
  437. IsLeftButtonDown() - return whether the mouse button was down
  438. IsMiddleButtonDown()
  439. IsRightButtonDown()
  440. IsControlDown() - return whether the modifier-key was down
  441. IsShiftDown()
  442. PARENT: EVENT
  443. USES: XYPOINT
  444. NOTES:
  445. This event maps to WM_MOUSEMOVE and the various
  446. WM_xBUTTONyyy messages.
  447. HISTORY:
  448. beng 07-Oct-1991 Added header
  449. beng 08-Oct-1991 Win32 conversion
  450. **************************************************************************/
  451. DLL_CLASS MOUSE_EVENT: public EVENT
  452. {
  453. public:
  454. MOUSE_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  455. : EVENT( wMsg, wParam, lParam ) {}
  456. XYPOINT QueryPos() const
  457. { return XYPOINT(QueryLParam()); }
  458. BOOL IsLeftButtonDown() const
  459. { return ((QueryWParam() & MK_LBUTTON) != 0); }
  460. BOOL IsMiddleButtonDown() const
  461. { return ((QueryWParam() & MK_MBUTTON) != 0); }
  462. BOOL IsRightButtonDown() const
  463. { return ((QueryWParam() & MK_RBUTTON) != 0); }
  464. BOOL IsControlDown() const
  465. { return ((QueryWParam() & MK_CONTROL) != 0); }
  466. BOOL IsShiftDown() const
  467. { return ((QueryWParam() & MK_SHIFT) != 0); }
  468. };
  469. /* This, too, is a WIN32 manifest. See wincon.h. */
  470. #ifdef MENU_EVENT
  471. #undef MENU_EVENT
  472. #endif
  473. /*************************************************************************
  474. NAME: MENU_EVENT
  475. SYNOPSIS: Announce the pulldown of a menu
  476. INTERFACE: QueryMenu() - state which menu was pulled.
  477. (Not terribly useful.)
  478. PARENT: EVENT
  479. NOTES:
  480. This event maps to WM_INITMENU.
  481. HISTORY:
  482. beng 07-Oct-1991 Added header
  483. beng 08-Oct-1991 Win32 conversion
  484. **************************************************************************/
  485. DLL_CLASS MENU_EVENT: public EVENT
  486. {
  487. public:
  488. MENU_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  489. : EVENT( wMsg, wParam, lParam ) {}
  490. HMENU QueryMenu() const
  491. { return (HMENU)QueryWParam(); }
  492. };
  493. /*************************************************************************
  494. NAME: MENUITEM_EVENT
  495. SYNOPSIS: Describe activity within a menu.
  496. This event may be used to synchronize the contents of a status
  497. line with the current menu selection, a la 1-line help.
  498. INTERFACE: QueryMID()
  499. IsChecked()
  500. IsBitmap()
  501. IsDisabled()
  502. IsGrayed()
  503. IsOwnerDraw()
  504. IsSystem()
  505. PARENT: EVENT
  506. CAVEATS:
  507. This event lacks "OnMenuClose" support. Will add if needed.
  508. NOTES:
  509. This event maps to WM_MENUSELECT.
  510. HISTORY:
  511. beng 07-Oct-1991 Added header
  512. beng 08-Oct-1991 Win32 conversion
  513. **************************************************************************/
  514. DLL_CLASS MENUITEM_EVENT: public EVENT
  515. {
  516. private:
  517. WORD QueryFlags() const
  518. {
  519. #if defined(WIN32)
  520. return HIWORD(QueryWParam());
  521. #else
  522. return LOWORD(QueryLParam());
  523. #endif
  524. }
  525. public:
  526. MENUITEM_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  527. : EVENT( wMsg, wParam, lParam ) {}
  528. MID QueryMID() const
  529. {
  530. #if defined(WIN32)
  531. return (MID)LOWORD(QueryWParam());
  532. #else
  533. return (MID)QueryWParam();
  534. #endif
  535. }
  536. BOOL IsChecked() const
  537. { return (QueryFlags() & MF_CHECKED); }
  538. BOOL IsBitmap() const
  539. { return (QueryFlags() & MF_BITMAP); }
  540. BOOL IsDisabled() const
  541. { return (QueryFlags() & MF_DISABLED); }
  542. BOOL IsGrayed() const
  543. { return (QueryFlags() & MF_GRAYED); }
  544. BOOL IsOwnerDraw() const
  545. { return (QueryFlags() & MF_OWNERDRAW); }
  546. BOOL IsSystem() const
  547. { return (QueryFlags() & MF_SYSMENU); }
  548. };
  549. /*************************************************************************
  550. NAME: QMINMAX_EVENT
  551. SYNOPSIS: Return min/max info about a window
  552. INTERFACE:
  553. QueryMaxWidth()
  554. QueryMaxHeight()
  555. QueryMaxPos()
  556. QueryMinTrackWidth()
  557. QueryMinTrackHeight()
  558. QueryMaxTrackWidth()
  559. QueryMaxTrackHeight()
  560. SetMaxWidth()
  561. SetMaxHeight()
  562. SetMaxPos()
  563. SetMinTrackWidth()
  564. SetMinTrackHeight()
  565. SetMaxTrackWidth()
  566. SetMaxTrackHeight()
  567. PARENT: EVENT
  568. USES:
  569. CAVEATS:
  570. NOTES:
  571. Maybe should return XYDIMENSIONs as well?
  572. This event maps to WM_GETMINMAXINFO.
  573. HISTORY:
  574. beng 14-May-1991 Created
  575. beng 08-Oct-1991 Win32 conversion
  576. **************************************************************************/
  577. DLL_CLASS QMINMAX_EVENT: public EVENT
  578. {
  579. private:
  580. POINT * CalcPoint( INT iWhich ) const
  581. { return ( ((POINT*)QueryLParam()) + iWhich ); }
  582. public:
  583. QMINMAX_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  584. : EVENT( wMsg, wParam, lParam ) {}
  585. UINT QueryMaxWidth() const
  586. { return CalcPoint(1)->x; }
  587. UINT QueryMaxHeight() const
  588. { return CalcPoint(1)->y; }
  589. XYPOINT QueryMaxPos() const
  590. { return XYPOINT(*(CalcPoint(2))); }
  591. UINT QueryMinTrackWidth() const
  592. { return CalcPoint(3)->x; }
  593. UINT QueryMinTrackHeight() const
  594. { return CalcPoint(3)->y; }
  595. UINT QueryMaxTrackWidth() const
  596. { return CalcPoint(4)->x; }
  597. UINT QueryMaxTrackHeight() const
  598. { return CalcPoint(4)->y; }
  599. VOID SetMaxWidth( INT dx )
  600. { CalcPoint(1)->x = dx; }
  601. VOID SetMaxHeight( INT dy )
  602. { CalcPoint(1)->y = dy; }
  603. VOID SetMaxPos( XYPOINT xy )
  604. { CalcPoint(2)->x = xy.QueryX();
  605. CalcPoint(2)->y = xy.QueryY(); }
  606. VOID SetMinTrackWidth( INT dx )
  607. { CalcPoint(3)->x = dx; }
  608. VOID SetMinTrackHeight( INT dy )
  609. { CalcPoint(3)->y = dy; }
  610. VOID SetMaxTrackWidth( INT dx )
  611. { CalcPoint(4)->x = dx; }
  612. VOID SetMaxTrackHeight( INT dy )
  613. { CalcPoint(4)->y = dy; }
  614. };
  615. /*************************************************************************
  616. NAME: SYSCHANGE_EVENT
  617. SYNOPSIS: Announce a system configuration change
  618. INTERFACE: Completely unknown
  619. PARENT: EVENT
  620. CAVEATS:
  621. This class exists as a placeholder.
  622. HISTORY:
  623. beng 07-Oct-1991 Added this useless header
  624. beng 08-Oct-1991 Win32 conversion
  625. **************************************************************************/
  626. DLL_CLASS SYSCHANGE_EVENT: public EVENT
  627. {
  628. public:
  629. SYSCHANGE_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  630. : EVENT( wMsg, wParam, lParam ) {}
  631. // totally unspecified for now
  632. };
  633. /*************************************************************************
  634. NAME: QMOUSEACT_EVENT
  635. SYNOPSIS: Return whether a mousedown activates a control.
  636. INTERFACE: QueryHitTest() - the value returned at OnQHitTest time.
  637. QueryMouseMsg() - the value of the mouse message which
  638. generated this event.
  639. PARENT: EVENT
  640. NOTES:
  641. This event maps to WM_MOUSEACTIVATE.
  642. Should this wrap QueryMouseMsg() further?
  643. HISTORY:
  644. beng 18-May-1992 Created
  645. **************************************************************************/
  646. DLL_CLASS QMOUSEACT_EVENT: public EVENT
  647. {
  648. public:
  649. QMOUSEACT_EVENT( UINT wMsg, WPARAM wParam, LPARAM lParam )
  650. : EVENT( wMsg, wParam, lParam ) {}
  651. UINT QueryMouseMsg() const
  652. { return (UINT) HIWORD(QueryLParam()); }
  653. UINT QueryHitTest() const
  654. { return (UINT) LOWORD(QueryLParam()); }
  655. };
  656. #endif // _BLTEVENT_HXX_ - end of file