MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / OnRButtonUp

Method OnRButtonUp

Source/FamiTrackerView.cpp:591–631  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589// Mouse
590
591void CFamiTrackerView::OnRButtonUp(UINT nFlags, CPoint point)
592{
593 // Popup menu
594 CRect WinRect;
595 CMenu *pPopupMenu, PopupMenuBar;
596
597 if (m_pPatternEditor->CancelDragging()) {
598 InvalidateCursor();
599 CView::OnRButtonUp(nFlags, point);
600 return;
601 }
602
603 m_pPatternEditor->OnMouseRDown(point);
604
605 GetWindowRect(WinRect);
606
607 if (m_pPatternEditor->IsOverHeader(point)) {
608 // Pattern header
609 m_iMenuChannel = TranslateChannel(m_pPatternEditor->GetChannelAtPoint(point.x)); // // //
610 PopupMenuBar.LoadMenuW(IDR_PATTERN_HEADER_POPUP);
611 FTEnv.GetMainFrame()->UpdateMenu(&PopupMenuBar);
612 pPopupMenu = PopupMenuBar.GetSubMenu(0);
613 pPopupMenu->EnableMenuItem(ID_TRACKER_RECORDTOINST, FTEnv.GetSoundGenerator()->IsPlaying() ? MFS_DISABLED : MFS_ENABLED); // // //
614 pPopupMenu->EnableMenuItem(ID_TRACKER_RECORDERSETTINGS, FTEnv.GetSoundGenerator()->IsPlaying() ? MFS_DISABLED : MFS_ENABLED); // // //
615 CMenu *pMeterMenu = pPopupMenu->GetSubMenu(6); // // // 050B
616 decay_rate_t Rate = FTEnv.GetSoundGenerator()->GetMeterDecayRate();
617 pMeterMenu->CheckMenuItem(Rate == decay_rate_t::Fast ? ID_DECAY_FAST : ID_DECAY_SLOW, MF_CHECKED | MF_BYCOMMAND);
618 pPopupMenu->TrackPopupMenu(TPM_RIGHTBUTTON, point.x + WinRect.left, point.y + WinRect.top, this);
619 }
620 else if (m_pPatternEditor->IsOverPattern(point)) { // // // 050B todo
621 // Pattern area
622 m_iMenuChannel = { };
623 PopupMenuBar.LoadMenuW(IDR_PATTERN_POPUP);
624 FTEnv.GetMainFrame()->UpdateMenu(&PopupMenuBar);
625 pPopupMenu = PopupMenuBar.GetSubMenu(0);
626 // Send messages to parent in order to get the menu options working
627 pPopupMenu->TrackPopupMenu(TPM_RIGHTBUTTON, point.x + WinRect.left, point.y + WinRect.top, GetParentFrame());
628 }
629
630 CView::OnRButtonUp(nFlags, point);
631}
632
633void CFamiTrackerView::OnLButtonDown(UINT nFlags, CPoint point)
634{

Callers

nothing calls this directly

Calls 10

CancelDraggingMethod · 0.80
OnMouseRDownMethod · 0.80
IsOverHeaderMethod · 0.80
GetChannelAtPointMethod · 0.80
UpdateMenuMethod · 0.80
IsOverPatternMethod · 0.80
GetMainFrameMethod · 0.45
IsPlayingMethod · 0.45
GetSoundGeneratorMethod · 0.45
GetMeterDecayRateMethod · 0.45

Tested by

no test coverage detected