pager.h
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 3k
Category:

Windows Kernel

Development Platform:

Visual C++

  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.     
  18.     CPager();
  19.     
  20.     //Function Members    
  21.     DWORD _PGFToPGNDirection(DWORD dwDir);
  22.     void _Scroll(DWORD dwDirection);
  23.     void _SetChildPos(RECT * prcChild, UINT uFlags);
  24.     void _NeedScrollbars(RECT rc);
  25.     int  _GetPage(DWORD dwDirection);
  26.     void _OnSetChild(HWND hwnd, HWND hwndChild);
  27.     void _OnSetPos(int iPos);
  28.     int  _OnGetPos();
  29.     int  _OnSetBorder(int iBorder);
  30.     int  _OnSetButtonSize(int iSize);
  31.     void _OnReCalcSize();
  32.     void _OnLButtonChange(UINT uMsg,LPARAM lParam);
  33.     void _OnMouseMove(WPARAM wParam,LPARAM lParam);
  34.     void _DrawButton(HDC hdc,int button);
  35.     void _DrawBlank(HDC hdc,int button);
  36.     BOOL _OnPrint(HDC hdc,UINT uFlags);
  37.     int  _HitTest(int x , int y);
  38.     int  _HitTestScreen(LPPOINT ppt);
  39.     int  _HitTestCursor();
  40.     void _GetChildSize();
  41.     RECT _GetButtonRect(int iButton);
  42.     void _OnMouseLeave();
  43.     inline _GetButtonSize();
  44.     DWORD  _GetButtonState(int iButton);
  45.     void _OnTimer(UINT id);
  46.     LRESULT _DragCallback(HWND hwnd, UINT code, WPARAM wp, LPARAM lp);
  47.     void _KillTimer();
  48.     virtual void v_OnPaint(HDC hdc);
  49.     virtual LRESULT v_OnCreate();
  50.     virtual void v_OnSize(int x, int y);
  51.     virtual void v_OnNCPaint();
  52.     virtual LRESULT v_OnCommand(WPARAM wParam, LPARAM lParam);
  53.     virtual LRESULT v_OnNotify(WPARAM wParam, LPARAM lParam);
  54.     virtual DWORD v_OnStyleChanged(WPARAM wParam, LPARAM lParam);    
  55.     virtual BOOL v_OnNCCalcSize(WPARAM wParam, LPARAM lParam, LRESULT *plres);
  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 dork 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. //---------------------------------------------------------------------------------------