Advertisement
Guest User

Untitled

a guest
May 17th, 2015
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.24 KB | None | 0 0
  1. #pragma once
  2. #include <memory>
  3.  
  4. using std::shared_ptr;
  5. using std::make_shared;
  6.  
  7. class CListCtrlEx : public CListCtrl
  8. {
  9.     DECLARE_DYNAMIC(CListCtrlEx)
  10.  
  11. public:
  12.     CListCtrlEx();
  13.     virtual ~CListCtrlEx();
  14.  
  15.     void GetCurrentFont(LOGFONT& lf) const;
  16.     void SetupFont(int nSize, const CString& strName);
  17.  
  18. protected:
  19.     DECLARE_MESSAGE_MAP()
  20.  
  21. private:
  22.     virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
  23.     virtual void PreSubclassWindow();
  24.     virtual BOOL PreTranslateMessage(MSG* pMsg);
  25.  
  26.     void UpdateFocusCell(int nCol);
  27.     void MoveFocusCell(bool right);
  28.     void DrawInitialCell(const CRect& rcBounds, CDC* const pDC);
  29.     void HighLightItem(BOOL bRight, const CRect& rcBounds, const CRect& rcRightCell, CDC* const pDC);
  30.  
  31.     BOOL EnsureColumnVisible(int nCol, bool bPartialOK);
  32.     BOOL GetCellRect(int nRow, int nCol, CRect& rect);
  33.    
  34.     afx_msg void OnCustomdraw(NMHDR *pNMHDR, LRESULT *pResult);
  35.     afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  36.     afx_msg void MeasureItem (LPMEASUREITEMSTRUCT lpMeasureItemStruct);
  37.     afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam);
  38.     afx_msg LRESULT OnFocusChanged(WPARAM wParam, LPARAM lParam);
  39.  
  40. private:
  41.     int                 m_nFocusCell;
  42.     int                 m_nItem;
  43.     BOOL                m_bFocus;
  44.     shared_ptr<CFont>   m_pFont;
  45. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement