[SHELL-EXPERIMENTS]
[reactos.git] / dll / cpl / console / layout.c
1 /*
2 * PROJECT: ReactOS Console Configuration DLL
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/console/layout.c
5 * PURPOSE: Layout dialog
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
7 * Hermes Belusca-Maito (hermes.belusca@sfr.fr)
8 */
9
10 #include "console.h"
11
12 #define NDEBUG
13 #include <debug.h>
14
15 const WCHAR szPreviewText[] =
16 L"C:\\ReactOS> dir \n" \
17 L"SYSTEM <DIR> 13-04-15 5:00a\n" \
18 L"SYSTEM32 <DIR> 13-04-15 5:00a\n" \
19 L"readme txt 1739 13-04-15 5:00a\n" \
20 L"explorer exe 3329536 13-04-15 5:00a\n" \
21 L"vgafonts cab 18736 13-04-15 5:00a\n" \
22 L"setuplog txt 313 13-04-15 5:00a\n" \
23 L"win ini 7005 13-04-15 5:00a\n" ;
24
25
26 VOID
27 PaintConsole(LPDRAWITEMSTRUCT drawItem,
28 PCONSOLE_PROPS pConInfo)
29 {
30 PGUI_CONSOLE_INFO GuiInfo = pConInfo->TerminalInfo.TermInfo;
31 HBRUSH hBrush;
32 RECT cRect, fRect;
33 DWORD startx, starty;
34 DWORD endx, endy;
35 DWORD sizex, sizey;
36
37 FillRect(drawItem->hDC, &drawItem->rcItem, GetSysColorBrush(COLOR_BACKGROUND));
38
39 // FIXME: Use: SM_CXSIZE, SM_CYSIZE, SM_CXVSCROLL, SM_CYHSCROLL, SM_CXMIN, SM_CYMIN, SM_CXFRAME, SM_CYFRAME
40 /* Use it for scaling */
41 sizex = drawItem->rcItem.right - drawItem->rcItem.left;
42 sizey = drawItem->rcItem.bottom - drawItem->rcItem.top ;
43
44 if ( GuiInfo->WindowOrigin.x == MAXDWORD &&
45 GuiInfo->WindowOrigin.y == MAXDWORD )
46 {
47 startx = sizex / 3;
48 starty = sizey / 3;
49 }
50 else
51 {
52 // TODO:
53 // Calculate pos correctly when console centered
54 startx = GuiInfo->WindowOrigin.x;
55 starty = GuiInfo->WindowOrigin.y;
56 }
57
58 // TODO:
59 // Stretch console when bold fonts are selected
60 endx = startx + pConInfo->ci.ConsoleSize.X; // drawItem->rcItem.right - startx + 15;
61 endy = starty + pConInfo->ci.ConsoleSize.Y; // starty + sizey / 3;
62
63 /* Draw console size */
64 SetRect(&cRect, startx, starty, endx, endy);
65 FillRect(drawItem->hDC, &cRect, GetSysColorBrush(COLOR_WINDOWFRAME));
66
67 /* Draw console border */
68 SetRect(&fRect, startx + 1, starty + 1, cRect.right - 1, cRect.bottom - 1);
69 FrameRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_ACTIVEBORDER));
70
71 /* Draw left box */
72 SetRect(&fRect, startx + 3, starty + 3, startx + 5, starty + 5);
73 FillRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_ACTIVEBORDER));
74
75 /* Draw window title */
76 SetRect(&fRect, startx + 7, starty + 3, cRect.right - 9, starty + 5);
77 FillRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_ACTIVECAPTION));
78
79 /* Draw first right box */
80 SetRect(&fRect, fRect.right + 1, starty + 3, fRect.right + 3, starty + 5);
81 FillRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_ACTIVEBORDER));
82
83 /* Draw second right box */
84 SetRect(&fRect, fRect.right + 1, starty + 3, fRect.right + 3, starty + 5);
85 FillRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_ACTIVEBORDER));
86
87 /* Draw scrollbar */
88 SetRect(&fRect, cRect.right - 5, fRect.bottom + 1, cRect.right - 3, cRect.bottom - 3);
89 FillRect(drawItem->hDC, &fRect, GetSysColorBrush(COLOR_SCROLLBAR));
90
91 /* Draw console background */
92 hBrush = CreateSolidBrush(pConInfo->ci.Colors[BkgdAttribFromAttrib(pConInfo->ci.ScreenAttrib)]);
93 SetRect(&fRect, startx + 3, starty + 6, cRect.right - 6, cRect.bottom - 3);
94 FillRect(drawItem->hDC, &fRect, hBrush);
95 DeleteObject((HGDIOBJ)hBrush);
96 }
97
98 BOOL
99 PaintText(LPDRAWITEMSTRUCT drawItem,
100 PCONSOLE_PROPS pConInfo,
101 TEXT_TYPE TextMode)
102 {
103 PGUI_CONSOLE_INFO GuiInfo = pConInfo->TerminalInfo.TermInfo;
104 USHORT CurrentAttrib;
105 COLORREF pbkColor, ptColor;
106 COLORREF nbkColor, ntColor;
107 HBRUSH hBrush;
108 HFONT Font, OldFont;
109
110 COORD FontSize = GuiInfo->FontSize;
111
112 if (TextMode == Screen)
113 CurrentAttrib = pConInfo->ci.ScreenAttrib;
114 else if (TextMode == Popup)
115 CurrentAttrib = pConInfo->ci.PopupAttrib;
116 else
117 return FALSE;
118
119 nbkColor = pConInfo->ci.Colors[BkgdAttribFromAttrib(CurrentAttrib)];
120 ntColor = pConInfo->ci.Colors[TextAttribFromAttrib(CurrentAttrib)];
121
122 hBrush = CreateSolidBrush(nbkColor);
123 if (!hBrush) return FALSE;
124
125 FontSize.Y = FontSize.Y > 0 ? -MulDiv(FontSize.Y, GetDeviceCaps(drawItem->hDC, LOGPIXELSY), 72)
126 : FontSize.Y;
127
128 Font = CreateFontW(FontSize.Y,
129 FontSize.X,
130 0,
131 TA_BASELINE,
132 GuiInfo->FontWeight,
133 FALSE,
134 FALSE,
135 FALSE,
136 OEM_CHARSET,
137 OUT_DEFAULT_PRECIS,
138 CLIP_DEFAULT_PRECIS,
139 DEFAULT_QUALITY,
140 FIXED_PITCH | GuiInfo->FontFamily,
141 GuiInfo->FaceName);
142 if (Font == NULL)
143 {
144 DPRINT1("PaintText: CreateFont failed\n");
145 return FALSE;
146 }
147
148 OldFont = SelectObject(drawItem->hDC, Font);
149 if (OldFont == NULL)
150 {
151 DeleteObject(Font);
152 return FALSE;
153 }
154
155 FillRect(drawItem->hDC, &drawItem->rcItem, hBrush);
156
157 ptColor = SetTextColor(drawItem->hDC, ntColor);
158 pbkColor = SetBkColor(drawItem->hDC, nbkColor);
159 DrawTextW(drawItem->hDC, szPreviewText, wcslen(szPreviewText), &drawItem->rcItem, 0);
160 SetTextColor(drawItem->hDC, ptColor);
161 SetBkColor(drawItem->hDC, pbkColor);
162 DeleteObject(hBrush);
163
164 SelectObject(drawItem->hDC, OldFont);
165 DeleteObject(Font);
166
167 return TRUE;
168 }
169
170 INT_PTR
171 CALLBACK
172 LayoutProc(HWND hwndDlg,
173 UINT uMsg,
174 WPARAM wParam,
175 LPARAM lParam)
176 {
177 PCONSOLE_PROPS pConInfo = (PCONSOLE_PROPS)GetWindowLongPtr(hwndDlg, DWLP_USER);
178 PGUI_CONSOLE_INFO GuiInfo = (pConInfo ? pConInfo->TerminalInfo.TermInfo : NULL);
179
180 UNREFERENCED_PARAMETER(hwndDlg);
181 UNREFERENCED_PARAMETER(wParam);
182
183 switch (uMsg)
184 {
185 case WM_INITDIALOG:
186 {
187 /* Multi-monitor support */
188 LONG xVirtScr, yVirtScr; // Coordinates of the top-left virtual screen
189 LONG cxVirtScr, cyVirtScr; // Width and Height of the virtual screen
190 LONG cxFrame , cyFrame ; // Thickness of the window frame
191
192 pConInfo = (PCONSOLE_PROPS)((LPPROPSHEETPAGE)lParam)->lParam;
193 GuiInfo = pConInfo->TerminalInfo.TermInfo;
194 SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pConInfo);
195
196 /* Multi-monitor support */
197 xVirtScr = GetSystemMetrics(SM_XVIRTUALSCREEN);
198 yVirtScr = GetSystemMetrics(SM_YVIRTUALSCREEN);
199 cxVirtScr = GetSystemMetrics(SM_CXVIRTUALSCREEN);
200 cyVirtScr = GetSystemMetrics(SM_CYVIRTUALSCREEN);
201 cxFrame = GetSystemMetrics(SM_CXFRAME);
202 cyFrame = GetSystemMetrics(SM_CYFRAME);
203
204 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_HEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1));
205 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_SCREEN_BUFFER_WIDTH , UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1));
206 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_HEIGHT, UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1));
207 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_SIZE_WIDTH , UDM_SETRANGE, 0, (LPARAM)MAKELONG(9999, 1));
208
209 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, pConInfo->ci.ScreenBufferSize.Y, FALSE);
210 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH , pConInfo->ci.ScreenBufferSize.X, FALSE);
211 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, pConInfo->ci.ConsoleSize.Y, FALSE);
212 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , pConInfo->ci.ConsoleSize.X, FALSE);
213
214 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, UDM_SETRANGE, 0,
215 (LPARAM)MAKELONG(xVirtScr + cxVirtScr - cxFrame, xVirtScr - cxFrame));
216 SendDlgItemMessageW(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , UDM_SETRANGE, 0,
217 (LPARAM)MAKELONG(yVirtScr + cyVirtScr - cyFrame, yVirtScr - cyFrame));
218
219 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, GuiInfo->WindowOrigin.x, TRUE);
220 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , GuiInfo->WindowOrigin.y, TRUE);
221
222 if (GuiInfo->AutoPosition)
223 {
224 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE);
225 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE);
226 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE);
227 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE);
228 }
229 CheckDlgButton(hwndDlg, IDC_CHECK_SYSTEM_POS_WINDOW,
230 GuiInfo->AutoPosition ? BST_CHECKED : BST_UNCHECKED);
231
232 return TRUE;
233 }
234
235 case WM_DRAWITEM:
236 {
237 PaintConsole((LPDRAWITEMSTRUCT)lParam, pConInfo);
238 return TRUE;
239 }
240
241 case WM_NOTIFY:
242 {
243 LPNMUPDOWN lpnmud = (LPNMUPDOWN)lParam;
244 LPPSHNOTIFY lppsn = (LPPSHNOTIFY)lParam;
245
246 if (lppsn->hdr.code == UDN_DELTAPOS)
247 {
248 DWORD wheight, wwidth;
249 DWORD sheight, swidth;
250 DWORD left, top;
251
252 if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_WIDTH)
253 {
254 wwidth = lpnmud->iPos + lpnmud->iDelta;
255 }
256 else
257 {
258 wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, NULL, FALSE);
259 }
260
261 if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_HEIGHT)
262 {
263 wheight = lpnmud->iPos + lpnmud->iDelta;
264 }
265 else
266 {
267 wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, NULL, FALSE);
268 }
269
270 if (lppsn->hdr.idFrom == IDC_UPDOWN_SCREEN_BUFFER_WIDTH)
271 {
272 swidth = lpnmud->iPos + lpnmud->iDelta;
273 }
274 else
275 {
276 swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE);
277 }
278
279 if (lppsn->hdr.idFrom == IDC_UPDOWN_SCREEN_BUFFER_HEIGHT)
280 {
281 sheight = lpnmud->iPos + lpnmud->iDelta;
282 }
283 else
284 {
285 sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE);
286 }
287
288 if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_POS_LEFT)
289 {
290 left = lpnmud->iPos + lpnmud->iDelta;
291 }
292 else
293 {
294 left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE);
295 }
296
297 if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_POS_TOP)
298 {
299 top = lpnmud->iPos + lpnmud->iDelta;
300 }
301 else
302 {
303 top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP, NULL, TRUE);
304 }
305
306 if (lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_WIDTH || lppsn->hdr.idFrom == IDC_UPDOWN_WINDOW_SIZE_HEIGHT)
307 {
308 /* Automatically adjust screen buffer size when window size enlarges */
309 if (wwidth >= swidth)
310 {
311 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, wwidth, TRUE);
312 swidth = wwidth;
313 }
314 if (wheight >= sheight)
315 {
316 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, wheight, TRUE);
317 sheight = wheight;
318 }
319 }
320
321 /* Be sure that the (new) screen buffer sizes are in the correct range */
322 swidth = min(max(swidth , 1), 0xFFFF);
323 sheight = min(max(sheight, 1), 0xFFFF);
324
325 if (lppsn->hdr.idFrom == IDC_UPDOWN_SCREEN_BUFFER_WIDTH || lppsn->hdr.idFrom == IDC_UPDOWN_SCREEN_BUFFER_HEIGHT)
326 {
327 /* Automatically adjust window size when screen buffer decreases */
328 if (wwidth > swidth)
329 {
330 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, swidth, TRUE);
331 wwidth = swidth;
332 }
333 if (wheight > sheight)
334 {
335 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, sheight, TRUE);
336 wheight = sheight;
337 }
338 }
339
340 pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth;
341 pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight;
342 pConInfo->ci.ConsoleSize.X = (SHORT)wwidth;
343 pConInfo->ci.ConsoleSize.Y = (SHORT)wheight;
344 GuiInfo->WindowOrigin.x = left;
345 GuiInfo->WindowOrigin.y = top;
346 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
347 }
348 break;
349 }
350
351 case WM_COMMAND:
352 {
353 switch (LOWORD(wParam))
354 {
355 case IDC_EDIT_SCREEN_BUFFER_WIDTH:
356 {
357 if (HIWORD(wParam) == EN_KILLFOCUS)
358 {
359 DWORD swidth, wwidth;
360
361 swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE);
362 wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE);
363
364 /* Be sure that the (new) screen buffer width is in the correct range */
365 swidth = min(max(swidth, 1), 0xFFFF);
366
367 /* Automatically adjust window size when screen buffer decreases */
368 if (wwidth > swidth)
369 {
370 wwidth = swidth;
371 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH, wwidth, TRUE);
372 }
373
374 pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth;
375 pConInfo->ci.ConsoleSize.X = (SHORT)wwidth;
376 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
377 }
378 break;
379 }
380
381 case IDC_EDIT_WINDOW_SIZE_WIDTH:
382 {
383 if (HIWORD(wParam) == EN_KILLFOCUS)
384 {
385 DWORD swidth, wwidth;
386
387 swidth = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, NULL, FALSE);
388 wwidth = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_WIDTH , NULL, FALSE);
389
390 /* Automatically adjust screen buffer size when window size enlarges */
391 if (wwidth >= swidth)
392 {
393 swidth = wwidth;
394
395 /* Be sure that the (new) screen buffer width is in the correct range */
396 swidth = min(max(swidth, 1), 0xFFFF);
397
398 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_WIDTH, swidth, TRUE);
399 }
400
401 pConInfo->ci.ScreenBufferSize.X = (SHORT)swidth;
402 pConInfo->ci.ConsoleSize.X = (SHORT)wwidth;
403 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
404 }
405 break;
406 }
407
408 case IDC_EDIT_SCREEN_BUFFER_HEIGHT:
409 {
410 if (HIWORD(wParam) == EN_KILLFOCUS)
411 {
412 DWORD sheight, wheight;
413
414 sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE);
415 wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE);
416
417 /* Be sure that the (new) screen buffer width is in the correct range */
418 sheight = min(max(sheight, 1), 0xFFFF);
419
420 /* Automatically adjust window size when screen buffer decreases */
421 if (wheight > sheight)
422 {
423 wheight = sheight;
424 SetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT, wheight, TRUE);
425 }
426
427 pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight;
428 pConInfo->ci.ConsoleSize.Y = (SHORT)wheight;
429 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
430 }
431 break;
432 }
433
434 case IDC_EDIT_WINDOW_SIZE_HEIGHT:
435 {
436 if (HIWORD(wParam) == EN_KILLFOCUS)
437 {
438 DWORD sheight, wheight;
439
440 sheight = GetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, NULL, FALSE);
441 wheight = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_SIZE_HEIGHT , NULL, FALSE);
442
443 /* Automatically adjust screen buffer size when window size enlarges */
444 if (wheight >= sheight)
445 {
446 sheight = wheight;
447
448 /* Be sure that the (new) screen buffer width is in the correct range */
449 sheight = min(max(sheight, 1), 0xFFFF);
450
451 SetDlgItemInt(hwndDlg, IDC_EDIT_SCREEN_BUFFER_HEIGHT, sheight, TRUE);
452 }
453
454 pConInfo->ci.ScreenBufferSize.Y = (SHORT)sheight;
455 pConInfo->ci.ConsoleSize.Y = (SHORT)wheight;
456 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
457 }
458 break;
459 }
460
461 case IDC_EDIT_WINDOW_POS_LEFT:
462 case IDC_EDIT_WINDOW_POS_TOP:
463 {
464 if (HIWORD(wParam) == EN_KILLFOCUS)
465 {
466 DWORD left, top;
467
468 left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE);
469 top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE);
470
471 GuiInfo->WindowOrigin.x = left;
472 GuiInfo->WindowOrigin.y = top;
473 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
474 }
475 break;
476 }
477
478 case IDC_CHECK_SYSTEM_POS_WINDOW:
479 {
480 LONG res = SendMessage((HWND)lParam, BM_GETCHECK, 0, 0);
481 if (res == BST_CHECKED)
482 {
483 ULONG left, top;
484
485 left = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, NULL, TRUE);
486 top = GetDlgItemInt(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , NULL, TRUE);
487
488 GuiInfo->AutoPosition = FALSE;
489 GuiInfo->WindowOrigin.x = left;
490 GuiInfo->WindowOrigin.y = top;
491 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
492
493 SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_UNCHECKED, 0);
494 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, TRUE);
495 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , TRUE);
496 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, TRUE);
497 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , TRUE);
498 }
499 else if (res == BST_UNCHECKED)
500 {
501 GuiInfo->AutoPosition = TRUE;
502 // Do not touch GuiInfo->WindowOrigin !!
503 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
504
505 SendMessage((HWND)lParam, BM_SETCHECK, (WPARAM)BST_CHECKED, 0);
506 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_LEFT, FALSE);
507 EnableDlgItem(hwndDlg, IDC_EDIT_WINDOW_POS_TOP , FALSE);
508 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_LEFT, FALSE);
509 EnableDlgItem(hwndDlg, IDC_UPDOWN_WINDOW_POS_TOP , FALSE);
510 }
511 }
512 }
513 }
514
515 default:
516 break;
517 }
518
519 return FALSE;
520 }