[ros-diffs] [janderwald] 47144: [CONSOLE] - Store console changes when screen buffer / window size changes - Mark property sheet as changed when color control changes

janderwald at svn.reactos.org janderwald at svn.reactos.org
Sun May 9 15:12:21 CEST 2010


Author: janderwald
Date: Sun May  9 15:12:21 2010
New Revision: 47144

URL: http://svn.reactos.org/svn/reactos?rev=47144&view=rev
Log:
[CONSOLE]
- Store console changes when screen buffer / window size changes
- Mark property sheet as changed when color control changes

Modified:
    trunk/reactos/dll/cpl/console/colors.c
    trunk/reactos/dll/cpl/console/layout.c

Modified: trunk/reactos/dll/cpl/console/colors.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/colors.c?rev=47144&r1=47143&r2=47144&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/colors.c [iso-8859-1] Sun May  9 15:12:21 2010
@@ -231,6 +231,7 @@
 				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;
 			}
 		}

Modified: trunk/reactos/dll/cpl/console/layout.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/console/layout.c?rev=47144&r1=47143&r2=47144&view=diff
==============================================================================
--- trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/console/layout.c [iso-8859-1] Sun May  9 15:12:21 2010
@@ -294,6 +294,52 @@
 		{
 			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);




More information about the Ros-diffs mailing list