mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
- 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. svn path=/trunk/; revision=25331
This commit is contained in:
parent
66ae45808d
commit
01ff2d0170
|
@ -96,6 +96,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Affichage"
|
IDS_CPLNAME "Affichage"
|
||||||
|
@ -131,7 +138,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -90,6 +90,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Visualizzazione"
|
IDS_CPLNAME "Visualizzazione"
|
||||||
|
@ -125,7 +132,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -94,6 +94,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "‰æ–Ê"
|
IDS_CPLNAME "‰æ–Ê"
|
||||||
|
@ -129,7 +136,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -81,12 +81,6 @@ BEGIN
|
||||||
PUSHBUTTON "Äî&ïîëíèòåëüíî...",IDC_SETTINGS_ADVANCED,306,165,56,14
|
PUSHBUTTON "Äî&ïîëíèòåëüíî...",IDC_SETTINGS_ADVANCED,306,165,56,14
|
||||||
END
|
END
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Menu
|
|
||||||
//
|
|
||||||
|
|
||||||
IDR_POPUP_MENU MENU
|
IDR_POPUP_MENU MENU
|
||||||
BEGIN
|
BEGIN
|
||||||
POPUP ""
|
POPUP ""
|
||||||
|
@ -99,11 +93,12 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
BEGIN
|
||||||
//
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
// String Table
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
//
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
|
@ -151,7 +146,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -98,6 +98,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Äèñïëåé"
|
IDS_CPLNAME "Äèñïëåé"
|
||||||
|
@ -133,7 +140,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -94,7 +94,14 @@ BEGIN
|
||||||
END
|
END
|
||||||
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
|
BEGIN
|
||||||
IDS_CPLNAME "Obrazovka"
|
IDS_CPLNAME "Obrazovka"
|
||||||
IDS_CPLDESCRIPTION "Nastavení obrazovky, spoøièe, vzhledu a rozlišení."
|
IDS_CPLDESCRIPTION "Nastavení obrazovky, spoøièe, vzhledu a rozlišení."
|
||||||
|
@ -123,7 +130,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -83,14 +83,21 @@ END
|
||||||
|
|
||||||
IDR_POPUP_MENU MENU DISCARDABLE
|
IDR_POPUP_MENU MENU DISCARDABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
POPUP ""
|
POPUP ""
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Konfigurieren", ID_MENU_CONFIG
|
MENUITEM "&Konfigurieren", ID_MENU_CONFIG
|
||||||
MENUITEM "&Vorschau", ID_MENU_PREVIEW
|
MENUITEM "&Vorschau", ID_MENU_PREVIEW
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "&Hinzufügen", ID_MENU_ADD
|
MENUITEM "&Hinzufügen", ID_MENU_ADD
|
||||||
MENUITEM "&Löschen\tDel", ID_MENU_DELETE
|
MENUITEM "&Löschen\tDel", ID_MENU_DELETE
|
||||||
END
|
END
|
||||||
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
END
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
|
@ -127,7 +134,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -90,6 +90,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Display"
|
IDS_CPLNAME "Display"
|
||||||
|
@ -125,7 +132,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -101,6 +101,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Pantalla"
|
IDS_CPLNAME "Pantalla"
|
||||||
|
@ -130,7 +137,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -94,6 +94,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Display"
|
IDS_CPLNAME "Display"
|
||||||
|
@ -129,7 +136,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -82,6 +82,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Képernyõ"
|
IDS_CPLNAME "Képernyõ"
|
||||||
|
@ -117,7 +124,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -94,6 +94,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Display"
|
IDS_CPLNAME "Display"
|
||||||
|
@ -123,7 +130,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -95,6 +95,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Ekran"
|
IDS_CPLNAME "Ekran"
|
||||||
|
@ -124,7 +131,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
|
@ -22,6 +22,11 @@ typedef struct _PREVIEW_DATA
|
||||||
DWORD clrScrollbar;
|
DWORD clrScrollbar;
|
||||||
HBRUSH hbrScrollbar;
|
HBRUSH hbrScrollbar;
|
||||||
|
|
||||||
|
DWORD clrActiveCaptionText;
|
||||||
|
DWORD clrInactiveCaptionText;
|
||||||
|
DWORD clrWindowText;
|
||||||
|
DWORD clrButtonText;
|
||||||
|
|
||||||
INT cxEdge;
|
INT cxEdge;
|
||||||
INT cyEdge;
|
INT cyEdge;
|
||||||
|
|
||||||
|
@ -33,6 +38,7 @@ typedef struct _PREVIEW_DATA
|
||||||
|
|
||||||
RECT rcActiveFrame;
|
RECT rcActiveFrame;
|
||||||
RECT rcActiveCaption;
|
RECT rcActiveCaption;
|
||||||
|
RECT rcActiveMenuBar;
|
||||||
RECT rcActiveClient;
|
RECT rcActiveClient;
|
||||||
RECT rcActiveScroll;
|
RECT rcActiveScroll;
|
||||||
|
|
||||||
|
@ -48,13 +54,16 @@ typedef struct _PREVIEW_DATA
|
||||||
LPTSTR lpMessBox;
|
LPTSTR lpMessBox;
|
||||||
LPTSTR lpMessText;
|
LPTSTR lpMessText;
|
||||||
LPTSTR lpButText;
|
LPTSTR lpButText;
|
||||||
LPTSTR lpMenNorm;
|
|
||||||
LPTSTR lpMenDis;
|
|
||||||
LPTSTR lpMenSel;
|
|
||||||
|
|
||||||
LOGFONT CaptionFont;
|
LOGFONT lfCaptionFont;
|
||||||
LOGFONT DialogFont;
|
LOGFONT lfMenuFont;
|
||||||
LOGFONT MenuFont;
|
LOGFONT lfMessageFont;
|
||||||
|
|
||||||
|
HFONT hCaptionFont;
|
||||||
|
HFONT hMenuFont;
|
||||||
|
HFONT hMessageFont;
|
||||||
|
|
||||||
|
HMENU hMenu;
|
||||||
|
|
||||||
} PREVIEW_DATA, *PPREVIEW_DATA;
|
} PREVIEW_DATA, *PPREVIEW_DATA;
|
||||||
|
|
||||||
|
@ -125,7 +134,7 @@ DrawScrollbar(HDC hdc, LPRECT rc, HBRUSH hbrScrollbar)
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
OnCreate(PPREVIEW_DATA pPreviewData)
|
OnCreate(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
||||||
{
|
{
|
||||||
NONCLIENTMETRICS NonClientMetrics;
|
NONCLIENTMETRICS NonClientMetrics;
|
||||||
|
|
||||||
|
@ -137,6 +146,11 @@ OnCreate(PPREVIEW_DATA pPreviewData)
|
||||||
pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW);
|
pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW);
|
||||||
pPreviewData->hbrWindow = CreateSolidBrush(pPreviewData->clrWindow);
|
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->cxEdge = GetSystemMetrics(SM_CXEDGE);
|
||||||
pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE);
|
pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE);
|
||||||
|
|
||||||
|
@ -145,9 +159,23 @@ OnCreate(PPREVIEW_DATA pPreviewData)
|
||||||
/* load font info */
|
/* load font info */
|
||||||
NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS);
|
NonClientMetrics.cbSize = sizeof(NONCLIENTMETRICS);
|
||||||
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0);
|
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &NonClientMetrics, 0);
|
||||||
pPreviewData->CaptionFont = NonClientMetrics.lfCaptionFont;
|
|
||||||
pPreviewData->MenuFont = NonClientMetrics.lfMenuFont;
|
pPreviewData->lfCaptionFont = NonClientMetrics.lfCaptionFont;
|
||||||
pPreviewData->DialogFont = NonClientMetrics.lfMessageFont;
|
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->lpInAct, hApplet, IDS_INACTWIN);
|
||||||
AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN);
|
AllocAndLoadString(&pPreviewData->lpAct, hApplet, IDS_ACTWIN);
|
||||||
|
@ -155,10 +183,6 @@ OnCreate(PPREVIEW_DATA pPreviewData)
|
||||||
AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX);
|
AllocAndLoadString(&pPreviewData->lpMessBox, hApplet, IDS_MESSBOX);
|
||||||
AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT);
|
AllocAndLoadString(&pPreviewData->lpMessText, hApplet, IDS_MESSTEXT);
|
||||||
AllocAndLoadString(&pPreviewData->lpButText, hApplet, IDS_BUTTEXT);
|
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 @@ OnSize(INT cx, INT cy, PPREVIEW_DATA pPreviewData)
|
||||||
|
|
||||||
/* Calculate the active window rectangle */
|
/* Calculate the active window rectangle */
|
||||||
pPreviewData->rcActiveFrame.left = pPreviewData->rcInactiveFrame.left + 3 + 1;
|
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.right = pPreviewData->rcDesktop.right - 10;
|
||||||
pPreviewData->rcActiveFrame.bottom = pPreviewData->rcDesktop.bottom - 25;
|
pPreviewData->rcActiveFrame.bottom = pPreviewData->rcDesktop.bottom - 25;
|
||||||
|
|
||||||
|
@ -197,11 +221,15 @@ OnSize(INT cx, INT cy, PPREVIEW_DATA pPreviewData)
|
||||||
pPreviewData->rcActiveCaption.right = pPreviewData->rcActiveFrame.right - 3 - 1;
|
pPreviewData->rcActiveCaption.right = pPreviewData->rcActiveFrame.right - 3 - 1;
|
||||||
pPreviewData->rcActiveCaption.bottom = pPreviewData->rcActiveFrame.top + pPreviewData->cyCaption/*20*/ + 2;
|
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 */
|
/* Calculate the active client rectangle */
|
||||||
pPreviewData->rcActiveClient.left = pPreviewData->rcActiveFrame.left + 3 + 1;
|
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.right = pPreviewData->rcActiveFrame.right - 3 - 1;
|
||||||
pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom - 3 - 1;
|
pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom - 3 - 1;
|
||||||
|
|
||||||
|
@ -246,8 +274,8 @@ static VOID
|
||||||
OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
||||||
{
|
{
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
|
HFONT hOldFont;
|
||||||
HDC hdc;
|
HDC hdc;
|
||||||
HFONT hFont;
|
|
||||||
RECT rc;
|
RECT rc;
|
||||||
|
|
||||||
hdc = BeginPaint(hwnd, &ps);
|
hdc = BeginPaint(hwnd, &ps);
|
||||||
|
@ -257,27 +285,22 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
||||||
|
|
||||||
/* Inactive Window */
|
/* Inactive Window */
|
||||||
DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
||||||
SetTextColor(hdc, RGB(212,208,200));
|
SetTextColor(hdc, pPreviewData->clrInactiveCaptionText);
|
||||||
|
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption, pPreviewData->hCaptionFont,
|
||||||
hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
|
|
||||||
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcInactiveCaption, hFont,
|
|
||||||
NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT);
|
NULL, pPreviewData->lpInAct, DC_GRADIENT | DC_ICON | DC_TEXT);
|
||||||
DeleteObject(hFont);
|
|
||||||
|
|
||||||
DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE);
|
DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE);
|
||||||
|
|
||||||
/* Active Window */
|
/* Active Window */
|
||||||
DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
||||||
SetTextColor(hdc, RGB(255,255,255)); // FIXME: don't hardcode colors
|
SetTextColor(hdc, pPreviewData->clrActiveCaptionText);
|
||||||
|
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption, pPreviewData->hCaptionFont,
|
||||||
hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
|
|
||||||
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcActiveCaption, hFont,
|
|
||||||
NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT);
|
NULL, pPreviewData->lpAct, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT);
|
||||||
DeleteObject(hFont);
|
|
||||||
|
|
||||||
DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE);
|
DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE);
|
||||||
|
|
||||||
/* FIXME: Draw the menu bar */
|
/* FIXME: Draw the menu bar */
|
||||||
|
DrawMenuBarTemp(hwnd, hdc, &pPreviewData->rcActiveMenuBar,
|
||||||
|
pPreviewData->hMenu /*HMENU hMenu*/,
|
||||||
|
pPreviewData->hMessageFont /*HFONT hFont*/);
|
||||||
|
|
||||||
/* Draw the client area */
|
/* Draw the client area */
|
||||||
CopyRect(&rc, &pPreviewData->rcActiveClient);
|
CopyRect(&rc, &pPreviewData->rcActiveClient);
|
||||||
|
@ -288,23 +311,19 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
||||||
CopyRect(&rc, &pPreviewData->rcActiveClient);
|
CopyRect(&rc, &pPreviewData->rcActiveClient);
|
||||||
rc.left += 4;
|
rc.left += 4;
|
||||||
rc.top += 2;
|
rc.top += 2;
|
||||||
SetTextColor(hdc, RGB(0,0,0));
|
SetTextColor(hdc, pPreviewData->clrWindowText);
|
||||||
SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont));
|
hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
|
||||||
DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &rc, DT_LEFT);
|
DrawText(hdc, pPreviewData->lpWinTxt, lstrlen(pPreviewData->lpWinTxt), &rc, DT_LEFT);
|
||||||
DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
|
SelectObject(hdc, hOldFont);
|
||||||
|
|
||||||
/* Draw the scroll bar */
|
/* Draw the scroll bar */
|
||||||
DrawScrollbar(hdc, &pPreviewData->rcActiveScroll, pPreviewData->hbrScrollbar);
|
DrawScrollbar(hdc, &pPreviewData->rcActiveScroll, pPreviewData->hbrScrollbar);
|
||||||
|
|
||||||
/* Dialog Window */
|
/* Dialog Window */
|
||||||
DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT | BF_MIDDLE);
|
||||||
SetTextColor(hdc, RGB(255,255,255));
|
SetTextColor(hdc, pPreviewData->clrActiveCaptionText);
|
||||||
|
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption, pPreviewData->hCaptionFont,
|
||||||
hFont = CreateFontIndirect(&pPreviewData->CaptionFont);
|
|
||||||
DrawCaptionTemp(NULL, hdc, &pPreviewData->rcDialogCaption, hFont,
|
|
||||||
NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT);
|
NULL, pPreviewData->lpMessBox, DC_ACTIVE | DC_GRADIENT | DC_ICON | DC_TEXT);
|
||||||
DeleteObject(hFont);
|
|
||||||
|
|
||||||
DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE);
|
DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE);
|
||||||
|
|
||||||
/* Draw the dialog text */
|
/* Draw the dialog text */
|
||||||
|
@ -312,17 +331,17 @@ OnPaint(HWND hwnd, PPREVIEW_DATA pPreviewData)
|
||||||
rc.left += 4;
|
rc.left += 4;
|
||||||
rc.top += 2;
|
rc.top += 2;
|
||||||
SetTextColor(hdc, RGB(0,0,0));
|
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);
|
DrawText(hdc, pPreviewData->lpMessText, lstrlen(pPreviewData->lpMessText), &rc, DT_LEFT);
|
||||||
DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
|
SelectObject(hdc, hOldFont);
|
||||||
|
|
||||||
/* Draw Button */
|
/* Draw Button */
|
||||||
DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH);
|
DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON, DFCS_BUTTONPUSH);
|
||||||
CopyRect(&rc, &pPreviewData->rcDialogButton);
|
CopyRect(&rc, &pPreviewData->rcDialogButton);
|
||||||
rc.top += 6;
|
SetTextColor(hdc, pPreviewData->clrButtonText);
|
||||||
SelectObject(hdc, CreateFontIndirect(&pPreviewData->DialogFont));
|
hOldFont = SelectObject(hdc, pPreviewData->hMessageFont);
|
||||||
DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &rc, DT_CENTER);
|
DrawText(hdc, pPreviewData->lpButText, lstrlen(pPreviewData->lpButText), &rc, DT_VCENTER | DT_CENTER | DT_SINGLELINE);
|
||||||
DeleteObject(SelectObject(hdc, GetStockObject(SYSTEM_FONT)));
|
SelectObject(hdc, hOldFont);
|
||||||
|
|
||||||
EndPaint(hwnd, &ps);
|
EndPaint(hwnd, &ps);
|
||||||
}
|
}
|
||||||
|
@ -335,15 +354,18 @@ OnDestroy(PPREVIEW_DATA pPreviewData)
|
||||||
DeleteObject(pPreviewData->hbrDesktop);
|
DeleteObject(pPreviewData->hbrDesktop);
|
||||||
DeleteObject(pPreviewData->hbrWindow);
|
DeleteObject(pPreviewData->hbrWindow);
|
||||||
|
|
||||||
|
DeleteObject(pPreviewData->hCaptionFont);
|
||||||
|
DeleteObject(pPreviewData->hMenuFont);
|
||||||
|
DeleteObject(pPreviewData->hMessageFont);
|
||||||
|
|
||||||
|
DestroyMenu(pPreviewData->hMenu);
|
||||||
|
|
||||||
LocalFree((HLOCAL)pPreviewData->lpInAct);
|
LocalFree((HLOCAL)pPreviewData->lpInAct);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpAct);
|
LocalFree((HLOCAL)pPreviewData->lpAct);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpWinTxt);
|
LocalFree((HLOCAL)pPreviewData->lpWinTxt);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpMessBox);
|
LocalFree((HLOCAL)pPreviewData->lpMessBox);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpMessText);
|
LocalFree((HLOCAL)pPreviewData->lpMessText);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpButText);
|
LocalFree((HLOCAL)pPreviewData->lpButText);
|
||||||
LocalFree((HLOCAL)pPreviewData->lpMenNorm);
|
|
||||||
LocalFree((HLOCAL)pPreviewData->lpMenDis);
|
|
||||||
LocalFree((HLOCAL)pPreviewData->lpMenSel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -367,7 +389,7 @@ PreviewWndProc(HWND hwnd,
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pPreviewData);
|
SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pPreviewData);
|
||||||
OnCreate(pPreviewData);
|
OnCreate(hwnd, pPreviewData);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZE:
|
case WM_SIZE:
|
||||||
|
|
|
@ -67,6 +67,10 @@
|
||||||
#define ID_MENU_ADD 2013
|
#define ID_MENU_ADD 2013
|
||||||
#define ID_MENU_DELETE 2014
|
#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 */
|
/* Settings Page */
|
||||||
|
|
||||||
|
@ -88,9 +92,6 @@
|
||||||
#define IDS_MESSBOX 1513
|
#define IDS_MESSBOX 1513
|
||||||
#define IDS_MESSTEXT 1514
|
#define IDS_MESSTEXT 1514
|
||||||
#define IDS_BUTTEXT 1515
|
#define IDS_BUTTEXT 1515
|
||||||
#define IDS_NORMAL 1516
|
|
||||||
#define IDS_DISABLED 1517
|
|
||||||
#define IDS_SELECTED 1518
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* __CPL_DESK_RESOURCE_H__ */
|
#endif /* __CPL_DESK_RESOURCE_H__ */
|
||||||
|
|
|
@ -97,6 +97,13 @@ BEGIN
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
|
IDR_PREVIEW_MENU MENU
|
||||||
|
BEGIN
|
||||||
|
MENUITEM "Normal", ID_MENU_NORMAL
|
||||||
|
MENUITEM "Disabled", ID_MENU_DISABLED
|
||||||
|
MENUITEM "Selected", ID_MENU_SELECTED
|
||||||
|
END
|
||||||
|
|
||||||
STRINGTABLE
|
STRINGTABLE
|
||||||
BEGIN
|
BEGIN
|
||||||
IDS_CPLNAME "Bildskärm"
|
IDS_CPLNAME "Bildskärm"
|
||||||
|
@ -126,7 +133,4 @@ BEGIN
|
||||||
IDS_MESSBOX "Message Box"
|
IDS_MESSBOX "Message Box"
|
||||||
IDS_MESSTEXT "Message Text"
|
IDS_MESSTEXT "Message Text"
|
||||||
IDS_BUTTEXT "OK"
|
IDS_BUTTEXT "OK"
|
||||||
IDS_NORMAL "Normal"
|
|
||||||
IDS_DISABLED "Disabled"
|
|
||||||
IDS_SELECTED "Selected"
|
|
||||||
END
|
END
|
||||||
|
|
Loading…
Reference in a new issue