| 2067 | } |
| 2068 | |
| 2069 | void CRichEditUI::SetAttribute(LPCTSTR pstrName, LPCTSTR pstrValue) |
| 2070 | { |
| 2071 | if( _tcscmp(pstrName, _T("vscrollbar")) == 0 ) { |
| 2072 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_lTwhStyle |= ES_DISABLENOSCROLL | WS_VSCROLL; |
| 2073 | } |
| 2074 | if( _tcscmp(pstrName, _T("autovscroll")) == 0 ) { |
| 2075 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_lTwhStyle |= ES_AUTOVSCROLL; |
| 2076 | } |
| 2077 | else if( _tcscmp(pstrName, _T("hscrollbar")) == 0 ) { |
| 2078 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_lTwhStyle |= ES_DISABLENOSCROLL | WS_HSCROLL; |
| 2079 | } |
| 2080 | if( _tcscmp(pstrName, _T("autohscroll")) == 0 ) { |
| 2081 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_lTwhStyle |= ES_AUTOHSCROLL; |
| 2082 | } |
| 2083 | else if( _tcscmp(pstrName, _T("wanttab")) == 0 ) { |
| 2084 | SetWantTab(_tcscmp(pstrValue, _T("true")) == 0); |
| 2085 | } |
| 2086 | else if( _tcscmp(pstrName, _T("wantreturn")) == 0 ) { |
| 2087 | SetWantReturn(_tcscmp(pstrValue, _T("true")) == 0); |
| 2088 | } |
| 2089 | else if( _tcscmp(pstrName, _T("wantctrlreturn")) == 0 ) { |
| 2090 | SetWantCtrlReturn(_tcscmp(pstrValue, _T("true")) == 0); |
| 2091 | } |
| 2092 | else if( _tcscmp(pstrName, _T("rich")) == 0 ) { |
| 2093 | SetRich(_tcscmp(pstrValue, _T("true")) == 0); |
| 2094 | } |
| 2095 | else if( _tcscmp(pstrName, _T("multiline")) == 0 ) { |
| 2096 | if( _tcscmp(pstrValue, _T("false")) == 0 ) m_lTwhStyle &= ~ES_MULTILINE; |
| 2097 | } |
| 2098 | else if( _tcscmp(pstrName, _T("readonly")) == 0 ) { |
| 2099 | if( _tcscmp(pstrValue, _T("true")) == 0 ) { m_lTwhStyle |= ES_READONLY; m_bReadOnly = true; } |
| 2100 | } |
| 2101 | else if( _tcscmp(pstrName, _T("password")) == 0 ) { |
| 2102 | if( _tcscmp(pstrValue, _T("true")) == 0 ) m_lTwhStyle |= ES_PASSWORD; |
| 2103 | } |
| 2104 | else if( _tcscmp(pstrName, _T("align")) == 0 ) { |
| 2105 | if( _tcsstr(pstrValue, _T("left")) != NULL ) { |
| 2106 | m_lTwhStyle &= ~(ES_CENTER | ES_RIGHT); |
| 2107 | m_lTwhStyle |= ES_LEFT; |
| 2108 | } |
| 2109 | if( _tcsstr(pstrValue, _T("center")) != NULL ) { |
| 2110 | m_lTwhStyle &= ~(ES_LEFT | ES_RIGHT); |
| 2111 | m_lTwhStyle |= ES_CENTER; |
| 2112 | } |
| 2113 | if( _tcsstr(pstrValue, _T("right")) != NULL ) { |
| 2114 | m_lTwhStyle &= ~(ES_LEFT | ES_CENTER); |
| 2115 | m_lTwhStyle |= ES_RIGHT; |
| 2116 | } |
| 2117 | } |
| 2118 | else if( _tcscmp(pstrName, _T("font")) == 0 ) SetFont(_ttoi(pstrValue)); |
| 2119 | else if( _tcscmp(pstrName, _T("textcolor")) == 0 ) { |
| 2120 | while( *pstrValue > _T('\0') && *pstrValue <= _T(' ') ) pstrValue = ::CharNext(pstrValue); |
| 2121 | if( *pstrValue == _T('#')) pstrValue = ::CharNext(pstrValue); |
| 2122 | LPTSTR pstr = NULL; |
| 2123 | DWORD clrColor = _tcstoul(pstrValue, &pstr, 16); |
| 2124 | SetTextColor(clrColor); |
| 2125 | } |
| 2126 | else CContainerUI::SetAttribute(pstrName, pstrValue); |
nothing calls this directly
no outgoing calls
no test coverage detected