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.

86 lines
3.0 KiB

  1. //---------------------------------------------------------------------------------------
  2. // File : Pager.h
  3. // Description :
  4. // This is the header file for the pager control
  5. //---------------------------------------------------------------------------------------
  6. #include "ccontrol.h"
  7. #define PGMP_RECALCSIZE 200
  8. //---------------------------------------------------------------------------------------
  9. class CPager : public CControl
  10. {
  11. public:
  12. //Function Memebers
  13. virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  14. static LRESULT PagerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  15. static LRESULT PagerDragCallback(HWND hwnd, UINT code, WPARAM wp, LPARAM lp);
  16. protected:
  17. CPager();
  18. //Function Members
  19. DWORD _PGFToPGNDirection(DWORD dwDir);
  20. void _Scroll(DWORD dwDirection);
  21. void _SetChildPos(RECT * prcChild, UINT uFlags);
  22. void _NeedScrollbars(RECT rc);
  23. int _GetPage(DWORD dwDirection);
  24. void _OnSetChild(HWND hwnd, HWND hwndChild);
  25. void _OnSetPos(int iPos);
  26. int _OnGetPos();
  27. int _OnSetBorder(int iBorder);
  28. int _OnSetButtonSize(int iSize);
  29. void _OnHotItemChange(int iButton, BOOL fEnter);
  30. void _OnReCalcSize();
  31. void _OnLButtonChange(UINT uMsg,LPARAM lParam);
  32. void _OnMouseMove(WPARAM wParam,LPARAM lParam);
  33. void _DrawButton(HDC hdc,int button);
  34. void _DrawBlank(HDC hdc,int button);
  35. BOOL _OnPrint(HDC hdc,UINT uFlags);
  36. int _HitTest(int x , int y);
  37. int _HitTestScreen(LPPOINT ppt);
  38. int _HitTestCursor();
  39. void _GetChildSize();
  40. RECT _GetButtonRect(int iButton);
  41. void _OnMouseLeave();
  42. inline _GetButtonSize();
  43. DWORD _GetButtonState(int iButton);
  44. void _OnTimer(UINT id);
  45. LRESULT _DragCallback(HWND hwnd, UINT code, WPARAM wp, LPARAM lp);
  46. void _KillTimer();
  47. virtual void v_OnPaint(HDC hdc);
  48. virtual LRESULT v_OnCreate();
  49. virtual void v_OnSize(int x, int y);
  50. virtual void v_OnNCPaint();
  51. virtual LRESULT v_OnCommand(WPARAM wParam, LPARAM lParam);
  52. virtual LRESULT v_OnNotify(WPARAM wParam, LPARAM lParam);
  53. virtual DWORD v_OnStyleChanged(WPARAM wParam, LPARAM lParam);
  54. virtual BOOL v_OnNCCalcSize(WPARAM wParam, LPARAM lParam, LRESULT *plres);
  55. virtual LPCTSTR GetThemeClass() { return TEXT("Pager"); }
  56. //Data Members
  57. HWND _hwndChild;
  58. POINT _ptPos;
  59. POINT _ptLastMove;
  60. BITBOOL _fReCalcSend:1;
  61. BITBOOL _fForwardMouseMsgs:1;
  62. BITBOOL _fBkColorSet:1;
  63. BITBOOL _fTimerSet :1;
  64. BITBOOL _fOwnsButtonDown :1;
  65. int _iButtonTrack;
  66. RECT _rcDefClient; // this is our "natural" client rect if we didn't mess with nccalc
  67. DWORD _dwState[2]; // State of the two scroll buttons
  68. RECT _rcChildIdeal; // our child's ideal size
  69. int _iButtonSize;
  70. HDRAGPROXY _hDragProxy;
  71. COLORREF _clrBk;
  72. int _iBorder;
  73. UINT _cLinesPerTimeout;
  74. UINT _cPixelsPerLine;
  75. UINT _cTimeout;
  76. };
  77. //---------------------------------------------------------------------------------------