diff --git a/reactos/lib/uxtheme/.cvsignore b/reactos/lib/uxtheme/.cvsignore
index 91b16a2de8a..4d216868aec 100644
--- a/reactos/lib/uxtheme/.cvsignore
+++ b/reactos/lib/uxtheme/.cvsignore
@@ -11,3 +11,4 @@
*.res
*.tds
*.lib
+*.xml
diff --git a/reactos/lib/uxtheme/nostyle/.cvsignore b/reactos/lib/uxtheme/nostyle/.cvsignore
index 58e74345fea..962f3c27c2d 100644
--- a/reactos/lib/uxtheme/nostyle/.cvsignore
+++ b/reactos/lib/uxtheme/nostyle/.cvsignore
@@ -3,3 +3,4 @@
*.o
*.sym
*.obj
+*.~*
diff --git a/reactos/lib/uxtheme/nostyle/button.c b/reactos/lib/uxtheme/nostyle/button.c
index a436fd73fa8..a337c91eb34 100644
--- a/reactos/lib/uxtheme/nostyle/button.c
+++ b/reactos/lib/uxtheme/nostyle/button.c
@@ -31,10 +31,10 @@ static const UINT Button_PushButton_State[] =
DFCS_BUTTONPUSH | DFCS_HOT, /* PBS_HOT */
DFCS_BUTTONPUSH | DFCS_PUSHED, /* PBS_PRESSED */
DFCS_BUTTONPUSH | DFCS_INACTIVE /* PBS_DISABLED */
- /* TODO */ /* PBS_DEFAULTED */
+ /* PBS_DEFAULTED */
};
-/* BP_RADIOBUTTON */ /* FIXME: not sure about DrawFrameControl with radios */
+/* BP_RADIOBUTTON */
static const UINT Button_RadioButton_State[] =
{
DFCS_BUTTONRADIO, /* RBS_UNCHECKEDNORMAL */
@@ -47,31 +47,67 @@ static const UINT Button_RadioButton_State[] =
DFCS_BUTTONRADIO | DFCS_CHECKED | DFCS_INACTIVE /* RBS_CHECKEDDISABLED */
};
-/* BP_CHECKBOX */ /* FIXME: not sure about DrawFrameControl with checkboxes */
+/* BP_CHECKBOX */
static const UINT Button_CheckBox_State[] =
{
- DFCS_BUTTONCHECK, /* CBS_UNCHECKEDNORMAL */
- DFCS_BUTTONCHECK | DFCS_HOT, /* CBS_UNCHECKEDHOT */
- DFCS_BUTTONCHECK | DFCS_PUSHED, /* CBS_UNCHECKEDPRESSED */
- DFCS_BUTTONCHECK | DFCS_INACTIVE, /* CBS_UNCHECKEDDISABLED */
- DFCS_BUTTONCHECK | DFCS_CHECKED, /* CBS_CHECKEDNORMAL */
- DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT, /* CBS_CHECKEDHOT */
- DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_PUSHED, /* CBS_CHECKEDPRESSED */
- DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE /* CBS_CHECKEDDISABLED */
- /* TODO */ /* CBS_MIXEDNORMAL */
- /* TODO */ /* CBS_MIXEDHOT */
- /* TODO */ /* CBS_MIXEDPRESSED */
- /* TODO */ /* CBS_MIXEDDISABLED */
-};
+ DFCS_BUTTONCHECK, /* CBS_UNCHECKEDNORMAL */
+ DFCS_BUTTONCHECK | DFCS_HOT, /* CBS_UNCHECKEDHOT */
+ DFCS_BUTTONCHECK | DFCS_PUSHED, /* CBS_UNCHECKEDPRESSED */
+ DFCS_BUTTONCHECK | DFCS_INACTIVE, /* CBS_UNCHECKEDDISABLED */
+ DFCS_BUTTONCHECK | DFCS_CHECKED, /* CBS_CHECKEDNORMAL */
+ DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT, /* CBS_CHECKEDHOT */
+ DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_PUSHED, /* CBS_CHECKEDPRESSED */
+ DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE, /* CBS_CHECKEDDISABLED */
+ DFCS_BUTTON3STATE | DFCS_CHECKED, /* CBS_MIXEDNORMAL */
+ DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_HOT, /* CBS_MIXEDHOT */
+ DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_PUSHED, /* CBS_MIXEDPRESSED */
+ DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_INACTIVE /* CBS_MIXEDDISABLED */
+};
static UINT const * Button_Part_State[] =
{
Button_PushButton_State,
Button_RadioButton_State,
Button_CheckBox_State
- /* TODO: group box */
};
+STDAPI Button_DrawBackgroundSpecial
+(
+ struct UXTHEME_DATA_ * pData,
+ HDC hdc,
+ int iPartId,
+ int iStateId,
+ const RECT * pRect
+)
+{
+ HRESULT hres = S_FALSE;
+
+ if(iPartId == BP_GROUPBOX)
+ {
+ if(!DrawEdge(hdc, (LPRECT)pRect, EDGE_ETCHED, BF_RECT))
+ hres = HRESULT_FROM_WIN32(GetLastError());
+
+ hres = S_OK;
+ }
+ else if(iPartId == BP_PUSHBUTTON && iStateId == PBS_DEFAULTED)
+ {
+ RECT rcSave = *pRect;
+
+ for(;;)
+ {
+ if(!FillRect(hdc, &rcSave, (HBRUSH)(COLOR_WINDOWFRAME + 1))) break;
+ if(!InflateRect(&rcSave, -1, -1)) break;
+ if(!DrawFrameControl(hdc, &rcSave, DFC_BUTTON, DFCS_BUTTONPUSH)) break;
+ hres = S_OK;
+ break;
+ }
+
+ if(hres != S_OK) hres = HRESULT_FROM_WIN32(GetLastError());
+ }
+
+ return hres;
+}
+
STDAPI Button_DrawBackground
(
struct UXTHEME_DATA_ * pData,
@@ -84,19 +120,38 @@ STDAPI Button_DrawBackground
{
UINT uState = 0;
HRGN hrgnSave;
- HRESULT hres;
+ HRESULT hres = S_OK;
- if(!Button_IsPartDefined(pData, iPartId, iStateId)) return E_FAIL;
+ /*UxTheme_Trace(("[ Button_DrawBackground"));*/
- uState = Button_Part_State[iPartId - 1][iStateId - 1];
+ for(;;)
+ {
+ if(!Button_IsPartDefined(pData, iPartId, iStateId))
+ {
+ hres = HRESULT_FROM_WIN32(ERROR_NOT_FOUND);
+ break;
+ }
- if(pClipRect && FAILED(hres = UxTheme_ClipDc(hdc, pClipRect, &hrgnSave)))
- return hres;
+ uState = Button_Part_State[iPartId - 1][iStateId - 1];
- if(!DrawFrameControl(hdc, (LPRECT)pRect, DFC_BUTTON, uState))
- hres = HRESULT_FROM_WIN32(GetLastError());
+ if(pClipRect && FAILED(hres = UxTheme_ClipDc(hdc, pClipRect, &hrgnSave)))
+ break;
- if(pClipRect) UxTheme_UnclipDc(hdc, hrgnSave);
+ hres = Button_DrawBackgroundSpecial(pData, hdc, iPartId, iStateId, pRect);
+
+ if(hres != S_FALSE) break;
+
+ hres = S_OK;
+
+ if(!DrawFrameControl(hdc, (LPRECT)pRect, DFC_BUTTON, uState))
+ hres = HRESULT_FROM_WIN32(GetLastError());
+
+ if(pClipRect) UxTheme_UnclipDc(hdc, hrgnSave);
+
+ break;
+ }
+
+ /*UxTheme_Trace(("] Button_DrawBackground (status %X)", hres));*/
return hres;
}
@@ -169,18 +224,8 @@ STDAPI_(BOOL) Button_IsPartDefined
break;
case BP_GROUPBOX:
- switch(iStateId)
- {
- case GBS_NORMAL:
- case GBS_DISABLED:
- break;
-
- default:
- return FALSE;
- }
-
break;
-
+
case BP_USERBUTTON:
default:
return FALSE;
@@ -189,5 +234,12 @@ STDAPI_(BOOL) Button_IsPartDefined
return TRUE;
}
+/* Initialization */
+#if 0
+STDAPI Button_Initialize(void)
+{
+}
+#endif
+
/* EOF */
diff --git a/reactos/lib/uxtheme/uxtheme.bpr b/reactos/lib/uxtheme/uxtheme.bpr
index bd03c8c923f..bee5c2fa03a 100644
--- a/reactos/lib/uxtheme/uxtheme.bpr
+++ b/reactos/lib/uxtheme/uxtheme.bpr
@@ -33,8 +33,8 @@
-
+
@@ -94,7 +94,7 @@ RunParams=
Launcher=
UseLauncher=0
DebugCWD=
-HostApplication=.\CustomControlSample.exe
+HostApplication=D:\misc\cvsroot\reactos\reactos\lib\uxtheme\XPThemeExplorer6.exe
RemoteHost=
RemotePath=
RemoteLauncher=
diff --git a/reactos/lib/uxtheme/uxtheme.def b/reactos/lib/uxtheme/uxtheme.def
index e11cb1537cc..6c5d85d77ad 100644
--- a/reactos/lib/uxtheme/uxtheme.def
+++ b/reactos/lib/uxtheme/uxtheme.def
@@ -84,7 +84,7 @@ DrawThemeParentBackground @38
;GetThemeTextMetrics @80
;GetWindowTheme @81
;HitTestThemeBackground @82
-;IsAppThemed @83
+IsAppThemed @83
;IsThemeActive @84
IsThemeBackgroundPartiallyTransparent @85
;IsThemeDialogTextureEnabled @86
diff --git a/reactos/lib/uxtheme/uxthemedll.c b/reactos/lib/uxtheme/uxthemedll.c
index c267dfc2f4c..e42f78d825c 100644
--- a/reactos/lib/uxtheme/uxthemedll.c
+++ b/reactos/lib/uxtheme/uxthemedll.c
@@ -161,6 +161,11 @@ THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent
return FALSE;
}
+THEMEAPI_(BOOL) IsAppThemed(void)
+{
+ return TRUE;
+}
+
THEMEAPI_(HTHEME) OpenThemeData
(
HWND hwnd,
@@ -170,6 +175,7 @@ THEMEAPI_(HTHEME) OpenThemeData
PUXTHEME_DATA pUxTheme;
PCUXTHEME_VTABLE pvt;
+ /* FIXME: support class lists */
if(_wcsicmp(pszClassList, L"Button") == 0) pvt = &Button_Vt;
else return NULL;