| 660 | } |
| 661 | |
| 662 | void CListUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) |
| 663 | { |
| 664 | if( _tcscmp(pstrName, _T("header")) == 0 ) GetHeader()->SetVisible(_tcscmp(pstrValue, _T("hidden")) != 0); |
| 665 | else if( _tcscmp(pstrName, _T("headerbkimage")) == 0 ) GetHeader()->SetBkImage(pstrValue); |
| 666 | else if( _tcscmp(pstrName, _T("scrollselect")) == 0 ) SetScrollSelect(_tcscmp(pstrValue, _T("true")) == 0); |
| 667 | else if( _tcscmp(pstrName, _T("multiexpanding")) == 0 ) SetMultiExpanding(_tcscmp(pstrValue, _T("true")) == 0); |
| 668 | else if( _tcscmp(pstrName, _T("itemfont")) == 0 ) m_ListInfo.nFont = _ttoi(pstrValue); |
| 669 | else if( _tcscmp(pstrName, _T("itemalign")) == 0 ) { |
| 670 | if( _tcsstr(pstrValue, _T("left")) != NULL ) { |
| 671 | m_ListInfo.uTextStyle &= ~(DT_CENTER | DT_RIGHT); |
| 672 | m_ListInfo.uTextStyle |= DT_LEFT; |
| 673 | } |
| 674 | if( _tcsstr(pstrValue, _T("center")) != NULL ) { |
| 675 | m_ListInfo.uTextStyle &= ~(DT_LEFT | DT_RIGHT); |
| 676 | m_ListInfo.uTextStyle |= DT_CENTER; |
| 677 | } |
| 678 | if( _tcsstr(pstrValue, _T("right")) != NULL ) { |
| 679 | m_ListInfo.uTextStyle &= ~(DT_LEFT | DT_CENTER); |
| 680 | m_ListInfo.uTextStyle |= DT_RIGHT; |
| 681 | } |
| 682 | } |
| 683 | else if( _tcscmp(pstrName, _T("itemendellipsis")) == 0 ) { |
| 684 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_ListInfo.uTextStyle |= DT_END_ELLIPSIS; |
| 685 | else m_ListInfo.uTextStyle &= ~DT_END_ELLIPSIS; |
| 686 | } |
| 687 | if( _tcscmp(pstrName, _T("itemtextpadding")) == 0 ) { |
| 688 | RECT rcTextPadding = { 0 }; |
| 689 | LPTSTR pstr = NULL; |
| 690 | rcTextPadding.left = _tcstol(pstrValue, &pstr, 10); ASSERT(pstr); |
| 691 | rcTextPadding.top = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); |
| 692 | rcTextPadding.right = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); |
| 693 | rcTextPadding.bottom = _tcstol(pstr + 1, &pstr, 10); ASSERT(pstr); |
| 694 | SetItemTextPadding(rcTextPadding); |
| 695 | } |
| 696 | else if( _tcscmp(pstrName, _T("itemtextcolor")) == 0 ) { |
| 697 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); |
| 698 | LPTSTR pstr = NULL; |
| 699 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); |
| 700 | SetItemTextColor(clrColor); |
| 701 | } |
| 702 | else if( _tcscmp(pstrName, _T("itembkcolor")) == 0 ) { |
| 703 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); |
| 704 | LPTSTR pstr = NULL; |
| 705 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); |
| 706 | SetItemBkColor(clrColor); |
| 707 | } |
| 708 | else if( _tcscmp(pstrName, _T("itembkimage")) == 0 ) SetItemBkImage(pstrValue); |
| 709 | else if( _tcscmp(pstrName, _T("itemaltbk")) == 0 ) SetAlternateBk(_tcscmp(pstrValue, _T("true")) == 0); |
| 710 | else if( _tcscmp(pstrName, _T("itemselectedtextcolor")) == 0 ) { |
| 711 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); |
| 712 | LPTSTR pstr = NULL; |
| 713 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); |
| 714 | SetSelectedItemTextColor(clrColor); |
| 715 | } |
| 716 | else if( _tcscmp(pstrName, _T("itemselectedbkcolor")) == 0 ) { |
| 717 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); |
| 718 | LPTSTR pstr = NULL; |
| 719 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); |
nothing calls this directly
no test coverage detected