[CONSOLE]
authorJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 9 May 2010 13:12:21 +0000 (13:12 +0000)
committerJohannes Anderwald <johannes.anderwald@reactos.org>
Sun, 9 May 2010 13:12:21 +0000 (13:12 +0000)
- 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
reactos/dll/cpl/console/layout.c

index f7dde52..d312fad 100644 (file)
@@ -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;
                        }
                }
index 592ba61..cca60ca 100644 (file)
@@ -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);