Author: ekohl
Date: Mon Feb 19 19:12:38 2007
New Revision: 25844
URL:
http://svn.reactos.org/svn/reactos?rev=25844&view=rev
Log:
Enable the user to set the size of captions, caption buttons, menu bars and croll bars.
Modified:
trunk/reactos/dll/cpl/desk/advappdlg.c
trunk/reactos/dll/cpl/desk/preview.c
Modified: trunk/reactos/dll/cpl/desk/advappdlg.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/advappdlg.c?r…
==============================================================================
--- trunk/reactos/dll/cpl/desk/advappdlg.c (original)
+++ trunk/reactos/dll/cpl/desk/advappdlg.c Mon Feb 19 19:12:38 2007
@@ -11,6 +11,7 @@
#include "desk.h"
#include "appearance.h"
+#include "preview.h"
@@ -480,6 +481,35 @@
}
break;
+ case IDC_ADVAPPEARANCE_SIZE_E:
+ if (g && HIWORD(wParam) == EN_CHANGE)
+ {
+ int i = (int)LOWORD(SendDlgItemMessage(hwndDlg, IDC_ADVAPPEARANCE_SIZE_UD,
UDM_GETPOS,0,0L));
+
+ switch (g->CurrentElement)
+ {
+ case IDX_INACTIVE_CAPTION:
+ case IDX_ACTIVE_CAPTION:
+ case IDX_CAPTION_BUTTON:
+ SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETCYCAPTION, 0, i);
+ break;
+
+ case IDX_MENU:
+ SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETCYMENU, 0, i);
+ break;
+
+ case IDX_SCROLLBAR:
+ SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETCXSCROLLBAR, 0, i);
+ break;
+
+ case IDX_INACTIVE_BORDER:
+ case IDX_ACTIVE_BORDER:
+ SendDlgItemMessage(hwndDlg, IDC_APPEARANCE_PREVIEW, PVM_SETCYSIZEFRAME, 0, i);
+ break;
+ }
+ }
+ break;
+
case IDC_ADVAPPEARANCE_COLOR1_B:
GetColor(hwndDlg, g, 0);
break;
Modified: trunk/reactos/dll/cpl/desk/preview.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/preview.c?rev…
==============================================================================
--- trunk/reactos/dll/cpl/desk/preview.c (original)
+++ trunk/reactos/dll/cpl/desk/preview.c Mon Feb 19 19:12:38 2007
@@ -162,10 +162,10 @@
pPreviewData->clrWindowText = GetSysColor(COLOR_WINDOWTEXT);
pPreviewData->clrButtonText = GetSysColor(COLOR_BTNTEXT);
- pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE);
- pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE);
-
- pPreviewData->cySizeFrame = GetSystemMetrics(SM_CYSIZEFRAME);
+ pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE) - 2;
+ pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE) - 2;
+
+ pPreviewData->cySizeFrame = GetSystemMetrics(SM_CYSIZEFRAME) - 1;
pPreviewData->cyCaption = GetSystemMetrics(SM_CYCAPTION);
pPreviewData->cyMenu = GetSystemMetrics(SM_CYMENU);
@@ -216,10 +216,10 @@
pPreviewData->rcInactiveFrame.bottom = pPreviewData->rcDesktop.bottom - 30;
/* Calculate the inactive caption rectangle */
- pPreviewData->rcInactiveCaption.left = pPreviewData->rcInactiveFrame.left +
pPreviewData->cxEdge + 1/*3*/ + 1;
- pPreviewData->rcInactiveCaption.top = pPreviewData->rcInactiveFrame.top +
pPreviewData->cyEdge + 1/*3*/ + 1;
- pPreviewData->rcInactiveCaption.right = pPreviewData->rcInactiveFrame.right -
pPreviewData->cxEdge - 1/*3*/ - 1;
- pPreviewData->rcInactiveCaption.bottom = pPreviewData->rcInactiveFrame.top +
pPreviewData->cyCaption + 1 + 2;
+ pPreviewData->rcInactiveCaption.left = pPreviewData->rcInactiveFrame.left +
pPreviewData->cxEdge + pPreviewData->cySizeFrame + 1;
+ pPreviewData->rcInactiveCaption.top = pPreviewData->rcInactiveFrame.top +
pPreviewData->cyEdge + pPreviewData->cySizeFrame + 1;
+ pPreviewData->rcInactiveCaption.right = pPreviewData->rcInactiveFrame.right -
pPreviewData->cxEdge - pPreviewData->cySizeFrame - 1;
+ pPreviewData->rcInactiveCaption.bottom = pPreviewData->rcInactiveCaption.top +
pPreviewData->cyCaption;
/* Calculate the inactive caption buttons rectangle */
pPreviewData->rcInactiveCaptionButtons.left =
pPreviewData->rcInactiveCaption.right - 2 - 2 - 3 * 16;
@@ -228,16 +228,16 @@
pPreviewData->rcInactiveCaptionButtons.bottom =
pPreviewData->rcInactiveCaption.bottom - 2;
/* Calculate the active window rectangle */
- pPreviewData->rcActiveFrame.left = pPreviewData->rcInactiveFrame.left + 3 + 1;
+ pPreviewData->rcActiveFrame.left = pPreviewData->rcInactiveFrame.left + 3 +
pPreviewData->cySizeFrame;
pPreviewData->rcActiveFrame.top = pPreviewData->rcInactiveCaption.bottom + 1;
pPreviewData->rcActiveFrame.right = pPreviewData->rcDesktop.right - 10;
pPreviewData->rcActiveFrame.bottom = pPreviewData->rcDesktop.bottom - 25;
/* Calculate the active caption rectangle */
- pPreviewData->rcActiveCaption.left = pPreviewData->rcActiveFrame.left + 3 + 1;
- pPreviewData->rcActiveCaption.top = pPreviewData->rcActiveFrame.top + 3 + 1;
- pPreviewData->rcActiveCaption.right = pPreviewData->rcActiveFrame.right - 3 -
1;
- pPreviewData->rcActiveCaption.bottom = pPreviewData->rcActiveFrame.top +
pPreviewData->cyCaption + 1 + 2;
+ pPreviewData->rcActiveCaption.left = pPreviewData->rcActiveFrame.left +
pPreviewData->cxEdge + pPreviewData->cySizeFrame + 1;
+ pPreviewData->rcActiveCaption.top = pPreviewData->rcActiveFrame.top +
pPreviewData->cxEdge + pPreviewData->cySizeFrame + 1;
+ pPreviewData->rcActiveCaption.right = pPreviewData->rcActiveFrame.right -
pPreviewData->cxEdge - pPreviewData->cySizeFrame - 1;
+ pPreviewData->rcActiveCaption.bottom = pPreviewData->rcActiveCaption.top +
pPreviewData->cyCaption;
/* Calculate the active caption buttons rectangle */
pPreviewData->rcActiveCaptionButtons.left = pPreviewData->rcActiveCaption.right
- 2 - 2 - 3 * 16;
@@ -246,16 +246,16 @@
pPreviewData->rcActiveCaptionButtons.bottom =
pPreviewData->rcActiveCaption.bottom - 2;
/* Calculate the active menu bar rectangle */
- pPreviewData->rcActiveMenuBar.left = pPreviewData->rcActiveFrame.left + 3 + 1;
+ pPreviewData->rcActiveMenuBar.left = pPreviewData->rcActiveFrame.left +
pPreviewData->cxEdge + pPreviewData->cySizeFrame + 1;
pPreviewData->rcActiveMenuBar.top = pPreviewData->rcActiveCaption.bottom + 1;
- pPreviewData->rcActiveMenuBar.right = pPreviewData->rcActiveFrame.right - 3 -
1;
+ pPreviewData->rcActiveMenuBar.right = pPreviewData->rcActiveFrame.right -
pPreviewData->cxEdge - pPreviewData->cySizeFrame - 1;
pPreviewData->rcActiveMenuBar.bottom = pPreviewData->rcActiveMenuBar.top +
pPreviewData->cyMenu + 1;
/* Calculate the active client rectangle */
- pPreviewData->rcActiveClient.left = pPreviewData->rcActiveFrame.left + 3 + 1;
- pPreviewData->rcActiveClient.top = pPreviewData->rcActiveMenuBar.bottom; // +
1;
- pPreviewData->rcActiveClient.right = pPreviewData->rcActiveFrame.right - 3 -
1;
- pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom - 3 -
1;
+ pPreviewData->rcActiveClient.left = pPreviewData->rcActiveFrame.left +
pPreviewData->cxEdge + pPreviewData->cySizeFrame + 1;
+ pPreviewData->rcActiveClient.top = pPreviewData->rcActiveMenuBar.bottom;
+ pPreviewData->rcActiveClient.right = pPreviewData->rcActiveFrame.right -
pPreviewData->cxEdge - pPreviewData->cySizeFrame - 1;
+ pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom -
pPreviewData->cyEdge - pPreviewData->cySizeFrame - 1;
/* Calculate the active scroll rectangle */
pPreviewData->rcActiveScroll.left = pPreviewData->rcActiveClient.right - 2 -
pPreviewData->cxScrollbar;
@@ -340,10 +340,10 @@
NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON |
DC_TEXT);
DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE,
pPreviewData->cyCaption - 2);
- /* FIXME: Draw the menu bar */
+ /* Draw the menu bar */
DrawMenuBarTemp(hwnd, hdc, &pPreviewData->rcActiveMenuBar,
- pPreviewData->hMenu /*HMENU hMenu*/,
- pPreviewData->hMessageFont /*HFONT hFont*/);
+ pPreviewData->hMenu,
+ pPreviewData->hMessageFont);
/* Draw the client area */
CopyRect(&rc, &pPreviewData->rcActiveClient);
@@ -578,7 +578,7 @@
wc.lpfnWndProc = PreviewWndProc;
wc.hInstance = hInstance;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.hbrBackground = (HBRUSH)NULL; //(COLOR_BTNFACE + 1);
+ wc.hbrBackground = (HBRUSH)NULL;
wc.lpszClassName = szPreviewWndClass;
return RegisterClassEx(&wc) != (ATOM)0;