diff --git a/DuiLib/Control/UIButton.cpp b/DuiLib/Control/UIButton.cpp
index 81772816..f34b77d7 100644
--- a/DuiLib/Control/UIButton.cpp
+++ b/DuiLib/Control/UIButton.cpp
@@ -8,8 +8,9 @@ namespace DuiLib
, m_dwHotTextColor(0)
, m_dwPushedTextColor(0)
, m_dwFocusedTextColor(0)
- ,m_dwHotBkColor(0)
- ,m_iBindTabIndex(-1)
+ , m_dwHotBkColor(0)
+ , m_dwPushedBkColor(0)
+ , m_iBindTabIndex(-1)
{
m_uTextStyle = DT_SINGLELINE | DT_VCENTER | DT_CENTER;
}
@@ -139,6 +140,16 @@ namespace DuiLib
{
return m_dwHotBkColor;
}
+
+ void CButtonUI::SetPushedBkColor( DWORD dwColor )
+ {
+ m_dwPushedBkColor = dwColor;
+ }
+
+ DWORD CButtonUI::GetPushedBkColor() const
+ {
+ return m_dwPushedBkColor;
+ }
void CButtonUI::SetHotTextColor(DWORD dwColor)
{
@@ -311,6 +322,13 @@ namespace DuiLib
DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
SetHotBkColor(clrColor);
}
+ else if( _tcscmp(pstrName, _T("pushedbkcolor")) == 0 )
+ {
+ if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
+ LPTSTR pstr = NULL;
+ DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
+ SetPushedBkColor(clrColor);
+ }
else if( _tcscmp(pstrName, _T("hottextcolor")) == 0 )
{
if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
@@ -410,6 +428,10 @@ namespace DuiLib
}
else goto Label_ForeImage;
}
+ else if(m_dwPushedBkColor != 0) {
+ CRenderEngine::DrawColor(hDC, m_rcPaint, GetAdjustColor(m_dwPushedBkColor));
+ return;
+ }
}
else if( (m_uButtonState & UISTATE_HOT) != 0 ) {
if( !m_sHotImage.IsEmpty() ) {
diff --git a/DuiLib/Control/UIButton.h b/DuiLib/Control/UIButton.h
index 42392159..00654d02 100644
--- a/DuiLib/Control/UIButton.h
+++ b/DuiLib/Control/UIButton.h
@@ -42,6 +42,8 @@ namespace DuiLib
void SetHotBkColor(DWORD dwColor);
DWORD GetHotBkColor() const;
+ void SetPushedBkColor(DWORD dwColor);
+ DWORD GetPushedBkColor() const;
void SetHotTextColor(DWORD dwColor);
DWORD GetHotTextColor() const;
void SetPushedTextColor(DWORD dwColor);
@@ -58,6 +60,7 @@ namespace DuiLib
UINT m_uButtonState;
DWORD m_dwHotBkColor;
+ DWORD m_dwPushedBkColor;
DWORD m_dwHotTextColor;
DWORD m_dwPushedTextColor;
DWORD m_dwFocusedTextColor;
diff --git a/bin/skin/duidemo/main.xml b/bin/skin/duidemo/main.xml
index e27ab09b..533f16f3 100644
--- a/bin/skin/duidemo/main.xml
+++ b/bin/skin/duidemo/main.xml
@@ -45,6 +45,7 @@
+