Skip to content

Commit 28f11ad

Browse files
committed
[CONSOLE]
- Store console changes when screen buffer / window size changes - Mark property sheet as changed when color control changes svn path=/trunk/; revision=47144
1 parent 786f5a1 commit 28f11ad

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

reactos/dll/cpl/console/colors.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ ColorsProc(
231231
InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_SCREEN_COLOR), NULL, TRUE);
232232
InvalidateRect(GetDlgItem(hwndDlg, IDC_STATIC_POPUP_COLOR), NULL, TRUE);
233233
pConInfo->ActiveStaticControl = index;
234+
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
234235
break;
235236
}
236237
}

reactos/dll/cpl/console/layout.c

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,52 @@ LayoutProc(
294294
{
295295
switch(LOWORD(wParam))
296296
{
297+
case IDC_EDIT_SCREEN_BUFFER_WIDTH:
298+
case IDC_EDIT_SCREEN_BUFFER_HEIGHT:
299+
case IDC_EDIT_WINDOW_SIZE_WIDTH:
300+
case IDC_UPDOWN_WINDOW_SIZE_HEIGHT:
301+
case IDC_EDIT_WINDOW_POS_LEFT:
302+
case IDC_EDIT_WINDOW_POS_TOP:
303+
{
304+
if (HIWORD(wParam) == EN_KILLFOCUS)
305+
{
306+
DWORD wheight, wwidth;
307+
DWORD sheight, swidth;
308+
DWORD left, top;
309+
310+
wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, NULL, FALSE);
311+
wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, NULL, FALSE);
312+
swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE);
313+
sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE);
314+
left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, FALSE);
315+
top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, FALSE);
316+
317+
swidth = max(swidth, 1);
318+
sheight = max(sheight, 1);
319+
320+
/* automatically adjust window size when screen buffer decreases */
321+
if (wwidth > swidth)
322+
{
323+
SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE);
324+
wwidth = swidth;
325+
}
326+
327+
if (wheight > sheight)
328+
{
329+
SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE);
330+
wheight = sheight;
331+
}
332+
333+
334+
pConInfo->ScreenBuffer = MAKELONG(swidth, sheight);
335+
pConInfo->WindowSize = MAKELONG(wwidth, wheight);
336+
pConInfo->WindowPosition = MAKELONG(left, top);
337+
338+
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
339+
}
340+
break;
341+
}
342+
297343
case IDC_CHECK_SYSTEM_POS_WINDOW:
298344
{
299345
LONG res = SendMessage((HWND)lParam, BM_GETCHECK, 0, 0);

0 commit comments

Comments
 (0)