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

Method GetDefaultAction

src/PluginDataViewCtrl.cpp:312–338  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310 }
311
312 wxAccStatus GetDefaultAction(int childId, wxString* action) override
313 {
314 const auto ctrl = GetCtrl();
315 wxCHECK(ctrl, wxACC_FAIL);
316
317 action->clear();
318
319 if(childId == wxACC_SELF)
320 return wxACC_OK;
321
322 const auto model = GetModel();
323 if(model == nullptr)
324 return wxACC_INVALID_ARG;
325
326 const auto item = ctrl->GetItemByRow(childId - 1);
327
328 if(!item.IsOk())
329 return wxACC_INVALID_ARG;
330
331 wxVariant enabled;
332 model->GetValue(enabled, item, PluginDataModel::ColumnState);
333 *action = enabled.GetBool()
334 ? _("Disable")
335 : _("Enable");
336
337 return wxACC_OK;
338 }
339
340 wxAccStatus DoDefaultAction(int childId) override
341 {

Callers

nothing calls this directly

Calls 4

GetBoolMethod · 0.80
clearMethod · 0.45
IsOkMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected