| 211 | |
| 212 | |
| 213 | void SelectionBar::AddTime(int id, wxSizer * pSizer) |
| 214 | { |
| 215 | auto &formats = ProjectNumericFormats::Get(mProject); |
| 216 | auto formatName = formats.GetSelectionFormat(); |
| 217 | auto pCtrl = safenew NumericTextCtrl(FormatterContext::ProjectContext(mProject), |
| 218 | this, id, NumericConverterType_TIME(), formatName, 0.0); |
| 219 | |
| 220 | pCtrl->Bind( |
| 221 | wxEVT_TEXT, |
| 222 | [this, id](auto& evt) { ModifySelection(id, evt.GetInt() != 0); }); |
| 223 | |
| 224 | pSizer->Add(pCtrl, 0, wxALIGN_TOP | wxRIGHT, 5); |
| 225 | |
| 226 | mTimeControls[id] = pCtrl; |
| 227 | |
| 228 | mFormatChangedToFitValueSubscription[id] = pCtrl->Subscribe( |
| 229 | [this, id](const auto& msg) |
| 230 | { |
| 231 | auto altCtrl = mTimeControls[id == 0 ? 1 : 0]; |
| 232 | if (altCtrl != nullptr) |
| 233 | altCtrl->UpdateFormatToFit(msg.value); |
| 234 | |
| 235 | FitToTimeControls(); |
| 236 | }); |
| 237 | } |
| 238 | |
| 239 | void SelectionBar::AddSelectionSetupButton(wxSizer* pSizer) |
| 240 | { |
nothing calls this directly
no test coverage detected