| 589 | // Mouse |
| 590 | |
| 591 | void 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 | |
| 633 | void CFamiTrackerView::OnLButtonDown(UINT nFlags, CPoint point) |
| 634 | { |
nothing calls this directly
no test coverage detected