ResizableComboBox.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. #if !defined(AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_)
  2. #define AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // ResizableComboBox.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 "ResizableComboLBox.h"
  23. /////////////////////////////////////////////////////////////////////////////
  24. // CResizableComboBox window
  25. class CResizableComboBox : public CComboBox
  26. {
  27. friend class CResizableComboLBox;
  28. // Construction
  29. public:
  30. CResizableComboBox();
  31. // Attributes
  32. public:
  33. protected:
  34. CResizableComboLBox m_ctrlListBox;
  35. // Operations
  36. public:
  37. // Overrides
  38. // ClassWizard generated virtual function overrides
  39. //{{AFX_VIRTUAL(CResizableComboBox)
  40. protected:
  41. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  42. virtual void PreSubclassWindow();
  43. //}}AFX_VIRTUAL
  44. // Implementation
  45. public:
  46. virtual ~CResizableComboBox();
  47. protected:
  48. RECT m_rectDropDown;
  49. BOOL m_bClipMaxHeight;
  50. BOOL m_bIntegralHeight;
  51. int m_iExtent;
  52. void InitHorizontalExtent();
  53. void UpdateHorizontalExtent(LPCTSTR szText);
  54. int MakeIntegralHeight(const int height);
  55. // Generated message map functions
  56. protected:
  57. //{{AFX_MSG(CResizableComboBox)
  58. afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. };
  62. /////////////////////////////////////////////////////////////////////////////
  63. //{{AFX_INSERT_LOCATION}}
  64. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  65. #endif // !defined(AFX_RESIZABLECOMBOBOX_H__CAEDF06D_C4F5_49E4_A783_AD7D894CF9A0__INCLUDED_)