-------------------------------------------------------------------------------
| 184 | |
| 185 | //------------------------------------------------------------------------------- |
| 186 | void CLogWindow::WriteLine(const char *message) { |
| 187 | this->szPlainText.append(message); |
| 188 | this->szPlainText.append("\r\n"); |
| 189 | |
| 190 | if (0 != this->szText.length()) { |
| 191 | this->szText.resize(this->szText.length() - 1); |
| 192 | } |
| 193 | |
| 194 | switch (message[0]) { |
| 195 | case 'e': |
| 196 | case 'E': |
| 197 | this->szText.append("{\\pard \\cf1 \\b \\fs18 "); |
| 198 | break; |
| 199 | case 'w': |
| 200 | case 'W': |
| 201 | this->szText.append("{\\pard \\cf2 \\b \\fs18 "); |
| 202 | break; |
| 203 | case 'i': |
| 204 | case 'I': |
| 205 | this->szText.append("{\\pard \\cf3 \\b \\fs18 "); |
| 206 | break; |
| 207 | case 'd': |
| 208 | case 'D': |
| 209 | this->szText.append("{\\pard \\cf4 \\b \\fs18 "); |
| 210 | break; |
| 211 | default: |
| 212 | this->szText.append("{\\pard \\cf5 \\b \\fs18 "); |
| 213 | break; |
| 214 | } |
| 215 | |
| 216 | std::string _message = message; |
| 217 | for (unsigned int i = 0; i < _message.length(); ++i) { |
| 218 | if ('\\' == _message[i] || |
| 219 | '}' == _message[i] || |
| 220 | '{' == _message[i]) { |
| 221 | _message.insert(i++, "\\"); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | this->szText.append(_message); |
| 226 | this->szText.append("\\par}}"); |
| 227 | |
| 228 | if (this->bIsVisible && this->bUpdate) { |
| 229 | SETTEXTEX sInfo = {}; |
| 230 | sInfo.flags = ST_DEFAULT; |
| 231 | sInfo.codepage = CP_ACP; |
| 232 | |
| 233 | SendDlgItemMessage(this->hwnd, IDC_EDIT1, |
| 234 | EM_SETTEXTEX, (WPARAM)&sInfo, (LPARAM)this->szText.c_str()); |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | } // namespace AssimpView |
no test coverage detected