OSDN Git Service

PATCH: [ 1521696 ] Improve Text color option dialog
authorKimmo Varis <kimmov@gmail.com>
Fri, 14 Jul 2006 06:50:32 +0000 (06:50 +0000)
committerKimmo Varis <kimmov@gmail.com>
Fri, 14 Jul 2006 06:50:32 +0000 (06:50 +0000)
25 files changed:
Src/Changes.txt
Src/Languages/Brazilian/MergeBrazilian.rc
Src/Languages/Bulgarian/MergeBulgarian.rc
Src/Languages/Catalan/MergeCatalan.rc
Src/Languages/ChineseSimplified/MergeChineseSimplified.rc
Src/Languages/ChineseTraditional/MergeChineseTraditional.rc
Src/Languages/Czech/MergeCzech.rc
Src/Languages/Danish/MergeDanish.rc
Src/Languages/Dutch/MergeDutch.rc
Src/Languages/French/MergeFrench.rc
Src/Languages/German/MergeGerman.rc
Src/Languages/Hungarian/MergeHungarian.rc
Src/Languages/Italian/MergeItalian.rc
Src/Languages/Japanese/MergeJapanese.rc
Src/Languages/Korean/MergeKorean.rc
Src/Languages/Norwegian/MergeNorwegian.rc
Src/Languages/Polish/MergePolish.rc
Src/Languages/Russian/MergeRussian.rc
Src/Languages/Slovak/MergeSlovak.rc
Src/Languages/Spanish/MergeSpanish.rc
Src/Languages/Swedish/MergeSwedish.rc
Src/Languages/Turkish/MergeTurkish.rc
Src/Merge.rc
Src/PropTextColors.cpp
Src/PropTextColors.h

index 10d3025..663b285 100644 (file)
@@ -6,6 +6,9 @@ Add new items to top.
  BUG: [ 1521555 ] Location Pane - can't see current location because of color
   Use 3d-color instead of scrollbar color in location pane
   Src: LocationView.cpp
+ PATCH: [ 1521696 ] Improve Text color option dialog
+  Src: Merge.rc PropTextColors.cpp PropTextColors.h
+  Src/Languages/*: Merge*.rc
 
 2006-07-13 Kimmo
  PATCH: [ 1521352 ] Cleanup char constants for CRegExep
index ba71f8f..051a09e 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index db13a90..42f9dbe 100644 (file)
@@ -1516,9 +1516,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index abcdfb4..9d90973 100644 (file)
@@ -1515,7 +1515,7 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Colors predeterminats del sistema per a text normal",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | BS_MULTILINE |
                     WS_TABSTOP,25,12,161,14
     GROUPBOX        "Color de text personalitzat",IDC_CUSTOM_COLORS_GROUP,27,33,159,
index e17c828..6d027ee 100644 (file)
@@ -1516,9 +1516,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 3438efa..78a84ce 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index c4bc4b2..12df5a6 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Barvy textu"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Výchozí systémové barvy normálního textu",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Vlastní barvy textu",IDC_CUSTOM_COLORS_GROUP,25,33,159,
                     111
     LTEXT           "Okolí textu:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index b5e7598..025272c 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 8b883c4..f3f4f42 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 0d9fafa..1d5e946 100644 (file)
@@ -1513,9 +1513,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 99d6a40..55d112f 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Standard-Systemfarben für normalen Text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Benutzerdefinierte Textfarben",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Leerzeichen:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index edbb595..f8ebf1e 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index ef69cde..9a303d8 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 6279474..83e2a4d 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "\92Ê\8fí\83e\83L\83X\83g\82É\83f\83t\83H\83\8b\83g\83V\83X\83e\83\80\83J\83\89\81[\82ð\8eg\97p",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "\83J\83X\83^\83\80\83e\83L\83X\83g\83J\83\89\81[",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "\8bó\94\92:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 3eb329d..d3573e2 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index e7ed5c0..87e51b2 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index fc3feeb..64bf48d 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Okno"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Domy\9clne kolory systemu dla zwyk³ego tekstu",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Kolory tekstu u¿ytkownika",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Odstêp:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 5aed4d3..2687623 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 0f1173b..9ed559d 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 6c89c5b..a98d9a6 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Diálogo"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Colores por defecto del sistema para texto normal",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Colores elegidos para texto normal",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Espacio:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 854769c..b4b7277 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Standard systemkulörer för normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Anpassade textkulörer",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Mellanslag:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 0cf63b5..0fe5b34 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index 485a2c1..f99fcbe 100644 (file)
@@ -1515,9 +1515,9 @@ STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
 CAPTION "Dialog"
 FONT 8, "MS Shell Dlg", 0, 0, 0x1
 BEGIN
-    CONTROL         "Default system colors for normal text",
+    CONTROL         "&Use customized text colors",
                     IDC_DEFAULT_STANDARD_COLORS,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,25,14,148,10
+                    WS_TABSTOP,25,14,161,10
     GROUPBOX        "Custom text colors",IDC_CUSTOM_COLORS_GROUP,27,33,159,
                     111
     LTEXT           "Whitespace:",IDC_WHITESPACE_COLOR_LABEL,31,58,46,10
index ca10404..8f4ef3b 100644 (file)
@@ -19,6 +19,7 @@
 static char THIS_FILE[] = __FILE__;
 #endif
 
+/** @brief Section name for settings in registry. */
 static const TCHAR Section[] = _T("Custom Colors");
 
 /////////////////////////////////////////////////////////////////////////////
@@ -30,8 +31,9 @@ static const TCHAR Section[] = _T("Custom Colors");
 CPropTextColors::CPropTextColors(COptionsMgr *optionsMgr, SyntaxColors *pColors)
  : CPropertyPage(CPropTextColors::IDD)
 , m_pOptionsMgr(optionsMgr)
+, m_bCustomColors(FALSE)
+, m_pTempColors(pColors)
 {
-       m_pTempColors = pColors;
 }
 
 CPropTextColors::~CPropTextColors()
@@ -43,7 +45,7 @@ void CPropTextColors::DoDataExchange(CDataExchange* pDX)
        CDialog::DoDataExchange(pDX);
        //{{AFX_DATA_MAP(CPropTextColors)
        DDX_Control(pDX, IDC_DEFAULT_STANDARD_COLORS, m_btnDefaultStandardColors);
-       DDX_Check(pDX, IDC_DEFAULT_STANDARD_COLORS, m_bDefaultColors);
+       DDX_Check(pDX, IDC_DEFAULT_STANDARD_COLORS, m_bCustomColors);
        DDX_Control(pDX, IDC_WHITESPACE_BKGD_COLOR, m_btnWhitespaceBackground);
        DDX_Control(pDX, IDC_REGULAR_BKGD_COLOR, m_btnRegularBackground);
        DDX_Control(pDX, IDC_REGULAR_TEXT_COLOR, m_btnRegularText);
@@ -65,12 +67,27 @@ BEGIN_MESSAGE_MAP(CPropTextColors, CDialog)
 END_MESSAGE_MAP()
 
 /** 
+ * @brief Enable/Disable controls when dialog is shown.
+ */
+BOOL CPropTextColors::OnInitDialog()
+{
+       CPropertyPage::OnInitDialog();
+
+       if (m_bCustomColors)
+               EnableColorButtons(TRUE);
+       else
+               EnableColorButtons(FALSE);
+    
+       return TRUE;  // return TRUE  unless you set the focus to a control
+}
+
+/** 
  * @brief Reads options values from storage to UI.
  * (Property sheet calls this before displaying all property pages)
  */
 void CPropTextColors::ReadOptions()
 {
-       m_bDefaultColors = GetOptionsMgr()->GetBool(OPT_CLR_DEFAULT_TEXT_COLORING);
+       m_bCustomColors = GetOptionsMgr()->GetBool(OPT_CLR_DEFAULT_TEXT_COLORING) ? FALSE : TRUE;
        SerializeColorsToFromScreen(LOAD_COLORS);
 }
 
@@ -80,7 +97,7 @@ void CPropTextColors::ReadOptions()
  */
 void CPropTextColors::WriteOptions()
 {
-       m_pOptionsMgr->SaveOption(OPT_CLR_DEFAULT_TEXT_COLORING, m_bDefaultColors == TRUE);
+       m_pOptionsMgr->SaveOption(OPT_CLR_DEFAULT_TEXT_COLORING, m_bCustomColors == FALSE);
        // User can only change colors via BrowseColorAndSave,
        // which writes to m_pTempColors
        // so user's latest choices are in m_pTempColors
@@ -92,11 +109,13 @@ void CPropTextColors::WriteOptions()
 
 /** 
  * @brief Let user browse common color dialog, and select a color
+ * @param [in] colorButton Button for which to change color.
+ * @param [in] colorIndex Index to color table.
  */
 void CPropTextColors::BrowseColorAndSave(CColorButton & colorButton, int colorIndex)
 {
        // Ignore user if colors are slaved to system
-       if (m_btnDefaultStandardColors.GetCheck() == BST_CHECKED)
+       if (m_btnDefaultStandardColors.GetCheck() == BST_UNCHECKED)
                return;
 
        COLORREF currentColor = m_pTempColors->GetColor(colorIndex);
@@ -155,9 +174,9 @@ void CPropTextColors::OnSelectionTextColor()
 
 /**
  * @brief Load all colors, Save all colors, or set all colors to default
- *  op is one of
- *    SET_DEFAULTS
- *    LOAD_COLORS
+ * @param [in] op Operation to do, one of
+ *  - SET_DEFAULTS : Sets colors to defaults
+ *  - LOAD_COLORS : Loads colors from registry
  * (No save operation because BrowseColorAndSave saves immediately when user chooses)
  */
 void CPropTextColors::SerializeColorsToFromScreen(OPERATION op)
@@ -176,9 +195,9 @@ void CPropTextColors::SerializeColorsToFromScreen(OPERATION op)
 
 /**
  * @brief Load color to button, Save color from button, or set button color to default
- *  op is one of
- *    SET_DEFAULTS
- *    LOAD_COLORS
+ * @param [in] op Operation to do, one of
+ *  - SET_DEFAULTS : Sets colors to defaults
+ *  - LOAD_COLORS : Loads colors from registry
  * (No save operation because BrowseColorAndSave saves immediately when user chooses)
  */
 void CPropTextColors::SerializeColorToFromScreen(OPERATION op, CColorButton & btn, int colorIndex)
@@ -210,6 +229,16 @@ void CPropTextColors::OnDefaultsStandardColors()
 {
        // Reset all text colors to default every time user checks defaults button
        SerializeColorsToFromScreen(SET_DEFAULTS);
+
+       CButton * btn = (CButton *)GetDlgItem(IDC_DEFAULT_STANDARD_COLORS);
+       if (btn->GetCheck() == BST_UNCHECKED)
+       {
+               EnableColorButtons(FALSE);
+       }
+       else
+       {
+               EnableColorButtons(TRUE);
+       }
 }
 
 /** 
@@ -226,4 +255,24 @@ void CPropTextColors::LoadCustomColors()
 void CPropTextColors::SaveCustomColors()
 {
        SyntaxColors_Save(m_cCustColors, sizeof(m_cCustColors)/sizeof(m_cCustColors[0]));
-}
\ No newline at end of file
+}
+
+/** 
+ * @brief Enable / disable color controls on dialog.
+ * @param [in] bEnable If TRUE color controls are enabled.
+ */
+void CPropTextColors::EnableColorButtons(BOOL bEnable)
+{
+       CStatic * stc = (CStatic *) GetDlgItem(IDC_CUSTOM_COLORS_GROUP);
+       stc->EnableWindow(bEnable);
+       stc = (CStatic *) GetDlgItem(IDC_WHITESPACE_COLOR_LABEL);
+       stc->EnableWindow(bEnable);
+       stc = (CStatic *) GetDlgItem(IDC_TEXT_COLOR_LABEL);
+       stc->EnableWindow(bEnable);
+       stc = (CStatic *) GetDlgItem(IDC_SELECTION_COLOR_LABEL);
+       stc->EnableWindow(bEnable);
+       stc = (CStatic *) GetDlgItem(IDC_BACKGROUND_COLUMN_LABEL);
+       stc->EnableWindow(bEnable);
+       stc = (CStatic *) GetDlgItem(IDC_TEXT_COLUMN_LABEL);
+       stc->EnableWindow(bEnable);
+}
index 8e268b5..24acc1b 100644 (file)
@@ -49,7 +49,7 @@ private:
        CColorButton    m_btnRegularText;
        CColorButton    m_btnSelectionBackground;
        CColorButton    m_btnSelectionText;
-       BOOL            m_bDefaultColors;
+       BOOL            m_bCustomColors;
        //}}AFX_DATA
 
        COLORREF        m_clrWhitespaceBackground;
@@ -70,12 +70,13 @@ protected:
 
        typedef enum { SET_DEFAULTS, READ_OPTIONS, LOAD_COLORS } OPERATION;
 
+       virtual BOOL OnInitDialog();
        void LoadCustomColors();
        void SaveCustomColors();
        void BrowseColorAndSave(CColorButton & colorButton, int colorIndex);
        void SerializeColorsToFromScreen(OPERATION op);
        void SerializeColorToFromScreen(OPERATION op, CColorButton & btn, int colorIndex);
-
+       void EnableColorButtons(BOOL bEnable);
 
        // Generated message map functions
        //{{AFX_MSG(CPropTextColors)