Author: ekohl
Date: Sat Jan 6 19:53:07 2007
New Revision: 25331
URL:
http://svn.reactos.org/svn/reactos?rev=25331&view=rev
Log:
- Don't use hardcoded colors.
- Calculate the menu bar rectangle.
- Add preview menu and remove the menu item strings.
- Draw the menu bar using DrawMenuBarTemp.
Modified:
trunk/reactos/dll/cpl/desk/Fr.rc
trunk/reactos/dll/cpl/desk/It.rc
trunk/reactos/dll/cpl/desk/Ja.rc
trunk/reactos/dll/cpl/desk/Ru.rc
trunk/reactos/dll/cpl/desk/Uk.rc
trunk/reactos/dll/cpl/desk/cz.rc
trunk/reactos/dll/cpl/desk/de.rc
trunk/reactos/dll/cpl/desk/en.rc
trunk/reactos/dll/cpl/desk/es.rc
trunk/reactos/dll/cpl/desk/gr.rc
trunk/reactos/dll/cpl/desk/hu.rc
trunk/reactos/dll/cpl/desk/nl.rc
trunk/reactos/dll/cpl/desk/pl.rc
trunk/reactos/dll/cpl/desk/preview.c
trunk/reactos/dll/cpl/desk/resource.h
trunk/reactos/dll/cpl/desk/sv.rc
Modified: trunk/reactos/dll/cpl/desk/Fr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Fr.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Fr.rc (original)
+++ trunk/reactos/dll/cpl/desk/Fr.rc Sat Jan 6 19:53:07 2007
@@ -96,6 +96,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Affichage"
@@ -131,7 +138,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/It.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/It.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/It.rc (original)
+++ trunk/reactos/dll/cpl/desk/It.rc Sat Jan 6 19:53:07 2007
@@ -90,6 +90,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Visualizzazione"
@@ -125,7 +132,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/Ja.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ja.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Ja.rc (original)
+++ trunk/reactos/dll/cpl/desk/Ja.rc Sat Jan 6 19:53:07 2007
@@ -94,6 +94,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "æÊ"
@@ -129,7 +136,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/Ru.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ru.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Ru.rc (original)
+++ trunk/reactos/dll/cpl/desk/Ru.rc Sat Jan 6 19:53:07 2007
@@ -81,12 +81,6 @@
PUSHBUTTON
"Äî&ïîëíèòåëüíî...",IDC_SETTINGS_ADVANCED,306,165,56,14
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
IDR_POPUP_MENU MENU
BEGIN
POPUP ""
@@ -99,11 +93,12 @@
END
END
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// String Table
-//
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
STRINGTABLE
BEGIN
@@ -151,7 +146,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/Uk.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Uk.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Uk.rc (original)
+++ trunk/reactos/dll/cpl/desk/Uk.rc Sat Jan 6 19:53:07 2007
@@ -98,6 +98,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Äèñïëåé"
@@ -133,7 +140,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/cz.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/cz.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/cz.rc (original)
+++ trunk/reactos/dll/cpl/desk/cz.rc Sat Jan 6 19:53:07 2007
@@ -94,7 +94,14 @@
END
END
-STRINGTABLE
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
+STRINGTABLE
BEGIN
IDS_CPLNAME "Obrazovka"
IDS_CPLDESCRIPTION "Nastavení obrazovky, spoøièe, vzhledu a rozliení."
@@ -123,7 +130,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/de.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/de.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/de.rc (original)
+++ trunk/reactos/dll/cpl/desk/de.rc Sat Jan 6 19:53:07 2007
@@ -83,14 +83,21 @@
IDR_POPUP_MENU MENU DISCARDABLE
BEGIN
- POPUP ""
- BEGIN
- MENUITEM "&Konfigurieren", ID_MENU_CONFIG
- MENUITEM "&Vorschau", ID_MENU_PREVIEW
- MENUITEM SEPARATOR
- MENUITEM "&Hinzufügen", ID_MENU_ADD
- MENUITEM "&Löschen\tDel", ID_MENU_DELETE
- END
+ POPUP ""
+ BEGIN
+ MENUITEM "&Konfigurieren", ID_MENU_CONFIG
+ MENUITEM "&Vorschau", ID_MENU_PREVIEW
+ MENUITEM SEPARATOR
+ MENUITEM "&Hinzufügen", ID_MENU_ADD
+ MENUITEM "&Löschen\tDel", ID_MENU_DELETE
+ END
+END
+
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
END
STRINGTABLE
@@ -127,7 +134,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/en.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/en.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/en.rc (original)
+++ trunk/reactos/dll/cpl/desk/en.rc Sat Jan 6 19:53:07 2007
@@ -90,6 +90,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Display"
@@ -125,7 +132,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/es.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/es.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/es.rc (original)
+++ trunk/reactos/dll/cpl/desk/es.rc Sat Jan 6 19:53:07 2007
@@ -101,6 +101,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Pantalla"
@@ -130,7 +137,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/gr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/gr.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/gr.rc (original)
+++ trunk/reactos/dll/cpl/desk/gr.rc Sat Jan 6 19:53:07 2007
@@ -94,6 +94,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Display"
@@ -129,7 +136,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/hu.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/hu.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/hu.rc (original)
+++ trunk/reactos/dll/cpl/desk/hu.rc Sat Jan 6 19:53:07 2007
@@ -82,6 +82,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Képernyõ"
@@ -117,7 +124,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/nl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/nl.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/nl.rc (original)
+++ trunk/reactos/dll/cpl/desk/nl.rc Sat Jan 6 19:53:07 2007
@@ -94,6 +94,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Display"
@@ -123,7 +130,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
Modified: trunk/reactos/dll/cpl/desk/pl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/pl.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/pl.rc (original)
+++ trunk/reactos/dll/cpl/desk/pl.rc Sat Jan 6 19:53:07 2007
@@ -95,6 +95,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Ekran"
@@ -124,7 +131,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END
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 Sat Jan 6 19:53:07 2007
@@ -22,6 +22,11 @@
DWORD clrScrollbar;
HBRUSH hbrScrollbar;
+ DWORD clrActiveCaptionText;
+ DWORD clrInactiveCaptionText;
+ DWORD clrWindowText;
+ DWORD clrButtonText;
+
INT cxEdge;
INT cyEdge;
@@ -33,6 +38,7 @@
RECT rcActiveFrame;
RECT rcActiveCaption;
+ RECT rcActiveMenuBar;
RECT rcActiveClient;
RECT rcActiveScroll;
@@ -48,13 +54,16 @@
LPTSTR lpMessBox;
LPTSTR lpMessText;
LPTSTR lpButText;
- LPTSTR lpMenNorm;
- LPTSTR lpMenDis;
- LPTSTR lpMenSel;
-
- LOGFONT CaptionFont;
- LOGFONT DialogFont;
- LOGFONT MenuFont;
+
+ LOGFONT lfCaptionFont;
+ LOGFONT lfMenuFont;
+ LOGFONT lfMessageFont;
+
+ HFONT hCaptionFont;
+ HFONT hMenuFont;
+ HFONT hMessageFont;
+
+ HMENU hMenu;
} PREVIEW_DATA, *PPREVIEW_DATA;
@@ -125,7 +134,7 @@
static VOID
-OnCreate(PPREVIEW_DATA pPreviewData)
+OnCreate(HWND hwnd, PPREVIEW_DATA pPreviewData)
{
NONCLIENTMETRICS NonClientMetrics;
@@ -137,6 +146,11 @@
pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW);
pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->clrWindow);
+ pPreviewData->clrActiveCaptionText = GetSysColor(COLOR_CAPTIONTEXT);
+ pPreviewData->clrInactiveCaptionText = GetSysColor(COLOR_INACTIVECAPTIONTEXT);
+ pPreviewData->clrWindowText = GetSysColor(COLOR_WINDOWTEXT);
+ pPreviewData->clrButtonText = GetSysColor(COLOR_BTNTEXT);
+
pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE);
pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE);
@@ -145,9 +159,23 @@
/* load font info */
NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS),
&NonClientMetrics, 0);
- pPreviewData->CaptionFont = NonClientMetrics.lfCaptionFont;
- pPreviewData->MenuFont = NonClientMetrics.lfMenuFont;
- pPreviewData->DialogFont = NonClientMetrics.lfMessageFont;
+
+ pPreviewData->lfCaptionFont = NonClientMetrics.lfCaptionFont;
+ pPreviewData->hCaptionFont =
CreateFontIndirect(&pPreviewData->lfCaptionFont);
+
+ pPreviewData->lfMenuFont = NonClientMetrics.lfMenuFont;
+ pPreviewData->hMenuFont = CreateFontIndirect(&pPreviewData->lfMenuFont);
+
+ pPreviewData->lfMessageFont = NonClientMetrics.lfMessageFont;
+ pPreviewData->hMessageFont =
CreateFontIndirect(&pPreviewData->lfMessageFont);
+
+ /* Load and modify the menu */
+ pPreviewData->hMenu = LoadMenu(hApplet, MAKEINTRESOURCE(IDR_PREVIEW_MENU));
+ EnableMenuItem(pPreviewData->hMenu, ID_MENU_DISABLED,
+ MF_BYCOMMAND | MF_DISABLED);
+ HiliteMenuItem(hwnd, pPreviewData->hMenu,
+ ID_MENU_SELECTED, MF_BYCOMMAND | MF_HILITE);
+
AllocAndLoadString(&pPreviewData->lpInAct, hApplet, IDS_INACTWIN);
AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN);
@@ -155,10 +183,6 @@
AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX);
AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT);
AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT);
- AllocAndLoadString(&pPreviewData->lpMenNorm, hApplet, IDS_NORMAL);
- AllocAndLoadString(&pPreviewData->lpMenDis, hApplet, IDS_DISABLED);
- AllocAndLoadString(&pPreviewData->lpMenSel, hApplet, IDS_SELECTED);
-
}
@@ -187,7 +211,7 @@
/* Calculate the active window rectangle */
pPreviewData->rcActiveFrame.left = pPreviewData->rcInactiveFrame.left + 3 + 1;
- pPreviewData->rcActiveFrame.top = pPreviewData->rcInactiveCaption.bottom + 2;
+ pPreviewData->rcActiveFrame.top = pPreviewData->rcInactiveCaption.bottom + 1;
pPreviewData->rcActiveFrame.right = pPreviewData->rcDesktop.right - 10;
pPreviewData->rcActiveFrame.bottom = pPreviewData->rcDesktop.bottom - 25;
@@ -197,11 +221,15 @@
pPreviewData->rcActiveCaption.right = pPreviewData->rcActiveFrame.right - 3 -
1;
pPreviewData->rcActiveCaption.bottom = pPreviewData->rcActiveFrame.top +
pPreviewData->cyCaption/*20*/ + 2;
- /* FIXME: Calculate the active menu bar rectangle */
+ /* Calculate the active menu bar rectangle */
+ pPreviewData->rcActiveMenuBar.left = pPreviewData->rcActiveFrame.left + 3 + 1;
+ pPreviewData->rcActiveMenuBar.top = pPreviewData->rcActiveCaption.bottom + 1;
+ pPreviewData->rcActiveMenuBar.right = pPreviewData->rcActiveFrame.right - 3 -
1;
+ pPreviewData->rcActiveMenuBar.bottom = pPreviewData->rcActiveMenuBar.top + 20;
/* Calculate the active client rectangle */
pPreviewData->rcActiveClient.left = pPreviewData->rcActiveFrame.left + 3 + 1;
- pPreviewData->rcActiveClient.top = pPreviewData->rcActiveCaption.bottom + 20 +
2;
+ pPreviewData->rcActiveClient.top = pPreviewData->rcActiveMenuBar.bottom; // +
1;
pPreviewData->rcActiveClient.right = pPreviewData->rcActiveFrame.right - 3 -
1;
pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom - 3 -
1;
@@ -246,8 +274,8 @@
OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
{
PAINTSTRUCT ps;
+ HFONT hOldFont;
HDC hdc;
- HFONT hFont;
RECT rc;
hdc = BeginPaint(hwnd, &ps);
@@ -257,27 +285,22 @@
/* Inactive Window */
DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
- SetTextColor(hdc, RGB(212,208,200));
-
- hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
- DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption, hFont,
+ SetTextColor(hdc, pPreviewData->clrInactiveCaptionText);
+ DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption,
pPreviewData->hCaptionFont,
NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT);
- DeleteObject(hFont);
-
DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE);
/* Active Window */
DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
- SetTextColor(hdc, RGB(255,255,255)); // FIXME: don't hardcode colors
-
- hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
- DrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption, hFont,
+ SetTextColor(hdc, pPreviewData->clrActiveCaptionText);
+ DrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption,
pPreviewData->hCaptionFont,
NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON |
DC_TEXT);
- DeleteObject(hFont);
-
DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE);
/* FIXME: Draw the menu bar */
+ DrawMenuBarTemp(hwnd, hdc, &pPreviewData->rcActiveMenuBar,
+ pPreviewData->hMenu /*HMENU hMenu*/,
+ pPreviewData->hMessageFont /*HFONT hFont*/);
/* Draw the client area */
CopyRect(&rc, &pPreviewData->rcActiveClient);
@@ -288,23 +311,19 @@
CopyRect(&rc, &pPreviewData->rcActiveClient);
rc.left += 4;
rc.top += 2;
- SetTextColor(hdc, RGB(0,0,0));
- SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont));
+ SetTextColor(hdc, pPreviewData->clrWindowText);
+ hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &rc,
DT_LEFT);
- DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
+ SelectObject(hdc, hOldFont);
/* Draw the scroll bar */
DrawScrollbar(hdc, &pPreviewData->rcActiveScroll,
pPreviewData->hbrScrollbar);
/* Dialog Window */
DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
- SetTextColor(hdc, RGB(255,255,255));
-
- hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
- DrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption, hFont,
+ SetTextColor(hdc, pPreviewData->clrActiveCaptionText);
+ DrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption,
pPreviewData->hCaptionFont,
NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON |
DC_TEXT);
- DeleteObject(hFont);
-
DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE);
/* Draw the dialog text */
@@ -312,17 +331,17 @@
rc.left += 4;
rc.top += 2;
SetTextColor(hdc, RGB(0,0,0));
- SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont));
+ hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText),
&rc, DT_LEFT);
- DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
+ SelectObject(hdc, hOldFont);
/* Draw Button */
DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON,
DFCS_BUTTONPUSH);
CopyRect(&rc, &pPreviewData->rcDialogButton);
- rc.top += 6;
- SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont));
- DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText),
&rc, DT_CENTER);
- DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
+ SetTextColor(hdc, pPreviewData->clrButtonText);
+ hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
+ DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText),
&rc, DT_VCENTER | DT_CENTER | DT_SINGLELINE);
+ SelectObject(hdc, hOldFont);
EndPaint(hwnd, &ps);
}
@@ -334,6 +353,12 @@
DeleteObject(pPreviewData->hbrScrollbar);
DeleteObject(pPreviewData->hbrDesktop);
DeleteObject(pPreviewData->hbrWindow);
+
+ DeleteObject(pPreviewData->hCaptionFont);
+ DeleteObject(pPreviewData->hMenuFont);
+ DeleteObject(pPreviewData->hMessageFont);
+
+ DestroyMenu(pPreviewData->hMenu);
LocalFree((HLOCAL)pPreviewData->lpInAct);
LocalFree((HLOCAL)pPreviewData->lpAct);
@@ -341,9 +366,6 @@
LocalFree((HLOCAL)pPreviewData->lpMessBox);
LocalFree((HLOCAL)pPreviewData->lpMessText);
LocalFree((HLOCAL)pPreviewData->lpButText);
- LocalFree((HLOCAL)pPreviewData->lpMenNorm);
- LocalFree((HLOCAL)pPreviewData->lpMenDis);
- LocalFree((HLOCAL)pPreviewData->lpMenSel);
}
@@ -367,7 +389,7 @@
return -1;
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pPreviewData);
- OnCreate(pPreviewData);
+ OnCreate(hwnd, pPreviewData);
break;
case WM_SIZE:
Modified: trunk/reactos/dll/cpl/desk/resource.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/resource.h?re…
==============================================================================
--- trunk/reactos/dll/cpl/desk/resource.h (original)
+++ trunk/reactos/dll/cpl/desk/resource.h Sat Jan 6 19:53:07 2007
@@ -67,6 +67,10 @@
#define ID_MENU_ADD 2013
#define ID_MENU_DELETE 2014
+#define IDR_PREVIEW_MENU 2100
+#define ID_MENU_NORMAL 2101
+#define ID_MENU_DISABLED 2102
+#define ID_MENU_SELECTED 2103
/* Settings Page */
@@ -88,9 +92,6 @@
#define IDS_MESSBOX 1513
#define IDS_MESSTEXT 1514
#define IDS_BUTTEXT 1515
-#define IDS_NORMAL 1516
-#define IDS_DISABLED 1517
-#define IDS_SELECTED 1518
#endif /* __CPL_DESK_RESOURCE_H__ */
Modified: trunk/reactos/dll/cpl/desk/sv.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/sv.rc?rev=253…
==============================================================================
--- trunk/reactos/dll/cpl/desk/sv.rc (original)
+++ trunk/reactos/dll/cpl/desk/sv.rc Sat Jan 6 19:53:07 2007
@@ -97,6 +97,13 @@
END
END
+IDR_PREVIEW_MENU MENU
+BEGIN
+ MENUITEM "Normal", ID_MENU_NORMAL
+ MENUITEM "Disabled", ID_MENU_DISABLED
+ MENUITEM "Selected", ID_MENU_SELECTED
+END
+
STRINGTABLE
BEGIN
IDS_CPLNAME "Bildskärm"
@@ -126,7 +133,4 @@
IDS_MESSBOX "Message Box"
IDS_MESSTEXT "Message Text"
IDS_BUTTEXT "OK"
- IDS_NORMAL "Normal"
- IDS_DISABLED "Disabled"
- IDS_SELECTED "Selected"
END