| 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 | { |