void CSetPgSizePos::EnablePosSizeControls(HWND hDlg) { enableDlgItem(hDlg, tWndX, !gpConEmu->mp_Inside && !(gpSet->isQuakeStyle && gpSet->wndCascade)); enableDlgItem(hDlg, tWndY, !(gpSet->isQuakeStyle || gpConEmu->mp_Inside)); enableDlgItem(hDlg, tWndWidth, !gpConEmu->mp_Inside); enableDlgItem(hDlg, tWndHeight, !gpConEmu->mp_Inside); }
LRESULT CSetPgMarkCopy::OnInitDialog(HWND hDlg, bool abInitial) { checkDlgButton(hDlg, cbCTSIntelligent, gpSet->isCTSIntelligent); wchar_t* pszExcept = gpSet->GetIntelligentExceptions(); SetDlgItemText(hDlg, tCTSIntelligentExceptions, pszExcept ? pszExcept : L""); SafeFree(pszExcept); checkDlgButton(hDlg, cbCTSAutoCopy, gpSet->isCTSAutoCopy); checkDlgButton(hDlg, cbCTSResetOnRelease, (gpSet->isCTSResetOnRelease && gpSet->isCTSAutoCopy)); enableDlgItem(hDlg, cbCTSResetOnRelease, gpSet->isCTSAutoCopy); checkDlgButton(hDlg, cbCTSIBeam, gpSet->isCTSIBeam); checkDlgButton(hDlg, cbCTSEndOnTyping, (gpSet->isCTSEndOnTyping != 0)); checkDlgButton(hDlg, cbCTSEndOnKeyPress, (gpSet->isCTSEndOnTyping != 0) && gpSet->isCTSEndOnKeyPress); checkDlgButton(hDlg, cbCTSEndCopyBefore, (gpSet->isCTSEndOnTyping == 1)); checkDlgButton(hDlg, cbCTSEraseBeforeReset, gpSet->isCTSEraseBeforeReset); enableDlgItem(hDlg, cbCTSEndOnKeyPress, gpSet->isCTSEndOnTyping!=0); enableDlgItem(hDlg, cbCTSEndCopyBefore, gpSet->isCTSEndOnTyping!=0); enableDlgItem(hDlg, cbCTSEraseBeforeReset, gpSet->isCTSEndOnTyping!=0); checkDlgButton(hDlg, cbCTSFreezeBeforeSelect, gpSet->isCTSFreezeBeforeSelect); checkDlgButton(hDlg, cbCTSBlockSelection, gpSet->isCTSSelectBlock); UINT VkMod = gpSet->GetHotkeyById(vkCTSVkBlock); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCTSBlockSelection), CSetDlgLists::eKeysAct, VkMod, true); checkDlgButton(hDlg, cbCTSTextSelection, gpSet->isCTSSelectText); VkMod = gpSet->GetHotkeyById(vkCTSVkText); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCTSTextSelection), CSetDlgLists::eKeysAct, VkMod, true); VkMod = gpSet->GetHotkeyById(vkCTSVkAct); UINT idxBack = CONBACKCOLOR(gpSet->isCTSColorIndex); UINT idxFore = CONFORECOLOR(gpSet->isCTSColorIndex); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCTSForeIdx), CSetDlgLists::eColorIdx16, idxFore, false); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCTSBackIdx), CSetDlgLists::eColorIdx16, idxBack, false); if (abInitial) { mf_MarkCopyPreviewProc = (WNDPROC)SetWindowLongPtr(GetDlgItem(hDlg, stCTSPreview), GWLP_WNDPROC, (LONG_PTR)MarkCopyPreviewProc); } checkDlgButton(hDlg, cbCTSDetectLineEnd, gpSet->AppStd.isCTSDetectLineEnd); checkDlgButton(hDlg, cbCTSBashMargin, gpSet->AppStd.isCTSBashMargin); checkDlgButton(hDlg, cbCTSTrimTrailing, gpSet->AppStd.isCTSTrimTrailing); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCTSEOL), CSetDlgLists::eCRLF, gpSet->AppStd.isCTSEOL, false); checkDlgButton(hDlg, cbCTSShiftArrowStartSel, gpSet->AppStd.isCTSShiftArrowStart); CSetDlgLists::FillListBoxItems(GetDlgItem(hDlg, lbCopyFormat), CSetDlgLists::eCopyFormat, gpSet->isCTSHtmlFormat, false); gpSetCls->CheckSelectionModifiers(hDlg); return 0; }
LRESULT CSetPgTaskbar::OnInitDialog(HWND hDlg, bool abInitial) { checkDlgButton(hDlg, cbMinToTray, gpSet->mb_MinToTray); EnableWindow(GetDlgItem(hDlg, cbMinToTray), !gpConEmu->ForceMinimizeToTray); checkDlgButton(hDlg, cbAlwaysShowTrayIcon, gpSet->isAlwaysShowTrayIcon()); Settings::TabsOnTaskbar tabsOnTaskbar = gpSet->GetRawTabsOnTaskBar(); checkRadioButton(hDlg, rbTaskbarBtnActive, rbTaskbarBtnHidden, (tabsOnTaskbar == Settings::tot_DontShow) ? rbTaskbarBtnHidden : (tabsOnTaskbar == Settings::tot_AllTabsWin7) ? rbTaskbarBtnWin7 : (tabsOnTaskbar == Settings::tot_AllTabsAllOS) ? rbTaskbarBtnAll : rbTaskbarBtnActive); checkDlgButton(hDlg, cbTaskbarOverlay, gpSet->isTaskbarOverlay); checkDlgButton(hDlg, cbTaskbarProgress, gpSet->isTaskbarProgress); // checkDlgButton(hDlg, cbCloseConEmuWithLastTab, gpSet->isCloseOnLastTabClose() ? BST_CHECKED : BST_UNCHECKED); checkDlgButton(hDlg, cbCloseConEmuOnCrossClicking, gpSet->isCloseOnCrossClick() ? BST_CHECKED : BST_UNCHECKED); checkDlgButton(hDlg, cbMinimizeOnLastTabClose, gpSet->isMinOnLastTabClose() ? BST_CHECKED : BST_UNCHECKED); checkDlgButton(hDlg, cbHideOnLastTabClose, gpSet->isHideOnLastTabClose() ? BST_CHECKED : BST_UNCHECKED); // enableDlgItem(hDlg, cbCloseConEmuOnCrossClicking, !gpSet->isCloseOnLastTabClose()); enableDlgItem(hDlg, cbMinimizeOnLastTabClose, !gpSet->isCloseOnLastTabClose()); enableDlgItem(hDlg, cbHideOnLastTabClose, !gpSet->isCloseOnLastTabClose() && gpSet->isMinOnLastTabClose()); checkDlgButton(hDlg, cbMinimizeOnLoseFocus, gpSet->mb_MinimizeOnLoseFocus); EnableWindow(GetDlgItem(hDlg, cbMinimizeOnLoseFocus), (gpSet->isQuakeStyle == 0)); checkRadioButton(hDlg, rbMinByEscAlways, rbMinByEscNever, (gpSet->isMultiMinByEsc == Settings::mbe_NoConsoles) ? rbMinByEscEmpty : gpSet->isMultiMinByEsc ? rbMinByEscAlways : rbMinByEscNever); checkDlgButton(hDlg, cbMapShiftEscToEsc, gpSet->isMapShiftEscToEsc); EnableWindow(GetDlgItem(hDlg, cbMapShiftEscToEsc), (gpSet->isMultiMinByEsc == Settings::mbe_Always)); checkDlgButton(hDlg, cbCmdTaskbarTasks, gpSet->isStoreTaskbarkTasks); checkDlgButton(hDlg, cbCmdTaskbarCommands, gpSet->isStoreTaskbarCommands); EnableWindow(GetDlgItem(hDlg, cbCmdTaskbarUpdate), (gnOsVer >= 0x601)); return 0; }
INT_PTR CSetPgFonts::OnComboBox(HWND hDlg, WORD nCtrlId, WORD code) { switch (nCtrlId) { case tFontCharset: gpSet->mb_CharSetWasSet = TRUE; PostMessage(hDlg, gpSetCls->mn_MsgRecreateFont, nCtrlId, 0); break; case tFontFace: case tFontFace2: case tFontSizeY: case tFontSizeX: case tFontSizeX2: case tFontSizeX3: if (code == CBN_SELCHANGE) PostMessage(hDlg, gpSetCls->mn_MsgRecreateFont, nCtrlId, 0); else gpSetCls->mn_LastChangingFontCtrlId = nCtrlId; break; case tUnicodeRanges: // Do not required actually, the button "Apply" is enabled by default enableDlgItem(hDlg, cbUnicodeRangesApply, true); if (code == CBN_SELCHANGE) PostMessage(hDlg, WM_COMMAND, cbUnicodeRangesApply, 0); break; case lbExtendFontNormalIdx: case lbExtendFontBoldIdx: case lbExtendFontItalicIdx: { if (nCtrlId == lbExtendFontNormalIdx) gpSet->AppStd.nFontNormalColor = GetNumber(hDlg, nCtrlId); else if (nCtrlId == lbExtendFontBoldIdx) gpSet->AppStd.nFontBoldColor = GetNumber(hDlg, nCtrlId); else if (nCtrlId == lbExtendFontItalicIdx) gpSet->AppStd.nFontItalicColor = GetNumber(hDlg, nCtrlId); if (gpSet->AppStd.isExtendFonts) gpConEmu->Update(true); break; } default: _ASSERTE(FALSE && "ListBox was not processed"); } return 0; }
LRESULT CSetPgUpdate::OnInitDialog(HWND hDlg, bool abInitial) { ConEmuUpdateSettings* p = &gpSet->UpdSet; SetDlgItemText(hDlg, tUpdateVerLocation, p->UpdateVerLocation()); checkDlgButton(hDlg, cbUpdateCheckOnStartup, p->isUpdateCheckOnStartup); checkDlgButton(hDlg, cbUpdateCheckHourly, p->isUpdateCheckHourly); checkDlgButton(hDlg, cbUpdateConfirmDownload, !p->isUpdateConfirmDownload); checkRadioButton(hDlg, rbUpdateStableOnly, rbUpdateLatestAvailable, (p->isUpdateUseBuilds==1) ? rbUpdateStableOnly : (p->isUpdateUseBuilds==3) ? rbUpdatePreview : rbUpdateLatestAvailable); checkDlgButton(hDlg, cbUpdateInetTool, p->isUpdateInetTool); SetDlgItemText(hDlg, tUpdateInetTool, p->GetUpdateInetToolCmd()); checkDlgButton(hDlg, cbUpdateUseProxy, p->isUpdateUseProxy); SetDlgItemText(hDlg, tUpdateProxy, p->szUpdateProxy); SetDlgItemText(hDlg, tUpdateProxyUser, p->szUpdateProxyUser); SetDlgItemText(hDlg, tUpdateProxyPassword, p->szUpdateProxyPassword); OnButtonClicked(hDlg, NULL, cbUpdateInetTool); // Enable/Disable command field, button '...' and ‘Proxy’ fields int nPackage = p->UpdateDownloadSetup(); // 1-exe, 2-7zip checkRadioButton(hDlg, rbUpdateUseExe, rbUpdateUseArc, (nPackage==1) ? rbUpdateUseExe : rbUpdateUseArc); wchar_t szCPU[4] = L""; SetDlgItemText(hDlg, tUpdateExeCmdLine, p->UpdateExeCmdLine(szCPU)); SetDlgItemText(hDlg, tUpdateArcCmdLine, p->UpdateArcCmdLine()); SetDlgItemText(hDlg, tUpdatePostUpdateCmd, p->szUpdatePostUpdateCmd); enableDlgItem(hDlg, (nPackage==1) ? tUpdateArcCmdLine : tUpdateExeCmdLine, FALSE); // Show used or preferred installer bitness CEStr szFormat, szTitle; INT_PTR iLen; if ((iLen = GetString(hDlg, rbUpdateUseExe, &szFormat.ms_Val)) > 0) { if (wcsstr(szFormat.ms_Val, L"%s") != NULL) { wchar_t* psz = szTitle.GetBuffer(iLen+4); if (psz) { _wsprintf(psz, SKIPLEN(iLen+4) szFormat.ms_Val, (nPackage == 1) ? szCPU : WIN3264TEST(L"x86",L"x64")); SetDlgItemText(hDlg, rbUpdateUseExe, szTitle); } } } checkDlgButton(hDlg, cbUpdateLeavePackages, p->isUpdateLeavePackages); SetDlgItemText(hDlg, tUpdateDownloadPath, p->szUpdateDownloadPath); return 0; }
// cbClipConfirmLimit void CSetPgPaste::OnBtn_ClipConfirmLimit(HWND hDlg, WORD CB, BYTE uCheck) { _ASSERTE(CB==cbClipConfirmLimit); if (uCheck) { gpSet->nPasteConfirmLonger = gpSet->nPasteConfirmLonger ? gpSet->nPasteConfirmLonger : 200; } else { gpSet->nPasteConfirmLonger = 0; } SetDlgItemInt(hDlg, tClipConfirmLimit, gpSet->nPasteConfirmLonger, FALSE); enableDlgItem(hDlg, tClipConfirmLimit, (gpSet->nPasteConfirmLonger != 0)); } // cbClipConfirmLimit
LRESULT CSetPgAppear::OnInitDialog(HWND hDlg, bool abInitial) { checkDlgButton(hDlg, cbHideCaption, gpSet->isHideCaption); checkDlgButton(hDlg, cbHideCaptionAlways, gpSet->isHideCaptionAlways()); EnableWindow(GetDlgItem(hDlg, cbHideCaptionAlways), !gpSet->isForcedHideCaptionAlways()); // Скрытие рамки SetDlgItemInt(hDlg, tHideCaptionAlwaysFrame, gpSet->HideCaptionAlwaysFrame(), TRUE); SetDlgItemInt(hDlg, tHideCaptionAlwaysDelay, gpSet->nHideCaptionAlwaysDelay, FALSE); SetDlgItemInt(hDlg, tHideCaptionAlwaysDissapear, gpSet->nHideCaptionAlwaysDisappear, FALSE); checkDlgButton(hDlg, cbEnhanceGraphics, gpSet->isEnhanceGraphics); //checkDlgButton(hDlg, cbEnhanceButtons, gpSet->isEnhanceButtons); //checkDlgButton(hDlg, cbAlwaysShowScrollbar, gpSet->isAlwaysShowScrollbar); checkRadioButton(hDlg, rbScrollbarHide, rbScrollbarAuto, (gpSet->isAlwaysShowScrollbar==0) ? rbScrollbarHide : (gpSet->isAlwaysShowScrollbar==1) ? rbScrollbarShow : rbScrollbarAuto); SetDlgItemInt(hDlg, tScrollAppearDelay, gpSet->nScrollBarAppearDelay, FALSE); SetDlgItemInt(hDlg, tScrollDisappearDelay, gpSet->nScrollBarDisappearDelay, FALSE); checkDlgButton(hDlg, cbAlwaysOnTop, gpSet->isAlwaysOnTop); #ifdef _DEBUG checkDlgButton(hDlg, cbTabsInCaption, gpSet->isTabsInCaption); #else ShowWindow(GetDlgItem(hDlg, cbTabsInCaption), SW_HIDE); #endif checkDlgButton(hDlg, cbNumberInCaption, gpSet->isNumberInCaption); checkDlgButton(hDlg, cbMultiCon, gpSet->mb_isMulti); checkDlgButton(hDlg, cbMultiShowButtons, gpSet->isMultiShowButtons); checkDlgButton(hDlg, cbMultiShowSearch, gpSet->isMultiShowSearch); checkDlgButton(hDlg, cbSingleInstance, gpSetCls->IsSingleInstanceArg()); enableDlgItem(hDlg, cbSingleInstance, (gpSet->isQuakeStyle == 0)); checkDlgButton(hDlg, cbShowHelpTooltips, gpSet->isShowHelpTooltips); return 0; }
LRESULT CSetPgComspec::OnInitDialog(HWND hDlg, bool abInitial) { _ASSERTE((rbComspecAuto+cst_Explicit)==rbComspecExplicit && (rbComspecAuto+cst_Cmd)==rbComspecCmd && (rbComspecAuto+cst_EnvVar)==rbComspecEnvVar); checkRadioButton(hDlg, rbComspecAuto, rbComspecExplicit, rbComspecAuto+gpSet->ComSpec.csType); SetDlgItemText(hDlg, tComspecExplicit, gpSet->ComSpec.ComspecExplicit); SendDlgItemMessage(hDlg, tComspecExplicit, EM_SETLIMITTEXT, countof(gpSet->ComSpec.ComspecExplicit)-1, 0); _ASSERTE((rbComspec_OSbit+csb_SameApp)==rbComspec_AppBit && (rbComspec_OSbit+csb_x32)==rbComspec_x32); checkRadioButton(hDlg, rbComspec_OSbit, rbComspec_x32, rbComspec_OSbit+gpSet->ComSpec.csBits); checkDlgButton(hDlg, cbComspecUpdateEnv, gpSet->ComSpec.isUpdateEnv ? BST_CHECKED : BST_UNCHECKED); enableDlgItem(hDlg, cbComspecUpdateEnv, (gpSet->ComSpec.csType!=cst_EnvVar)); checkDlgButton(hDlg, cbComspecUncPaths, gpSet->ComSpec.isAllowUncPaths ? BST_CHECKED : BST_UNCHECKED); // Autorun (autoattach) with "cmd.exe" or "tcc.exe" ReloadAutorun(); return 0; }
void CSetPgApps::DoEnableControls(WORD nGroupCtrlId) { bool bAllowed = false; const AppSettings* pApp = NULL; int iCur = (int)SendDlgItemMessage(mh_Dlg, lbAppDistinct, LB_GETCURSEL, 0,0); if (iCur >= 0) pApp = gpSet->GetAppSettings(iCur); if (pApp && pApp->AppNames) { bAllowed = true; } for (size_t i = 0; i < countof(DistinctControls); i++) { if (nGroupCtrlId && (nGroupCtrlId != DistinctControls[i].nOverrideID)) continue; bool bEnabled = bAllowed ? (DistinctControls[i].nOverrideID ? isChecked2(mh_Child, DistinctControls[i].nOverrideID) : true) : FALSE; HWND hDlgCtrl = DistinctControls[i].nOverrideID ? mh_Child : mh_Dlg; if (DistinctControls[i].nOverrideID) { enableDlgItem(hDlgCtrl, DistinctControls[i].nOverrideID, bAllowed); if (!bAllowed) checkDlgButton(hDlgCtrl, DistinctControls[i].nOverrideID, BST_UNCHECKED); } _ASSERTE(DistinctControls[i].nCtrls[countof(DistinctControls[i].nCtrls)-1]==0 && "Overflow check of nCtrls[]") CSetDlgLists::EnableDlgItems(hDlgCtrl, DistinctControls[i].nCtrls, countof(DistinctControls[i].nCtrls), bEnabled); } InvalidateCtrl(mh_Child, FALSE); }
LRESULT CSetPgSizePos::OnEditChanged(HWND hDlg, WORD nCtrlId) { switch (nCtrlId) { case tWndX: case tWndY: if (isChecked(hDlg, rNormal) == BST_CHECKED) { wchar_t *pVal = GetDlgItemTextPtr(hDlg, nCtrlId); bool bValid = (pVal && isDigit(*pVal)); enableDlgItem(hDlg, cbApplyPos, bValid); SafeFree(pVal); } break; // case tWndX: case tWndY: case tWndWidth: case tWndHeight: if (isChecked(hDlg, rNormal) == BST_CHECKED) { CESize sz = {0}; wchar_t *pVal = GetDlgItemTextPtr(hDlg, nCtrlId); bool bValid = (pVal && sz.SetFromString(false, pVal)); enableDlgItem(hDlg, cbApplyPos, bValid); SafeFree(pVal); } break; // case tWndWidth: case tWndHeight: case tPadSize: { BOOL bPadOk = FALSE; UINT nNewPad = GetDlgItemInt(hDlg, nCtrlId, &bPadOk, FALSE); if (nNewPad >= CENTERCONSOLEPAD_MIN && nNewPad <= CENTERCONSOLEPAD_MAX) gpSet->nCenterConsolePad = nNewPad; else if (nNewPad > CENTERCONSOLEPAD_MAX) SetDlgItemInt(hDlg, nCtrlId, CENTERCONSOLEPAD_MAX, FALSE); // Если юзер ставит "бордюр" то нужно сразу включить опцию, чтобы он работал if (gpSet->nCenterConsolePad && !isChecked(hDlg, cbTryToCenter)) { gpSet->isTryToCenter = true; checkDlgButton(hDlg, cbTryToCenter, BST_CHECKED); } // Update window/console size if (gpSet->isTryToCenter) gpConEmu->OnSize(); break; } case tLongOutputHeight: { BOOL lbOk = FALSE; wchar_t szTemp[16]; UINT nNewVal = GetDlgItemInt(hDlg, nCtrlId, &lbOk, FALSE); if (lbOk) { if (nNewVal >= LONGOUTPUTHEIGHT_MIN && nNewVal <= LONGOUTPUTHEIGHT_MAX) gpSet->DefaultBufferHeight = nNewVal; else if (nNewVal > LONGOUTPUTHEIGHT_MAX) SetDlgItemInt(hDlg, nCtrlId, gpSet->DefaultBufferHeight, FALSE); } else { SetDlgItemText(hDlg, nCtrlId, _ltow(gpSet->DefaultBufferHeight, szTemp, 10)); } break; } //case tLongOutputHeight: default: _ASSERTE(FALSE && "EditBox was not processed"); } return 0; }