Author: ekohl
Date: Wed Jan 3 00:53:26 2007
New Revision: 25279
URL:
http://svn.reactos.org/svn/reactos?rev=25279&view=rev
Log:
Add the appearance preview control. Right now it doesn't do much but sitting there and
looking great. ;-)
Added:
trunk/reactos/dll/cpl/desk/preview.c
trunk/reactos/dll/cpl/desk/preview.h
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/desk.c
trunk/reactos/dll/cpl/desk/desk.rbuild
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/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=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Fr.rc (original)
+++ trunk/reactos/dll/cpl/desk/Fr.rc Wed Jan 3 00:53:26 2007
@@ -52,13 +52,15 @@
PUSHBUTTON "&Gestion de
l'alimentation",IDC_SCREENS_POWER_BUTTON,165, 162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Apparence"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "Vide pour l'instant....",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/It.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/It.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/It.rc (original)
+++ trunk/reactos/dll/cpl/desk/It.rc Wed Jan 3 00:53:26 2007
@@ -46,13 +46,15 @@
PUSHBUTTON "&Alimentazione",IDC_SCREENS_POWER_BUTTON,165, 162, 73,
15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Aspetto"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "Questo spazio è stato intenzionalmente lasciato in
bianco.",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/Ja.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ja.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Ja.rc (original)
+++ trunk/reactos/dll/cpl/desk/Ja.rc Wed Jan 3 00:53:26 2007
@@ -55,8 +55,10 @@
CAPTION "OÏÌfUC"
FONT 9, "MS UI Gothic"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "±±ÍÓ}IÉó¯½ÜÜÉµÄ èÜ·",IDC_STATIC,66,
- 110,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 228
Modified: trunk/reactos/dll/cpl/desk/Ru.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Ru.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Ru.rc (original)
+++ trunk/reactos/dll/cpl/desk/Ru.rc Wed Jan 3 00:53:26 2007
@@ -49,12 +49,14 @@
15
END
-IDD_APPEARANCE DIALOGEX 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX 0, 0, 246, 228
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Îôîðìëåíèå"
FONT 8, "MS Shell Dlg", 0, 0, 0x1
BEGIN
- LTEXT "Íàñòðîéêè âðåìåííî îòñóòñâóþò",IDC_STATIC,65,87,114,8
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
+ LTEXT "Íàñòðîéêè âðåìåííî îòñóòñâóþò",IDC_STATIC,65,150,114,8
END
IDD_SETTINGS DIALOGEX 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/Uk.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/Uk.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/Uk.rc (original)
+++ trunk/reactos/dll/cpl/desk/Uk.rc Wed Jan 3 00:53:26 2007
@@ -54,13 +54,15 @@
PUSHBUTTON "Ïàðàìåòðè &æèâëåííÿ",IDC_SCREENS_POWER_BUTTON,165,
162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Îôîðìëåííÿ"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "Öå ì³ñöå íàâìèñíî çàëèøåíå ïóñòèì",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/cz.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/cz.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/cz.rc (original)
+++ trunk/reactos/dll/cpl/desk/cz.rc Wed Jan 3 00:53:26 2007
@@ -50,13 +50,15 @@
PUSHBUTTON "M&onosti napájení",IDC_SCREENS_POWER_BUTTON,165, 162,
73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Vzhled"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/de.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/de.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/de.rc (original)
+++ trunk/reactos/dll/cpl/desk/de.rc Wed Jan 3 00:53:26 2007
@@ -1,6 +1,6 @@
LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
-IDD_BACKGROUND DIALOGEX DISCARDABLE 0, 0, 246, 205
+IDD_BACKGROUND DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Hintergrund"
FONT 8, "MS Shell Dlg"
@@ -15,12 +15,14 @@
COMBOBOX IDC_PLACEMENT_COMBO, 188, 149, 50, 54, CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
END
-IDD_SCREENSAVER DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_SCREENSAVER DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Bildschirmschoner"
FONT 8, "MS Shell Dlg"
BEGIN
- GROUPBOX "&Bildschrimschoner",IDC_SCREENS_DUMMY, 5, 7, 238, 136
+ CONTROL "", IDC_SCREENS_PREVIEW, "Static", SS_OWNERDRAW,
80, 10, 83, 57, WS_EX_STATICEDGE
+
+ GROUPBOX "&Bildschrimschoner",IDC_STATIC, 5, 7, 238, 136
LTEXT "Installierte Bildschrimschoner:",IDC_STATIC,13, 24, 150,
9
CONTROL "",IDC_SCREENS_CHOICES,"SysListView32",LVS_REPORT
|
@@ -46,28 +48,19 @@
PUSHBUTTON "Energ&ieeinstellungen",IDC_SCREENS_POWER_BUTTON,165,
162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Darstellung"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
+
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
-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
-END
-
-IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Einstellungen"
FONT 8, "MS Shell Dlg"
@@ -88,11 +81,22 @@
PUSHBUTTON "&Erweitert",IDC_SETTINGS_ADVANCED,306,165,56,14
END
-STRINGTABLE
+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
+END
+
+STRINGTABLE
BEGIN
IDS_CPLNAME "Anzeige"
IDS_CPLDESCRIPTION "Passt die Darstellung des Hintergrundbildes und des
Bildschirmschoners an."
-
IDS_NONE "(Keine)"
IDS_CENTER "Zentriert"
IDS_STRETCH "Gestreckt"
Modified: trunk/reactos/dll/cpl/desk/desk.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.c?rev=25…
==============================================================================
--- trunk/reactos/dll/cpl/desk/desk.c (original)
+++ trunk/reactos/dll/cpl/desk/desk.c Wed Jan 3 00:53:26 2007
@@ -9,6 +9,7 @@
*/
#include "desk.h"
+#include "preview.h"
#define NUM_APPLETS (1)
@@ -114,15 +115,20 @@
BOOL WINAPI
-DllMain(HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved)
+DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID lpvReserved)
{
UNREFERENCED_PARAMETER(lpvReserved);
switch (dwReason)
{
case DLL_PROCESS_ATTACH:
- case DLL_THREAD_ATTACH:
- hApplet = hinstDLL;
+ RegisterPreviewControl(hInstDLL);
+// case DLL_THREAD_ATTACH:
+ hApplet = hInstDLL;
+ break;
+
+ case DLL_PROCESS_DETACH:
+ UnregisterPreviewControl(hInstDLL);
break;
}
Modified: trunk/reactos/dll/cpl/desk/desk.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/desk.rbuild?r…
==============================================================================
--- trunk/reactos/dll/cpl/desk/desk.rbuild (original)
+++ trunk/reactos/dll/cpl/desk/desk.rbuild Wed Jan 3 00:53:26 2007
@@ -27,5 +27,6 @@
<file>appearance.c</file>
<file>settings.c</file>
<file>dibitmap.c</file>
+ <file>preview.c</file>
<file>desk.rc</file>
</module>
Modified: trunk/reactos/dll/cpl/desk/en.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/en.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/en.rc (original)
+++ trunk/reactos/dll/cpl/desk/en.rc Wed Jan 3 00:53:26 2007
@@ -46,13 +46,15 @@
PUSHBUTTON "P&ower Settings",IDC_SCREENS_POWER_BUTTON,165, 162,
73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/es.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/es.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/es.rc (original)
+++ trunk/reactos/dll/cpl/desk/es.rc Wed Jan 3 00:53:26 2007
@@ -57,13 +57,15 @@
PUSHBUTTON "Energía...",IDC_SCREENS_POWER_BUTTON,165, 162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Apariencia"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "Este espacio se ha dejado en blanco
intencionadamente",IDC_STATIC,33,
- 89,181,10
+ 150,181,10
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/gr.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/gr.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/gr.rc (original)
+++ trunk/reactos/dll/cpl/desk/gr.rc Wed Jan 3 00:53:26 2007
@@ -50,13 +50,15 @@
PUSHBUTTON "&Ñõèìßóåéò åíÝñãåéáò",IDC_SCREENS_POWER_BUTTON,165,
162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "ÅìöÜíéóç"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/hu.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/hu.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/hu.rc (original)
+++ trunk/reactos/dll/cpl/desk/hu.rc Wed Jan 3 00:53:26 2007
@@ -42,12 +42,14 @@
PUSHBUTTON "E&nergiaellátás",IDC_SCREENS_POWER_BUTTON,165, 162,
73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Megjelenés"
FONT 8, "MS Shell Dlg"
BEGIN
- LTEXT "Ez a terület szándékosan lett üresen
hagyva",IDC_STATIC,66,90,112,8
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
+ LTEXT "Ez a terület szándékosan lett üresen
hagyva",IDC_STATIC,66,150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/nl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/nl.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/nl.rc (original)
+++ trunk/reactos/dll/cpl/desk/nl.rc Wed Jan 3 00:53:26 2007
@@ -50,13 +50,15 @@
PUSHBUTTON "Inst&ellingen",IDC_SCREENS_POWER_BUTTON,165, 162, 73,
15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Appearance"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "This space is intentionally left blank",IDC_STATIC,66,
- 90,112,8
+ 150,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Modified: trunk/reactos/dll/cpl/desk/pl.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/pl.rc?rev=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/pl.rc (original)
+++ trunk/reactos/dll/cpl/desk/pl.rc Wed Jan 3 00:53:26 2007
@@ -51,13 +51,15 @@
PUSHBUTTON "Z&asilanie",IDC_SCREENS_POWER_BUTTON,165, 162, 73, 15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Wygl¹d"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "To miejsce pozosta³o celowo puste",IDC_STATIC,66,
- 90,112,8
+ 1590,112,8
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188
Added: 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 (added)
+++ trunk/reactos/dll/cpl/desk/preview.c Wed Jan 3 00:53:26 2007
@@ -1,0 +1,282 @@
+/*
+ * PROJECT: ReactOS Timedate Control Panel
+ * LICENSE: GPL - See COPYING in the top level directory
+ * FILE: lib/cpl/desk/preview.c
+ * PURPOSE: Draws the preview control
+ * COPYRIGHT: Copyright 2006 Eric Kohl
+ */
+
+#include "desk.h"
+#include "preview.h"
+
+static const TCHAR szPreviewWndClass[] = TEXT("PreviewWndClass");
+
+typedef struct _PREVIEW_DATA
+{
+ DWORD clrDesktop;
+ HBRUSH hbrDesktop;
+
+ DWORD clrWindow;
+ HBRUSH hbrWindow;
+
+ INT cxEdge;
+ INT cyEdge;
+
+ INT cyCaption;
+
+ RECT rcDesktop;
+ RECT rcInactiveFrame;
+ RECT rcInactiveCaption;
+
+ RECT rcActiveFrame;
+ RECT rcActiveCaption;
+ RECT rcActiveClient;
+ RECT rcActiveScroll;
+
+ RECT rcDialogFrame;
+ RECT rcDialogCaption;
+ RECT rcDialogClient;
+
+ RECT rcDialogButton;
+
+} PREVIEW_DATA, *PPREVIEW_DATA;
+
+
+static VOID
+DrawCaptionButtons(HDC hdc, LPRECT lpRect, BOOL bMinMax)
+{
+ RECT rc3;
+ RECT rc4;
+ RECT rc5;
+
+ rc3.left = lpRect->right - 2 - 16;
+ rc3.top = lpRect->top + 2;
+ rc3.right = lpRect->right - 2;
+ rc3.bottom = lpRect->bottom - 2;
+
+ DrawFrameControl(hdc, &rc3, DFC_CAPTION, DFCS_CAPTIONCLOSE);
+
+ if (bMinMax)
+ {
+ rc4.left = rc3.left - 16 - 2;
+ rc4.top = rc3.top;
+ rc4.right = rc3.right - 16 - 2;
+ rc4.bottom = rc3.bottom;
+
+ DrawFrameControl(hdc, &rc4, DFC_CAPTION, DFCS_CAPTIONMAX);
+
+ rc5.left = rc4.left - 16;
+ rc5.top = rc4.top;
+ rc5.right = rc4.right - 16;
+ rc5.bottom = rc4.bottom;
+
+ DrawFrameControl(hdc, &rc5, DFC_CAPTION, DFCS_CAPTIONMIN);
+ }
+}
+
+
+static VOID
+OnSize(INT cx, INT cy, PPREVIEW_DATA pPreviewData)
+{
+ int width, height;
+
+ /* Get Desktop rectangle */
+ pPreviewData->rcDesktop.left = 0;
+ pPreviewData->rcDesktop.top = 0;
+ pPreviewData->rcDesktop.right = cx;
+ pPreviewData->rcDesktop.bottom = cy;
+
+ /* Calculate the inactive window rectangle */
+ pPreviewData->rcInactiveFrame.left = pPreviewData->rcDesktop.left + 8;
+ pPreviewData->rcInactiveFrame.top = pPreviewData->rcDesktop.top + 8;
+ pPreviewData->rcInactiveFrame.right = pPreviewData->rcDesktop.right - 25;
+ 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 /*20*/ + 2;
+
+ /* Calculate the active window rectangle */
+ pPreviewData->rcActiveFrame.left = pPreviewData->rcInactiveFrame.left + 3 + 1;
+ pPreviewData->rcActiveFrame.top = pPreviewData->rcInactiveCaption.bottom + 2;
+ 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/*20*/ + 2;
+
+ /* FIXME: Calculate the active menu bar rectangle */
+
+ /* Calculate the active client rectangle */
+ pPreviewData->rcActiveClient.left = pPreviewData->rcActiveFrame.left + 3 + 1;
+ pPreviewData->rcActiveClient.top = pPreviewData->rcActiveCaption.bottom + 20 +
2;
+ pPreviewData->rcActiveClient.right = pPreviewData->rcActiveFrame.right - 3 -
1;
+ pPreviewData->rcActiveClient.bottom = pPreviewData->rcActiveFrame.bottom - 3 -
1;
+
+ /* Calculate the active scroll rectangle */
+ pPreviewData->rcActiveScroll.left = pPreviewData->rcActiveClient.right - 2 -
16;
+ pPreviewData->rcActiveScroll.top = pPreviewData->rcActiveClient.top + 2;
+ pPreviewData->rcActiveScroll.right = pPreviewData->rcActiveClient.right - 2;
+ pPreviewData->rcActiveScroll.bottom = pPreviewData->rcActiveClient.bottom - 2;
+
+
+ /* Dialog window */
+ pPreviewData->rcDialogFrame.left = pPreviewData->rcActiveClient.left + 4;
+ pPreviewData->rcDialogFrame.top = (pPreviewData->rcDesktop.bottom * 60) / 100;
+ pPreviewData->rcDialogFrame.right = (pPreviewData->rcDesktop.right * 65) /
100;
+ pPreviewData->rcDialogFrame.bottom = pPreviewData->rcDesktop.bottom - 5;
+
+ /* Calculate the dialog caption rectangle */
+ pPreviewData->rcDialogCaption.left = pPreviewData->rcDialogFrame.left + 3;
+ pPreviewData->rcDialogCaption.top = pPreviewData->rcDialogFrame.top + 3;
+ pPreviewData->rcDialogCaption.right = pPreviewData->rcDialogFrame.right - 3;
+ pPreviewData->rcDialogCaption.bottom = pPreviewData->rcDialogFrame.top + 20 +
2;
+
+ /* Calculate the dialog client rectangle */
+ pPreviewData->rcDialogClient.left = pPreviewData->rcDialogFrame.left + 3;
+ pPreviewData->rcDialogClient.top = pPreviewData->rcDialogCaption.bottom + 1;
+ pPreviewData->rcDialogClient.right = pPreviewData->rcDialogFrame.right - 3;
+ pPreviewData->rcDialogClient.bottom = pPreviewData->rcDialogFrame.bottom - 3;
+
+ /* Calculate the dialog button rectangle */
+ width = 80;
+ height = 28;
+
+ pPreviewData->rcDialogButton.left =
+ (pPreviewData->rcDialogClient.right + pPreviewData->rcDialogClient.left -
width) / 2;
+ pPreviewData->rcDialogButton.right = pPreviewData->rcDialogButton.left +
width;
+ pPreviewData->rcDialogButton.bottom = pPreviewData->rcDialogClient.bottom - 2;
+ pPreviewData->rcDialogButton.top = pPreviewData->rcDialogButton.bottom -
height;
+}
+
+
+static VOID
+DrawScrollbar(HDC hdc, LPRECT rc)
+{
+
+}
+
+
+static LRESULT CALLBACK
+PreviewWndProc(HWND hwnd,
+ UINT uMsg,
+ WPARAM wParam,
+ LPARAM lParam)
+{
+ PPREVIEW_DATA pPreviewData;
+ HDC hdc;
+ PAINTSTRUCT ps;
+ RECT rc;
+
+ pPreviewData = (PPREVIEW_DATA)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+
+ switch (uMsg)
+ {
+ case WM_CREATE:
+ pPreviewData = (PPREVIEW_DATA)HeapAlloc(GetProcessHeap(),
+ HEAP_ZERO_MEMORY,
+ sizeof(PREVIEW_DATA));
+ if (pPreviewData)
+ {
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)pPreviewData);
+ pPreviewData->clrDesktop = GetSysColor(COLOR_DESKTOP);
+ pPreviewData->hbrDesktop =
CreateSolidBrush(pPreviewData->clrDesktop);
+ pPreviewData->clrWindow = GetSysColor(COLOR_WINDOW);
+ pPreviewData->hbrWindow =
CreateSolidBrush(pPreviewData->clrWindow);
+
+ pPreviewData->cxEdge = GetSystemMetrics(SM_CXEDGE);
+ pPreviewData->cyEdge = GetSystemMetrics(SM_CXEDGE);
+
+ pPreviewData->cyCaption = 20; //GetSystemMetrics(SM_CYCAPTION);
+ }
+ break;
+
+ case WM_SIZE:
+ OnSize(LOWORD(lParam), HIWORD(lParam), pPreviewData);
+ break;
+
+ case WM_PAINT:
+ hdc = BeginPaint(hwnd, &ps);
+
+ /* Desktop */
+ FillRect(hdc, &pPreviewData->rcDesktop, pPreviewData->hbrDesktop);
+
+ /* Inactive Window */
+ DrawEdge(hdc, &pPreviewData->rcInactiveFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
+ DrawCaption(hwnd, hdc, &pPreviewData->rcInactiveCaption, DC_GRADIENT |
DC_TEXT);
+ DrawCaptionButtons(hdc, &pPreviewData->rcInactiveCaption, TRUE);
+
+
+ /* Active Window */
+ DrawEdge(hdc, &pPreviewData->rcActiveFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
+ DrawCaption(hwnd, hdc, &pPreviewData->rcActiveCaption, DC_ACTIVE |
DC_GRADIENT | DC_TEXT);
+ DrawCaptionButtons(hdc, &pPreviewData->rcActiveCaption, TRUE);
+
+ /* FIXME: Draw the menu bar */
+ CopyRect(&rc, &pPreviewData->rcActiveClient);
+ DrawEdge(hdc, &rc, EDGE_SUNKEN, BF_RECT | BF_ADJUST);
+ FillRect(hdc, &rc, pPreviewData->hbrWindow);
+
+ /* FIXME: Draw the client text */
+
+ /* Draw the scroll bar */
+ DrawScrollbar(hdc, &pPreviewData->rcActiveScroll);
+
+
+ /* Dialog Window */
+ DrawEdge(hdc, &pPreviewData->rcDialogFrame, EDGE_RAISED, BF_RECT |
BF_MIDDLE);
+ DrawCaption(hwnd, hdc, &pPreviewData->rcDialogCaption, DC_ACTIVE |
DC_GRADIENT | DC_TEXT);
+ DrawCaptionButtons(hdc, &pPreviewData->rcDialogCaption, FALSE);
+
+ /* Draw Button */
+ DrawFrameControl(hdc, &pPreviewData->rcDialogButton, DFC_BUTTON,
DFCS_BUTTONPUSH);
+
+
+ EndPaint(hwnd, &ps);
+ break;
+
+ case WM_DESTROY:
+ DeleteObject(pPreviewData->hbrDesktop);
+ DeleteObject(pPreviewData->hbrWindow);
+
+ HeapFree(GetProcessHeap(), 0, pPreviewData);
+ break;
+
+ default:
+ DefWindowProc(hwnd,
+ uMsg,
+ wParam,
+ lParam);
+ }
+
+ return TRUE;
+}
+
+
+BOOL
+RegisterPreviewControl(IN HINSTANCE hInstance)
+{
+ WNDCLASSEX wc = {0};
+
+ wc.cbSize = sizeof(WNDCLASSEX);
+ wc.lpfnWndProc = PreviewWndProc;
+ wc.hInstance = hInstance;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.hbrBackground = (HBRUSH)NULL; //(COLOR_BTNFACE + 1);
+ wc.lpszClassName = szPreviewWndClass;
+
+ return RegisterClassEx(&wc) != (ATOM)0;
+}
+
+
+VOID
+UnregisterPreviewControl(IN HINSTANCE hInstance)
+{
+ UnregisterClass(szPreviewWndClass,
+ hInstance);
+}
Added: trunk/reactos/dll/cpl/desk/preview.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/desk/preview.h?rev…
==============================================================================
--- trunk/reactos/dll/cpl/desk/preview.h (added)
+++ trunk/reactos/dll/cpl/desk/preview.h Wed Jan 3 00:53:26 2007
@@ -1,0 +1,4 @@
+
+
+BOOL RegisterPreviewControl(IN HINSTANCE hInstance);
+VOID UnregisterPreviewControl(IN HINSTANCE hInstance);
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 Wed Jan 3 00:53:26 2007
@@ -36,8 +36,8 @@
/* Screensaver Page */
-#define IDC_SCREENS_CHOICES 1010
-#define IDC_SCREENS_PREVIEW 1011
+#define IDC_SCREENS_PREVIEW 1010
+#define IDC_SCREENS_CHOICES 1011
#define IDC_SCREENS_POWER_BUTTON 1012
#define IDC_SCREENS_SETTINGS 1013
#define IDC_SCREENS_TESTSC 1014
@@ -55,7 +55,7 @@
#define IDS_STRETCH 2004
#define IDS_TILE 2005
-#define IDC_SETTINGS_DEVICE 201
+#define IDC_SETTINGS_DEVICE 201
#define IDC_SETTINGS_BPP 202
#define IDC_SETTINGS_RESOLUTION 203
#define IDC_SETTINGS_RESOLUTION_TEXT 204
@@ -76,7 +76,11 @@
#define IDS_COLOR_8BIT 2908
#define IDS_COLOR_16BIT 2916
#define IDS_COLOR_24BIT 2924
-#define IDS_COLOR_32BIT 2932
+#define IDS_COLOR_32BIT 2932
+
+
+/* Appearance Page */
+#define IDC_APPEARANCE_PREVIEW 1500
#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=252…
==============================================================================
--- trunk/reactos/dll/cpl/desk/sv.rc (original)
+++ trunk/reactos/dll/cpl/desk/sv.rc Wed Jan 3 00:53:26 2007
@@ -53,13 +53,15 @@
PUSHBUTTON "Ins&tällningar",IDC_SCREENS_POWER_BUTTON,165, 162, 73,
15
END
-IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 188
+IDD_APPEARANCE DIALOGEX DISCARDABLE 0, 0, 246, 228
STYLE DS_SHELLFONT | WS_CHILD | WS_DISABLED | WS_CAPTION
CAPTION "Utseende"
FONT 8, "MS Shell Dlg"
BEGIN
+ CONTROL "", IDC_APPEARANCE_PREVIEW, "PreviewWndClass",
+ WS_VISIBLE | WS_BORDER, 7, 7, 232, 120
LTEXT "Det här utrymmet har avsiktligt\nlämnats
tomt",IDC_STATIC,66,
- 90,112,20
+ 150,112,20
END
IDD_SETTINGS DIALOGEX DISCARDABLE 0, 0, 246, 188