mirror of
https://github.com/reactos/reactos.git
synced 2024-08-30 07:08:19 +00:00
Unstyled BUTTON class done, 25 more to go...
svn path=/trunk/; revision=6539
This commit is contained in:
parent
8eb8bd42c6
commit
1b7b04aa07
|
@ -11,3 +11,4 @@
|
||||||
*.res
|
*.res
|
||||||
*.tds
|
*.tds
|
||||||
*.lib
|
*.lib
|
||||||
|
*.xml
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
*.o
|
*.o
|
||||||
*.sym
|
*.sym
|
||||||
*.obj
|
*.obj
|
||||||
|
*.~*
|
||||||
|
|
|
@ -31,10 +31,10 @@ static const UINT Button_PushButton_State[] =
|
||||||
DFCS_BUTTONPUSH | DFCS_HOT, /* PBS_HOT */
|
DFCS_BUTTONPUSH | DFCS_HOT, /* PBS_HOT */
|
||||||
DFCS_BUTTONPUSH | DFCS_PUSHED, /* PBS_PRESSED */
|
DFCS_BUTTONPUSH | DFCS_PUSHED, /* PBS_PRESSED */
|
||||||
DFCS_BUTTONPUSH | DFCS_INACTIVE /* PBS_DISABLED */
|
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[] =
|
static const UINT Button_RadioButton_State[] =
|
||||||
{
|
{
|
||||||
DFCS_BUTTONRADIO, /* RBS_UNCHECKEDNORMAL */
|
DFCS_BUTTONRADIO, /* RBS_UNCHECKEDNORMAL */
|
||||||
|
@ -47,31 +47,67 @@ static const UINT Button_RadioButton_State[] =
|
||||||
DFCS_BUTTONRADIO | DFCS_CHECKED | DFCS_INACTIVE /* RBS_CHECKEDDISABLED */
|
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[] =
|
static const UINT Button_CheckBox_State[] =
|
||||||
{
|
{
|
||||||
DFCS_BUTTONCHECK, /* CBS_UNCHECKEDNORMAL */
|
DFCS_BUTTONCHECK, /* CBS_UNCHECKEDNORMAL */
|
||||||
DFCS_BUTTONCHECK | DFCS_HOT, /* CBS_UNCHECKEDHOT */
|
DFCS_BUTTONCHECK | DFCS_HOT, /* CBS_UNCHECKEDHOT */
|
||||||
DFCS_BUTTONCHECK | DFCS_PUSHED, /* CBS_UNCHECKEDPRESSED */
|
DFCS_BUTTONCHECK | DFCS_PUSHED, /* CBS_UNCHECKEDPRESSED */
|
||||||
DFCS_BUTTONCHECK | DFCS_INACTIVE, /* CBS_UNCHECKEDDISABLED */
|
DFCS_BUTTONCHECK | DFCS_INACTIVE, /* CBS_UNCHECKEDDISABLED */
|
||||||
DFCS_BUTTONCHECK | DFCS_CHECKED, /* CBS_CHECKEDNORMAL */
|
DFCS_BUTTONCHECK | DFCS_CHECKED, /* CBS_CHECKEDNORMAL */
|
||||||
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT, /* CBS_CHECKEDHOT */
|
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_HOT, /* CBS_CHECKEDHOT */
|
||||||
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_PUSHED, /* CBS_CHECKEDPRESSED */
|
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_PUSHED, /* CBS_CHECKEDPRESSED */
|
||||||
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE /* CBS_CHECKEDDISABLED */
|
DFCS_BUTTONCHECK | DFCS_CHECKED | DFCS_INACTIVE, /* CBS_CHECKEDDISABLED */
|
||||||
/* TODO */ /* CBS_MIXEDNORMAL */
|
DFCS_BUTTON3STATE | DFCS_CHECKED, /* CBS_MIXEDNORMAL */
|
||||||
/* TODO */ /* CBS_MIXEDHOT */
|
DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_HOT, /* CBS_MIXEDHOT */
|
||||||
/* TODO */ /* CBS_MIXEDPRESSED */
|
DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_PUSHED, /* CBS_MIXEDPRESSED */
|
||||||
/* TODO */ /* CBS_MIXEDDISABLED */
|
DFCS_BUTTON3STATE | DFCS_CHECKED | DFCS_INACTIVE /* CBS_MIXEDDISABLED */
|
||||||
};
|
};
|
||||||
|
|
||||||
static UINT const * Button_Part_State[] =
|
static UINT const * Button_Part_State[] =
|
||||||
{
|
{
|
||||||
Button_PushButton_State,
|
Button_PushButton_State,
|
||||||
Button_RadioButton_State,
|
Button_RadioButton_State,
|
||||||
Button_CheckBox_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
|
STDAPI Button_DrawBackground
|
||||||
(
|
(
|
||||||
struct UXTHEME_DATA_ * pData,
|
struct UXTHEME_DATA_ * pData,
|
||||||
|
@ -84,19 +120,38 @@ STDAPI Button_DrawBackground
|
||||||
{
|
{
|
||||||
UINT uState = 0;
|
UINT uState = 0;
|
||||||
HRGN hrgnSave;
|
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)))
|
uState = Button_Part_State[iPartId - 1][iStateId - 1];
|
||||||
return hres;
|
|
||||||
|
|
||||||
if(!DrawFrameControl(hdc, (LPRECT)pRect, DFC_BUTTON, uState))
|
if(pClipRect && FAILED(hres = UxTheme_ClipDc(hdc, pClipRect, &hrgnSave)))
|
||||||
hres = HRESULT_FROM_WIN32(GetLastError());
|
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;
|
return hres;
|
||||||
}
|
}
|
||||||
|
@ -169,18 +224,8 @@ STDAPI_(BOOL) Button_IsPartDefined
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BP_GROUPBOX:
|
case BP_GROUPBOX:
|
||||||
switch(iStateId)
|
|
||||||
{
|
|
||||||
case GBS_NORMAL:
|
|
||||||
case GBS_DISABLED:
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BP_USERBUTTON:
|
case BP_USERBUTTON:
|
||||||
default:
|
default:
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -189,5 +234,12 @@ STDAPI_(BOOL) Button_IsPartDefined
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Initialization */
|
||||||
|
#if 0
|
||||||
|
STDAPI Button_Initialize(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
||||||
|
|
|
@ -33,8 +33,8 @@
|
||||||
<OTHERFILES value=""/>
|
<OTHERFILES value=""/>
|
||||||
</MACROS>
|
</MACROS>
|
||||||
<OPTIONS>
|
<OPTIONS>
|
||||||
<IDLCFLAGS value="-Inostyle -I.\include -I$(BCB)\include -I$(BCB)\include\vcl
|
<IDLCFLAGS value="-src_suffix cpp -D_DEBUG -Inostyle -I.\include -I$(BCB)\include
|
||||||
-I..\..\include -src_suffix cpp -D_DEBUG -boa"/>
|
-I$(BCB)\include\vcl -I..\..\include -boa"/>
|
||||||
<CFLAG1 value="-WD -Od -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi-
|
<CFLAG1 value="-WD -Od -H=$(BCB)\lib\vcl60.csm -Hc -Vx -Ve -X- -r- -a8 -b- -k -y -v -vi-
|
||||||
-tWD -tWM -c"/>
|
-tWD -tWM -c"/>
|
||||||
<PFLAGS value="-$YD -$W -$O- -$A8 -v -JPHNE -M"/>
|
<PFLAGS value="-$YD -$W -$O- -$A8 -v -JPHNE -M"/>
|
||||||
|
@ -94,7 +94,7 @@ RunParams=
|
||||||
Launcher=
|
Launcher=
|
||||||
UseLauncher=0
|
UseLauncher=0
|
||||||
DebugCWD=
|
DebugCWD=
|
||||||
HostApplication=.\CustomControlSample.exe
|
HostApplication=D:\misc\cvsroot\reactos\reactos\lib\uxtheme\XPThemeExplorer6.exe
|
||||||
RemoteHost=
|
RemoteHost=
|
||||||
RemotePath=
|
RemotePath=
|
||||||
RemoteLauncher=
|
RemoteLauncher=
|
||||||
|
|
|
@ -84,7 +84,7 @@ DrawThemeParentBackground @38
|
||||||
;GetThemeTextMetrics @80
|
;GetThemeTextMetrics @80
|
||||||
;GetWindowTheme @81
|
;GetWindowTheme @81
|
||||||
;HitTestThemeBackground @82
|
;HitTestThemeBackground @82
|
||||||
;IsAppThemed @83
|
IsAppThemed @83
|
||||||
;IsThemeActive @84
|
;IsThemeActive @84
|
||||||
IsThemeBackgroundPartiallyTransparent @85
|
IsThemeBackgroundPartiallyTransparent @85
|
||||||
;IsThemeDialogTextureEnabled @86
|
;IsThemeDialogTextureEnabled @86
|
||||||
|
|
|
@ -161,6 +161,11 @@ THEMEAPI_(BOOL) IsThemeBackgroundPartiallyTransparent
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
THEMEAPI_(BOOL) IsAppThemed(void)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
THEMEAPI_(HTHEME) OpenThemeData
|
THEMEAPI_(HTHEME) OpenThemeData
|
||||||
(
|
(
|
||||||
HWND hwnd,
|
HWND hwnd,
|
||||||
|
@ -170,6 +175,7 @@ THEMEAPI_(HTHEME) OpenThemeData
|
||||||
PUXTHEME_DATA pUxTheme;
|
PUXTHEME_DATA pUxTheme;
|
||||||
PCUXTHEME_VTABLE pvt;
|
PCUXTHEME_VTABLE pvt;
|
||||||
|
|
||||||
|
/* FIXME: support class lists */
|
||||||
if(_wcsicmp(pszClassList, L"Button") == 0) pvt = &Button_Vt;
|
if(_wcsicmp(pszClassList, L"Button") == 0) pvt = &Button_Vt;
|
||||||
else return NULL;
|
else return NULL;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue