Index: src/ch/PropertyListCtrl.h =================================================================== diff -u -rd5c3edd0d167db9b5d47d04248820fda49499a5e -r847d6d10ae5b9a694b9b54d3b66051239d5cbea9 --- src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision d5c3edd0d167db9b5d47d04248820fda49499a5e) +++ src/ch/PropertyListCtrl.h (.../PropertyListCtrl.h) (revision 847d6d10ae5b9a694b9b54d3b66051239d5cbea9) @@ -19,8 +19,6 @@ #ifndef __PROPERTYLIST_H__ #define __PROPERTYLIST_H__ -#include "memdc.h" - // Property Type #define ID_PROPERTY_TEXT 1 #define ID_PROPERTY_BOOL 2 @@ -59,84 +57,70 @@ // CComboButton window class CComboButton : public CButton { - void DrawTriangle(CDC* pDC, CRect Rect); - // Construction public: - BOOL Create( CRect Rect, CWnd* pParent, UINT uID); CComboButton(); + virtual ~CComboButton(); -// Attributes -public: - CPen* m_pBkPen; -// CPen* m_pGrayPen; - CBrush* m_pBkBrush; - CBrush* m_pBlackBrush; + BOOL Create(CRect Rect, CWnd* pParent, UINT uID); -// Operations -public: +private: + void DrawTriangle(CDC* pDC, CRect Rect); - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct ); +public: + void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct ) override; virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/); -// Overrides - // ClassWizard generated virtual function overrides - //{{AFX_VIRTUAL(CComboButton) - //}}AFX_VIRTUAL - -// Implementation -public: - virtual ~CComboButton(); - - // Generated message map functions protected: - //{{AFX_MSG(CComboButton) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() + +private: + CPen* m_pBkPen = nullptr; + CBrush* m_pBkBrush = nullptr; + CBrush* m_pBlackBrush = nullptr; }; ///////////////////////////////////////////////////////////////////////////// // CPropertyListCtrl window class CPropertyListCtrl : public CListBox { - int m_nWidestItem; - BOOL m_bDeleteFont; - BOOL m_bBoldSelection; - BOOL m_bChanged; - CPen* m_pBorderPen; + int m_nWidestItem = 0; + BOOL m_bDeleteFont = TRUE; + BOOL m_bBoldSelection = TRUE; + BOOL m_bChanged = FALSE; + CPen* m_pBorderPen = nullptr; CRect m_CurRect; - CFont* m_pTextFont; - CFont* m_pSelectedFont; - CFont* m_pCurFont; + CFont* m_pTextFont = nullptr; + CFont* m_pSelectedFont = nullptr; + CFont* m_pCurFont = nullptr; CString m_csText; - CBrush* m_pCurBrush; - CBrush* m_pBkBrush; - CBrush* m_pBkHighlightBrush; - CBrush* m_pBkPropertyBrush; - CButton* m_pFontButton; - CButton* m_pPathButton; - CButton* m_pDirButton; - CButton* m_pCustomButton; - CComboButton* m_pComboButton; - CListBox* m_pListBox; + CBrush* m_pCurBrush = nullptr; + CBrush* m_pBkBrush = nullptr; + CBrush* m_pBkHighlightBrush = nullptr; + CBrush* m_pBkPropertyBrush = nullptr; + CButton* m_pFontButton = nullptr; + CButton* m_pPathButton = nullptr; + CButton* m_pDirButton = nullptr; + CButton* m_pCustomButton = nullptr; + CComboButton* m_pComboButton = nullptr; + CListBox* m_pListBox = nullptr; - COLORREF m_crBorderColor; - COLORREF m_crBkColor; - COLORREF m_crTextColor; - COLORREF m_crTextHighlightColor; - COLORREF m_crHighlightColor; - COLORREF m_crPropertyBkColor; - COLORREF m_crPropertyTextColor; + COLORREF m_crBorderColor = 0; + COLORREF m_crBkColor = 0; + COLORREF m_crTextColor = 0; + COLORREF m_crTextHighlightColor = 0; + COLORREF m_crHighlightColor = 0; + COLORREF m_crPropertyBkColor = 0; + COLORREF m_crPropertyTextColor = 0; // Controls - CEdit* m_pEditWnd; + CEdit* m_pEditWnd = nullptr; // The item list CPtrList m_Items; - PROPERTYITEM* m_pCurItem; - PROPERTYITEM* m_pCurDrawItem; + PROPERTYITEM* m_pCurItem = nullptr; + PROPERTYITEM* m_pCurDrawItem = nullptr; // Construction public: @@ -161,10 +145,10 @@ void SetPropertyBkColor(COLORREF crColor); void SetHighlightColor(COLORREF crColor); void SetLineStyle(COLORREF crColor, int nStyle = PS_SOLID); - inline void SetBoldSelection(BOOL bBoldSelection) { m_bBoldSelection = bBoldSelection; }; - inline void SetTextColor(COLORREF crColor) { m_crTextColor = crColor; }; - inline void SetTextHighlightColor(COLORREF crColor) { m_crTextHighlightColor = crColor; }; - inline void SetPropertyTextColor(COLORREF crColor) { m_crPropertyTextColor = crColor; }; + void SetBoldSelection(BOOL bBoldSelection) { m_bBoldSelection = bBoldSelection; } + void SetTextColor(COLORREF crColor) { m_crTextColor = crColor; } + void SetTextHighlightColor(COLORREF crColor) { m_crTextHighlightColor = crColor; } + void SetPropertyTextColor(COLORREF crColor) { m_crPropertyTextColor = crColor; } // Add the data BOOL AddString(CString csText); @@ -186,15 +170,15 @@ bool GetProperty(int nItem, bool* bValue); bool GetProperty(int nItem, COLORREF* crColor); bool GetProperty(int nItem, LOGFONT* LogFont); - bool GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem = NULL*/); - bool GetProperty(int nItem, int* SelectedItem, CString* csText = NULL); + bool GetProperty(int nItem, CStringArray* pArray, int* /*SelectedItem = nullptr*/); + bool GetProperty(int nItem, int* SelectedItem, CString* csText = nullptr); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CPropertyListCtrl) public: - virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); - virtual void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/); + void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct) override; + void MeasureItem(LPMEASUREITEMSTRUCT /*lpMeasureItemStruct*/) override; //}}AFX_VIRTUAL // Implementation