| 215 | } |
| 216 | |
| 217 | void Window::ListAddItem(const std::vector<std::wstring>& items) { |
| 218 | LVITEM lvi = {0}; |
| 219 | lvi.mask = LVIF_TEXT; |
| 220 | lvi.pszText = const_cast<wchar_t*>(items[0].c_str()); |
| 221 | |
| 222 | int ret = ListView_InsertItem(handle_, &lvi); |
| 223 | if (ret < 0) { |
| 224 | std::stringstream buf; |
| 225 | buf << "Can not add list item, error code: " << GetLastError(); |
| 226 | throw DriverException(buf.str()); |
| 227 | } |
| 228 | |
| 229 | for (size_t i = 1; i < items.size(); ++i) { |
| 230 | ListView_SetItemText(handle_, ret, static_cast<int>(i), |
| 231 | const_cast<wchar_t*>(items[i].c_str())); |
| 232 | } |
| 233 | } |
| 234 | |
| 235 | void Window::ListDeleteSelectedItem() { |
| 236 | const int row_index = ListView_GetSelectionMark(handle_); |
no test coverage detected