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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
static char THIS_FILE[] = __FILE__;
#endif
+/** @brief Section name for settings in registry. */
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()
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);
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);
}
*/
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
/**
* @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);
/**
* @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)
/**
* @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)
{
// 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);
+ }
}
/**
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);
+}
CColorButton m_btnRegularText;
CColorButton m_btnSelectionBackground;
CColorButton m_btnSelectionText;
- BOOL m_bDefaultColors;
+ BOOL m_bCustomColors;
//}}AFX_DATA
COLORREF m_clrWhitespaceBackground;
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)