From 28f11ad5f1c8e4a5748891a1f78ad3291915ce95 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Sun, 9 May 2010 13:12:21 +0000 Subject: [PATCH] [CONSOLE] - Store console changes when screen buffer / window size changes - Mark property sheet as changed when color control changes svn path=/trunk/; revision=47144 --- reactos/dll/cpl/console/colors.c | 1 + reactos/dll/cpl/console/layout.c | 46 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/reactos/dll/cpl/console/colors.c b/reactos/dll/cpl/console/colors.c index f7dde527868..d312fadda0b 100644 --- a/reactos/dll/cpl/console/colors.c +++ b/reactos/dll/cpl/console/colors.c @@ -231,6 +231,7 @@ ColorsProc( InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE); InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE); pConInfo->ActiveStaticControl = index; + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); break; } } diff --git a/reactos/dll/cpl/console/layout.c b/reactos/dll/cpl/console/layout.c index 592ba610168..cca60ca92eb 100644 --- a/reactos/dll/cpl/console/layout.c +++ b/reactos/dll/cpl/console/layout.c @@ -294,6 +294,52 @@ LayoutProc( { switch(LOWORD(wParam)) { + case IDC_EDIT_SCREEN_BUFFER_WIDTH: + case IDC_EDIT_SCREEN_BUFFER_HEIGHT: + case IDC_EDIT_WINDOW_SIZE_WIDTH: + case IDC_UPDOWN_WINDOW_SIZE_HEIGHT: + case IDC_EDIT_WINDOW_POS_LEFT: + case IDC_EDIT_WINDOW_POS_TOP: + { + if (HIWORD(wParam) == EN_KILLFOCUS) + { + DWORD wheight, wwidth; + DWORD sheight, swidth; + DWORD left, top; + + wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, NULL, FALSE); + wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, NULL, FALSE); + swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE); + sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE); + left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE); + top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE); + + swidth = max(swidth, 1); + sheight = max(sheight, 1); + + /* automatically adjust window size when screen buffer decreases */ + if (wwidth > swidth) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE); + wwidth = swidth; + } + + if (wheight > sheight) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE); + wheight = sheight; + } + + + pConInfo->ScreenBuffer = MAKELONG(swidth, sheight); + pConInfo->WindowSize = MAKELONG(wwidth, wheight); + pConInfo->WindowPosition = MAKELONG(left, top); + + PropSheet_Changed(GetParent(hwndDlg), hwndDlg); + } + break; + } + case IDC_CHECK_SYSTEM_POS_WINDOW: { LONG res = SendMessage((HWND)lParam, BM_GETCHECK, 0, 0); -- 2.17.1