MCPcopy Create free account
hub / github.com/cinience/RedisStudio / SetAttribute

Method SetAttribute

DuiLib/Control/UICombo.cpp:786–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

784}
785
786void CComboUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue)
787{
788 if( _tcscmp(pstrName, _T("textpadding")) == 0 ) {
789 RECT rcTextPadding = { 0 };
790 LPTSTR pstr = NULL;
791 rcTextPadding.left = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr);
792 rcTextPadding.top = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
793 rcTextPadding.right = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
794 rcTextPadding.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
795 SetTextPadding(rcTextPadding);
796 }
797 else if( _tcscmp(pstrName, _T("normalimage")) == 0 ) SetNormalImage(pstrValue);
798 else if( _tcscmp(pstrName, _T("hotimage")) == 0 ) SetHotImage(pstrValue);
799 else if( _tcscmp(pstrName, _T("pushedimage")) == 0 ) SetPushedImage(pstrValue);
800 else if( _tcscmp(pstrName, _T("focusedimage")) == 0 ) SetFocusedImage(pstrValue);
801 else if( _tcscmp(pstrName, _T("disabledimage")) == 0 ) SetDisabledImage(pstrValue);
802 else if( _tcscmp(pstrName, _T("dropbox")) == 0 ) SetDropBoxAttributeList(pstrValue);
803 else if( _tcscmp(pstrName, _T("dropboxsize")) == 0)
804 {
805 SIZE szDropBoxSize = { 0 };
806 LPTSTR pstr = NULL;
807 szDropBoxSize.cx = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr);
808 szDropBoxSize.cy = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
809 SetDropBoxSize(szDropBoxSize);
810 }
811 else if( _tcscmp(pstrName, _T("itemfont")) == 0 ) m_ListInfo.nFont = _ttoi(pstrValue);
812 else if( _tcscmp(pstrName, _T("itemalign")) == 0 ) {
813 if( _tcsstr(pstrValue, _T("left")) != NULL ) {
814 m_ListInfo.uTextStyle &= ~(DT_CENTER | DT_RIGHT);
815 m_ListInfo.uTextStyle |= DT_LEFT;
816 }
817 if( _tcsstr(pstrValue, _T("center")) != NULL ) {
818 m_ListInfo.uTextStyle &= ~(DT_LEFT | DT_RIGHT);
819 m_ListInfo.uTextStyle |= DT_CENTER;
820 }
821 if( _tcsstr(pstrValue, _T("right")) != NULL ) {
822 m_ListInfo.uTextStyle &= ~(DT_LEFT | DT_CENTER);
823 m_ListInfo.uTextStyle |= DT_RIGHT;
824 }
825 }
826 if( _tcscmp(pstrName, _T("itemtextpadding")) == 0 ) {
827 RECT rcTextPadding = { 0 };
828 LPTSTR pstr = NULL;
829 rcTextPadding.left = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr);
830 rcTextPadding.top = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
831 rcTextPadding.right = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
832 rcTextPadding.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr);
833 SetItemTextPadding(rcTextPadding);
834 }
835 else if( _tcscmp(pstrName, _T("itemtextcolor")) == 0 ) {
836 if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
837 LPTSTR pstr = NULL;
838 DWORD clrColor = _tcstoul(pstrValue, &pstr, 16);
839 SetItemTextColor(clrColor);
840 }
841 else if( _tcscmp(pstrName, _T("itembkcolor")) == 0 ) {
842 if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue);
843 LPTSTR pstr = NULL;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected