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

Method ShowMenu

src/AdornedRulerPanel.cpp:2216–2269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2214// Pop-up menus
2215
2216void AdornedRulerPanel::ShowMenu(const wxPoint & pos)
2217{
2218 const auto &viewInfo = ViewInfo::Get( *GetProject() );
2219 const auto &playRegion = viewInfo.playRegion;
2220 wxMenu rulerMenu;
2221
2222 {
2223 auto item = rulerMenu.AppendRadioItem(OnMinutesAndSecondsID,
2224 _("Minutes and Seconds"));
2225 item->Check(mTimeDisplayMode == TimeDisplayMode::MinutesAndSeconds);
2226 }
2227
2228 {
2229 auto item = rulerMenu.AppendRadioItem(OnBeatsAndMeasuresID,
2230 _("Beats and Measures"));
2231 item->Check(mTimeDisplayMode == TimeDisplayMode::BeatsAndMeasures);
2232 }
2233
2234 rulerMenu.AppendSeparator();
2235
2236 auto pDrag = rulerMenu.AppendCheckItem(OnSyncQuickPlaySelID, _("Setting a loop region also makes an audio selection"));
2237 pDrag->Check(mPlayRegionDragsSelection && playRegion.Active());
2238 pDrag->Enable(playRegion.Active());
2239
2240 {
2241 auto item = rulerMenu.AppendCheckItem(OnTogglePlayRegionID,
2242 LoopToggleText.Stripped().Translation());
2243 item->Check(playRegion.Active());
2244 }
2245
2246 {
2247 auto item = rulerMenu.Append(OnClearPlayRegionID,
2248 /* i18n-hint Clear is a verb */
2249 _("Clear Loop"));
2250 }
2251
2252 {
2253 auto item = rulerMenu.Append(OnSetPlayRegionToSelectionID,
2254 _("Set Loop To Selection"));
2255 }
2256
2257 rulerMenu.AppendSeparator();
2258
2259 rulerMenu.AppendCheckItem(OnAutoScrollID, _("Scroll view to playhead"))->
2260 Check(mViewInfo->bUpdateTrackIndicator);
2261
2262 rulerMenu.AppendCheckItem(OnTogglePinnedStateID, _("Continuous scrolling"))->
2263 Check(TracksPrefs::GetPinnedHeadPreference());
2264
2265 BasicMenu::Handle{ &rulerMenu }.Popup(
2266 wxWidgetsWindowPlacement{ this },
2267 { pos.x, pos.y }
2268 );
2269}
2270
2271void AdornedRulerPanel::ShowScrubMenu(const wxPoint & pos)
2272{

Callers

nothing calls this directly

Calls 7

GetFunction · 0.85
TranslationMethod · 0.80
StrippedMethod · 0.80
CheckMethod · 0.45
EnableMethod · 0.45
AppendMethod · 0.45
PopupMethod · 0.45

Tested by

no test coverage detected