- Update to r53061
[reactos.git] / dll / cpl / desk / preview.c
index 0cda379..09513bb 100644 (file)
@@ -7,9 +7,6 @@
  */
 
 #include "desk.h"
-#include "theme.h"
-#include "preview.h"
-#include "draw.h"
 
 static const TCHAR szPreviewWndClass[] = TEXT("PreviewWndClass");
 
@@ -63,6 +60,7 @@ typedef struct _PREVIEW_DATA
     HFONT hCaptionFont;
     HFONT hMenuFont;
     HFONT hMessageFont;
+    HFONT hClientFont;
 
     HMENU hMenu;
 
@@ -76,6 +74,7 @@ static VOID UpdatePreviewTheme(HWND hwnd, PPREVIEW_DATA pPreviewData, THEME *the
     pPreviewData->hbrScrollbar = CreateSolidBrush(theme->crColor[COLOR_SCROLLBAR]);
     if (pPreviewData->hbrDesktop != NULL)
         DeleteObject(pPreviewData->hbrDesktop);
+
     pPreviewData->hbrDesktop = CreateSolidBrush(theme->crColor[COLOR_DESKTOP]);
     if (pPreviewData->hbrWindow != NULL)
         DeleteObject(pPreviewData->hbrWindow);
@@ -112,6 +111,8 @@ OnCreate(HWND hwnd, PPREVIEW_DATA pPreviewData)
 {
     THEME *theme;
 
+    pPreviewData->hClientFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
+
     /* Load and modify the menu */
     pPreviewData->hMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDR_PREVIEW_MENU));
     EnableMenuItem(pPreviewData->hMenu,
@@ -263,8 +264,8 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
     /* Inactive Window */
     MyDrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE, theme);
     SetTextColor(hdc, theme->crColor[COLOR_INACTIVECAPTIONTEXT]);
-    DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption,  pPreviewData->hCaptionFont,
-                    NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT);
+    MyDrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption,  pPreviewData->hCaptionFont,
+                      NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT, theme);
     MyDrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE, pPreviewData->cyCaption - 2, theme);
 
     /* Active Window */
@@ -289,8 +290,8 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
     rc.left += 4;
     rc.top += 2;
     SetTextColor(hdc, theme->crColor[COLOR_WINDOWTEXT]);
-    hOldFont = SelectObject(hdc, pPreviewData->hCaptionFont);   /* FIXME: client text is not caption text */
-    DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &rc, DT_LEFT);
+    hOldFont = SelectObject(hdc, pPreviewData->hClientFont);
+    DrawText(hdc, pPreviewData->lpWinTxt, -1, &rc, DT_LEFT);
     SelectObject(hdc, hOldFont);
 
     /* Draw the scroll bar */
@@ -307,9 +308,9 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
     CopyRect(&rc, &pPreviewData->rcDialogClient);
     rc.left += 4;
     rc.top += 2;
-    SetTextColor(hdc, RGB(0,0,0));
+    SetTextColor(hdc, theme->crColor[COLOR_BTNTEXT]);
     hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
-    DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText), &rc, DT_LEFT);
+    DrawText(hdc, pPreviewData->lpMessText, -1, &rc, DT_LEFT);
     SelectObject(hdc, hOldFont);
 
     /* Draw Button */
@@ -317,7 +318,7 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
     CopyRect(&rc, &pPreviewData->rcDialogButton);
     SetTextColor(hdc, theme->crColor[COLOR_BTNTEXT]);
     hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
-    DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &rc, DT_VCENTER | DT_CENTER | DT_SINGLELINE);
+    DrawText(hdc, pPreviewData->lpButText, -1, &rc, DT_VCENTER | DT_CENTER | DT_SINGLELINE);
     SelectObject(hdc, hOldFont);
 
     EndPaint(hwnd, &ps);