diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index b8151551..33eea15b 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -592,7 +592,7 @@ static LRESULT CALLBACK editNumSpaceProc(HWND hwnd, UINT message, WPARAM wParam, void MarginsDlg::initScintParam() { NppParameters& nppParam = NppParameters::getInstance(); - const ScintillaViewParams & svp = nppParam.getSVP(); + ScintillaViewParams & svp = const_cast(nppParam.getSVP()); ::SendDlgItemMessage(_hSelf, IDC_RADIO_BOX, BM_SETCHECK, FALSE, 0); ::SendDlgItemMessage(_hSelf, IDC_RADIO_CIRCLE, BM_SETCHECK, FALSE, 0); @@ -642,7 +642,18 @@ void MarginsDlg::initScintParam() ::SendDlgItemMessage(_hSelf, IDC_CHECK_NOEDGE, BM_SETCHECK, !svp._showBorderEdge, 0); - ::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, svp._isEdgeBgMode, 0); + bool canBeBg = svp._edgeMultiColumnPos.size() == 1; + if (!canBeBg) + { + svp._isEdgeBgMode = false; + ::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, FALSE, 0); + ::EnableWindow(::GetDlgItem(_hSelf, IDC_CHECK_EDGEBGMODE), FALSE); + } + else + { + ::SendDlgItemMessage(_hSelf, IDC_CHECK_EDGEBGMODE, BM_SETCHECK, svp._isEdgeBgMode, 0); + } + generic_string edgeColumnPosStr; for (auto i : svp._edgeMultiColumnPos) @@ -721,7 +732,7 @@ INT_PTR CALLBACK MarginsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPa case WM_COMMAND : { - ScintillaViewParams & svp = (ScintillaViewParams &)nppParam.getSVP(); + ScintillaViewParams & svp = const_cast(nppParam.getSVP()); switch (wParam) { case IDC_CHECK_SMOOTHFONT: