| 411 | } |
| 412 | |
| 413 | void SnappingToolBar::OnSnapModeChanged() |
| 414 | { |
| 415 | const bool snapEnabled = mSnapModeCheckBox->GetValue(); |
| 416 | |
| 417 | ProjectSnap::Get(mProject).SetSnapMode( |
| 418 | snapEnabled ? SnapMode::SNAP_NEAREST : SnapMode::SNAP_OFF); |
| 419 | |
| 420 | mSnapToCombo->Enable(snapEnabled); |
| 421 | |
| 422 | |
| 423 | // wxEVT_KILL_FOCUS is not always sent by wxWidgets. |
| 424 | // Remove any selection from the combo box if we've disabled it. |
| 425 | if (!snapEnabled) |
| 426 | mSnapToCombo->SelectNone(); |
| 427 | } |
| 428 | |
| 429 | static RegisteredToolbarFactory factory{ |
| 430 | []( AudacityProject &project ){ |
nothing calls this directly
no test coverage detected