| 361 | } |
| 362 | |
| 363 | wxAccStatus GetSelections(wxVariant* selections) override |
| 364 | { |
| 365 | const auto ctrl = GetCtrl(); |
| 366 | wxCHECK(ctrl, wxACC_FAIL); |
| 367 | |
| 368 | wxDataViewItemArray sel; |
| 369 | ctrl->GetSelections(sel); |
| 370 | |
| 371 | if(sel.IsEmpty()) |
| 372 | { |
| 373 | selections->MakeNull(); |
| 374 | return wxACC_OK; |
| 375 | } |
| 376 | |
| 377 | if(sel.size() == 1) |
| 378 | { |
| 379 | const auto row = ctrl->GetRowByItem(sel[0]); |
| 380 | *selections = static_cast<wxLongLong>(row + 1); |
| 381 | } |
| 382 | else |
| 383 | { |
| 384 | wxVariant list(wxVariantList{}); |
| 385 | for(size_t i = 0; i < sel.GetCount(); ++i) |
| 386 | { |
| 387 | const auto row = ctrl->GetRowByItem(sel[i]); |
| 388 | list.Append(wxVariant(static_cast<wxLongLong>(row + 1))); |
| 389 | } |
| 390 | *selections = list; |
| 391 | } |
| 392 | return wxACC_OK; |
| 393 | } |
| 394 | |
| 395 | wxAccStatus GetState(int childId, long* state) override |
| 396 | { |