MCPcopy Create free account
hub / github.com/audacity/audacity / GetSelections

Method GetSelections

src/PluginDataViewCtrl.cpp:363–393  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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 {

Callers 1

ActivateCellMethod · 0.45

Calls 5

wxVariantClass · 0.50
IsEmptyMethod · 0.45
sizeMethod · 0.45
GetCountMethod · 0.45
AppendMethod · 0.45

Tested by

no test coverage detected