ResizableComboLBox.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #if !defined(AFX_RESIZABLECOMBOLBOX_H__INCLUDED_)
  2. #define AFX_RESIZABLECOMBOLBOX_H__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ResizableComboLBox.h : header file
  7. //
  8. /////////////////////////////////////////////////////////////////////////////
  9. //
  10. // This file is part of ResizableLib
  11. // https://github.com/ppescher/resizablelib
  12. //
  13. // Copyright (C) 2000-2015 by Paolo Messina
  14. // mailto:ppescher@hotmail.com
  15. //
  16. // The contents of this file are subject to the Artistic License 2.0
  17. // http://opensource.org/licenses/Artistic-2.0
  18. //
  19. // If you find this code useful, credits would be nice!
  20. //
  21. /////////////////////////////////////////////////////////////////////////////
  22. #include "ResizableGrip.h"
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CResizableComboLBox window
  25. class CResizableComboBox;
  26. class CResizableComboLBox : public CWnd, public CResizableGrip
  27. {
  28. friend class CResizableComboBox;
  29. // Construction
  30. public:
  31. CResizableComboLBox();
  32. // Attributes
  33. public:
  34. // Operations
  35. public:
  36. // Overrides
  37. // ClassWizard generated virtual function overrides
  38. //{{AFX_VIRTUAL(CResizableComboLBox)
  39. protected:
  40. virtual void PreSubclassWindow();
  41. //}}AFX_VIRTUAL
  42. // Implementation
  43. public:
  44. virtual ~CResizableComboLBox();
  45. private:
  46. CPoint m_ptBeforeSizing; // screen coords
  47. CRect m_rcBeforeSizing; // screen coords
  48. CSize m_sizeAfterSizing; // screen coords
  49. UINT m_nHitTest; // current resize operation
  50. BOOL m_bSizing;
  51. void InitializeControl();
  52. protected:
  53. DWORD m_dwAddToStyle;
  54. DWORD m_dwAddToStyleEx;
  55. CSize m_sizeMin; // initial size (minimum)
  56. CResizableComboBox* m_pOwnerCombo; // owner combobox
  57. void ApplyLimitsToPos(WINDOWPOS* lpwndpos);
  58. void EndSizing();
  59. BOOL IsRTL();
  60. virtual CWnd* GetResizableWnd() const
  61. {
  62. // make the layout know its parent window
  63. return CWnd::FromHandle(m_hWnd);
  64. };
  65. // Generated message map functions
  66. protected:
  67. //{{AFX_MSG(CResizableComboLBox)
  68. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  69. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  70. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  71. afx_msg LRESULT OnNcHitTest(CPoint point);
  72. afx_msg void OnCaptureChanged(CWnd *pWnd);
  73. afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
  74. afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
  75. //}}AFX_MSG
  76. DECLARE_MESSAGE_MAP()
  77. };
  78. /////////////////////////////////////////////////////////////////////////////
  79. //{{AFX_INSERT_LOCATION}}
  80. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  81. #endif // !defined(AFX_RESIZABLECOMBOLBOX_H__INCLUDED_)