void CButtonUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue); else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue); else if( _tcscmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue); else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue); else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue); else if( _tcscmp(pstrName, _T("hottextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetHotTextColor(clrColor); } else if( _tcscmp(pstrName, _T("pushedtextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetPushedTextColor(clrColor); } else if( _tcscmp(pstrName, _T("focusedtextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetFocusedTextColor(clrColor); } else CLabelUI::SetAttribute(pstrName, pstrValue); }
void CButtonUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcsicmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue); else if( _tcsicmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue); else if( _tcsicmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue); else if( _tcsicmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue); else if( _tcsicmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue); else if( _tcsicmp(pstrName, _T("foreimage")) == 0 ) SetForeImage(pstrValue); else if( _tcsicmp(pstrName, _T("hotforeimage")) == 0 ) SetHotForeImage(pstrValue); else if( _tcsicmp(pstrName, _T("bindtabindex")) == 0 ) BindTabIndex(_ttoi(pstrValue)); else if( _tcsicmp(pstrName, _T("bindtablayoutname")) == 0 ) BindTabLayoutName(pstrValue); else if( _tcsicmp(pstrName, _T("hotbkcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetHotBkColor(clrColor); } else if( _tcsicmp(pstrName, _T("pushedbkcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetPushedBkColor(clrColor); } else if( _tcsicmp(pstrName, _T("hottextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetHotTextColor(clrColor); } else if( _tcsicmp(pstrName, _T("pushedtextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetPushedTextColor(clrColor); } else if( _tcsicmp(pstrName, _T("focusedtextcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetFocusedTextColor(clrColor); } else if( _tcsicmp(pstrName, _T("noprefix")) == 0 ) { if( _tcsicmp(pstrValue, _T("true")) == 0) { m_uTextStyle |= DT_NOPREFIX; } else { m_uTextStyle = m_uTextStyle & ~DT_NOPREFIX; } } else CLabelUI::SetAttribute(pstrName, pstrValue); }
void CUIButton::SetAttribute(LPCWSTR pstrName, LPCWSTR pstrValue) { if( wcscmp(pstrName, L"normalimage") == 0 ) SetNormalImage(pstrValue); else if( wcscmp(pstrName, L"hotimage") == 0 ) SetHotImage(pstrValue); else if( wcscmp(pstrName, L"pushedimage") == 0 ) SetPushedImage(pstrValue); else if( wcscmp(pstrName, L"focusedimage") == 0 ) SetFocusedImage(pstrValue); else if( wcscmp(pstrName, L"disabledimage") == 0 ) SetDisabledImage(pstrValue); else if( wcscmp(pstrName, L"foreimage") == 0 ) SetForeImage(pstrValue); else if( wcscmp(pstrName, L"hotforeimage") == 0 ) SetHotForeImage(pstrValue); else if( wcscmp(pstrName, L"hotbkcolor") == 0 ) { if(*pstrValue == L'#') pstrValue = pstrValue + 1; LPWSTR pstr = NULL; DWORD clrColor = wcstoul(pstrValue, &pstr, 16); SetHotBkColor(clrColor); } else if( wcscmp(pstrName, L"hottextcolor") == 0 ) { if(*pstrValue == L'#') pstrValue = /*::CharNext(pstrValue)*/pstrValue + 1; LPWSTR pstr = NULL; DWORD clrColor = wcstoul(pstrValue, &pstr, 16); SetHotTextColor(clrColor); } else if( wcscmp(pstrName, L"pushedtextcolor") == 0 ) { if(*pstrValue == L'#') pstrValue = /*::CharNext(pstrValue)*/pstrValue + 1; LPWSTR pstr = NULL; DWORD clrColor = wcstoul(pstrValue, &pstr, 16); SetPushedTextColor(clrColor); } else if( wcscmp(pstrName, L"focusedtextcolor") == 0 ) { if(*pstrValue == L'#') pstrValue = /*::CharNext(pstrValue)*/pstrValue + 1; LPWSTR pstr = NULL; DWORD clrColor = wcstoul(pstrValue, &pstr, 16); SetFocusedTextColor(clrColor); } else CUILabel::SetAttribute(pstrName, pstrValue); }