void CEditUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if( _tcscmp(pstrName, _T("readonly")) == 0 ) SetReadOnly(_tcscmp(pstrValue, _T("true")) == 0); else if( _tcscmp(pstrName, _T("password")) == 0 ) SetPasswordMode(_tcscmp(pstrValue, _T("true")) == 0); else if( _tcscmp(pstrName, _T("maxchar")) == 0 ) SetMaxChar(_ttoi(pstrValue)); else if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue); else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue); else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue); else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue); else if( _tcscmp(pstrName, _T("nativebkcolor")) == 0 ) { if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetNativeEditBkColor(clrColor); } else if (_tcscmp(pstrName, _T("autocompletemode")) == 0) { if (_tcscmp(pstrValue, _T("None")) == 0) SetAutoCompleteMode(None); else if (_tcscmp(pstrValue, _T("Append")) == 0) SetAutoCompleteMode(Append); else if (_tcscmp(pstrValue, _T("Suggest")) == 0) SetAutoCompleteMode(Suggest); else if (_tcscmp(pstrValue, _T("SuggestAppend")) == 0) SetAutoCompleteMode(SuggestAppend); } else CLabelUI::SetAttribute(pstrName, pstrValue); }
void BUIEdit::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) { if (_tcscmp(pstrName, _T("readonly")) == 0) { SetReadOnly(_tcscmp(pstrValue, _T("true")) == 0); } else if (_tcscmp(pstrName, _T("numberonly")) == 0) { SetNumberOnly(_tcscmp(pstrValue, _T("true")) == 0); } else if (_tcscmp(pstrName, _T("password")) == 0) { SetPasswordMode(_tcscmp(pstrValue, _T("true")) == 0); } else if (_tcscmp(pstrName, _T("maxchar")) == 0) { SetMaxChar(_ttoi(pstrValue)); } else if ( _tcscmp(pstrName, _T("normalimage")) == 0) { SetNormalImage(pstrValue); } else if (_tcscmp(pstrName, _T("hotimage")) == 0) { SetHotImage(pstrValue); } else if (_tcscmp(pstrName, _T("focusedimage")) == 0) { SetFocusedImage(pstrValue); } else if (_tcscmp(pstrName, _T("disabledimage")) == 0) { SetDisabledImage(pstrValue); } else if (_tcscmp(pstrName, _T("nativebkcolor")) == 0) { if (*pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); LPTSTR pstr = NULL; DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); SetNativeEditBkColor(clrColor); } BUILabel::SetAttribute(pstrName, pstrValue); }