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.

92 lines
1.8 KiB

  1. #ifndef __SIZEBAR_H__
  2. #define __SIZEBAR_H__
  3. ///////////////////////////////////////////////////////////
  4. //
  5. //
  6. // SIZEBAR.h - CSizeBar control encapsulates the sizebar
  7. //
  8. //
  9. //
  10. // Copyright (C) 1996-1997 Microsoft Corporation. All rights reserved.
  11. ///////////////////////////////////////////////////////////
  12. //
  13. // Forword references.
  14. //
  15. class CHHWinType ;
  16. ///////////////////////////////////////////////////////////
  17. //
  18. // CSizeBar
  19. //
  20. class CSizeBar
  21. {
  22. public:
  23. // Constructor
  24. CSizeBar();
  25. // Destructor
  26. ~CSizeBar();
  27. // Access
  28. public:
  29. HWND hWnd() const
  30. { return m_hWnd; }
  31. // Gets the width of the bar.
  32. static int Width();
  33. // The smallest width a pane can be sized.
  34. static int MinimumPaneWidth() {return Width()*5;}
  35. // The smallest width the topic can be sized.
  36. static int MinimumTopicWidth() {return Width()*15;}
  37. // Operations
  38. public:
  39. // Create
  40. bool Create(CHHWinType* pWinType) ;
  41. // Resize
  42. void ResizeWindow() ;
  43. // Register the window class
  44. static void RegisterWindowClass() ;
  45. // Internal Helper Functions
  46. protected:
  47. void CalcSize(RECT* prect) ;
  48. // Window Proc
  49. LRESULT SizeBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  50. // Draw
  51. void Draw() ;
  52. // Callbacks
  53. private:
  54. // Window Proc
  55. static LRESULT WINAPI s_SizeBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  56. // Member variables.
  57. protected:
  58. // Window handle to the sizebar
  59. HWND m_hWnd;
  60. // Window handle to our parent window.
  61. HWND m_hWndParent;
  62. // CHHWinType pointer so that we can get the handle to the HTMLHelp Window.
  63. CHHWinType*m_pWinType;
  64. // how far is the mouse away from the left edge of the sizebar.
  65. int m_offset ;
  66. // True if dragging.
  67. bool m_bDragging ;
  68. };
  69. #endif //__CSizeBar_H__