DropListBox.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /////////////////////////////////////////////////////////////////////////////
  2. // DropListBox.h : header file
  3. //
  4. // CAdvComboBox Control
  5. // Version: 2.1
  6. // Date: September 2002
  7. // Author: Mathias Tunared
  8. // Email: Mathias@inorbit.com
  9. // Copyright (c) 2002. All Rights Reserved.
  10. //
  11. // This code, in compiled form or as source code, may be redistributed
  12. // unmodified PROVIDING it is not sold for profit without the authors
  13. // written consent, and providing that this notice and the authors name
  14. // and all copyright notices remains intact.
  15. //
  16. // This file is provided "as is" with no expressed or implied warranty.
  17. // The author accepts no liability for any damage/loss of business that
  18. // this product may cause.
  19. //
  20. /////////////////////////////////////////////////////////////////////////////
  21. #ifndef DROPLISTBOX_H
  22. #define DROPLISTBOX_H
  23. #include "DropWnd.h"
  24. #include "DropScrollBar.h"
  25. #define WM_SELECTED_ITEM (WM_USER+1)
  26. #define WM_DESTROY_DROPLIST (WM_USER+2)
  27. #define WM_VRC_SETCAPTURE (WM_USER+3)
  28. #define WM_VRC_RELEASECAPTURE (WM_USER+4)
  29. class CDropScrollBar;
  30. /////////////////////////////////////////////////////////////////////////////
  31. // CDropListBox window
  32. class CDropListBox : public CListBox
  33. {
  34. // Construction
  35. public:
  36. CDropListBox( CWnd* pComboParent, CDropScrollBar* pScroll );
  37. // Attributes
  38. public:
  39. int GetMaxVisibleItems();
  40. // Operations
  41. public:
  42. // Overrides
  43. // ClassWizard generated virtual function overrides
  44. //{{AFX_VIRTUAL(CDropListBox)
  45. public:
  46. virtual BOOL DestroyWindow();
  47. //}}AFX_VIRTUAL
  48. // Implementation
  49. public:
  50. int SetCurSel( int nSelect );
  51. void SetDLBStyle( DWORD dwStyle );
  52. int AddListItem( LIST_ITEM& item );
  53. void GetTextSize( LPCTSTR lpszText, int nCount, CSize& size );
  54. void SetTopIdx( int nPos, BOOL bUpdateScrollbar = FALSE );
  55. int GetBottomIndex();
  56. virtual ~CDropListBox();
  57. // Generated message map functions
  58. protected:
  59. //{{AFX_MSG(CDropListBox)
  60. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  61. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  62. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  63. afx_msg BOOL OnEraseBkgnd(CDC* pDC);
  64. //}}AFX_MSG
  65. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  66. afx_msg LONG OnSetCapture( WPARAM wParam, LPARAM lParam );
  67. afx_msg LONG OnReleaseCapture( WPARAM wParam, LPARAM lParam );
  68. DECLARE_MESSAGE_MAP()
  69. private:
  70. CWnd* m_pComboParent;
  71. CFont* m_pListFont;
  72. CDropScrollBar* m_pScroll;
  73. int m_nLastTopIdx;
  74. DWORD m_dwACBStyle;
  75. BOOL m_bSelectDisabled;
  76. };
  77. /////////////////////////////////////////////////////////////////////////////
  78. //{{AFX_INSERT_LOCATION}}
  79. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  80. #endif //DROPLISTBOX_H