OSDN Git Service

Avoid infinite loops in the RegularExpression::subst() function when the length of...
[winmerge-jp/winmerge-jp.git] / Src / PropTextColors.h
1 /** 
2  * @file  PropTextColors.h
3  *
4  * @brief Declaration file for PropTextColors propertyheet
5  *
6  */
7 #pragma once
8
9 #include "ColorButton.h"
10 #include "OptionsPanel.h"
11 #include <array>
12
13 class COptionsMgr;
14 class SyntaxColors;
15
16 /** @brief Property page for colors options; used in options property sheet */
17 class PropTextColors : public OptionsPanel
18 {
19
20 // Construction
21 public:
22
23         PropTextColors(COptionsMgr *optionsMgr, SyntaxColors *pColors);
24
25 // Implement IOptionsPanel
26         virtual void ReadOptions() override;
27         virtual void WriteOptions() override;
28
29 // Dialog Data
30 private:
31
32         SyntaxColors *m_pTempColors;
33         std::array<COLORREF, 16> m_cCustColors;
34
35         //{{AFX_DATA(PropTextColors)
36         enum { IDD = IDD_PROPPAGE_COLORS_TEXT };
37         CColorButton    m_btnWhitespaceBackground;
38         CColorButton    m_btnRegularBackground;
39         CColorButton    m_btnRegularText;
40         CColorButton    m_btnSelectionBackground;
41         CColorButton    m_btnSelectionText;
42         CColorButton    m_btnMarginBackground;
43         bool            m_bCustomColors;
44         //}}AFX_DATA
45
46         // Overrides
47         // ClassWizard generated virtual function overrides
48         //{{AFX_VIRTUAL(PropTextColors)
49         protected:
50         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
51         //}}AFX_VIRTUAL
52
53 // Implementation
54 protected:
55
56         typedef enum { SET_DEFAULTS, READ_OPTIONS, LOAD_COLORS } OPERATION;
57
58         void BrowseColorAndSave(CColorButton & colorButton, int colorIndex);
59         void SerializeColorsToFromScreen(OPERATION op);
60         void SerializeColorToFromScreen(OPERATION op, CColorButton & btn, int colorIndex);
61         void EnableColorButtons(bool bEnable);
62
63         // Generated message map functions
64         //{{AFX_MSG(PropTextColors)
65         afx_msg void OnWhitespaceBackgroundColor();
66         afx_msg void OnRegularBackgroundColor();
67         afx_msg void OnRegularTextColor();
68         afx_msg void OnSelectionBackgroundColor();
69         afx_msg void OnSelectionTextColor();
70         afx_msg void OnMarginBackgroundColor();
71         afx_msg void OnDefaultsStandardColors();
72         //}}AFX_MSG
73         DECLARE_MESSAGE_MAP()
74 };