1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-31 07:59:27 +02:00

Clean up last bits of old popup menu code

This commit is contained in:
Paul Licameli 2017-06-10 17:02:01 -04:00
parent 91e6239eeb
commit 674ccc5e15
3 changed files with 5 additions and 61 deletions

View File

@ -1886,9 +1886,6 @@ void AudacityProject::RebuildMenuBar()
void AudacityProject::RebuildOtherMenus()
{
if (mTrackPanel) {
mTrackPanel->BuildMenus();
}
}
CommandFlag AudacityProject::GetFocusedFrame()

View File

@ -277,10 +277,6 @@ template < class CLIPPEE, class CLIPVAL >
clippee = val;
}
enum {
TrackPanelFirstID = 2000,
};
BEGIN_EVENT_TABLE(TrackPanel, OverlayPanel)
EVT_MOUSE_EVENTS(TrackPanel::OnMouseEvent)
EVT_MOUSE_CAPTURE_LOST(TrackPanel::OnCaptureLost)
@ -395,7 +391,6 @@ TrackPanel::TrackPanel(wxWindow * parent, wxWindowID id,
mTrackArtist->SetMargins(1, kTopMargin, kRightMargin, kBottomMargin);
mCapturedTrack = NULL;
mPopupMenuTarget = NULL;
mTimeCount = 0;
mTimer.parent = this;
@ -444,8 +439,6 @@ TrackPanel::~TrackPanel()
// ALT+F4 or Command+Q
if (HasCapture())
ReleaseMouse();
DeleteMenus();
}
LWSlider *TrackPanel::GainSlider( const WaveTrack *wt )
@ -479,16 +472,6 @@ SelectionState &TrackPanel::GetSelectionState()
return GetProject()->GetSelectionState();
}
void TrackPanel::BuildMenus(void)
{
// Get rid of existing menus
DeleteMenus();
}
void TrackPanel::DeleteMenus(void)
{
}
#ifdef EXPERIMENTAL_OUTPUT_DISPLAY
void TrackPanel::UpdateVirtualStereoOrder()
{
@ -2896,13 +2879,6 @@ void TrackPanel::OnTrackListUpdated(wxCommandEvent & e)
ReleaseMouse();
}
if (mPopupMenuTarget &&
!mTracks->Contains(mPopupMenuTarget)) {
mPopupMenuTarget = nullptr;
if (HasCapture())
ReleaseMouse();
}
GetSelectionState().TrackListUpdated( *mTracks );
if (e.GetClientData()) {
@ -5171,34 +5147,11 @@ void TrackPanel::OnTrackMenu(Track *t)
return;
}
{
TrackPanelCell *const pCell = t->GetTrackControl();
const wxRect rect(FindTrackRect(t, true));
const UIHandle::Result refreshResult =
pCell->DoContextMenu(rect, this, NULL);
ProcessUIHandleResult(this, mRuler, t, t, refreshResult);
// TODO: Hide following lines inside the above.
}
mPopupMenuTarget = t;
wxMenu *theMenu = NULL;
if (theMenu) {
//We need to find the location of the menu rectangle.
const wxRect rect = FindTrackRect(t,true);
wxRect titleRect;
mTrackInfo.GetTitleBarRect(rect, titleRect);
PopupMenu(theMenu, titleRect.x + 1,
titleRect.y + titleRect.height + 1);
}
mPopupMenuTarget = NULL;
SetCapturedTrack(NULL);
Refresh(false);
TrackPanelCell *const pCell = t->GetTrackControl();
const wxRect rect(FindTrackRect(t, true));
const UIHandle::Result refreshResult =
pCell->DoContextMenu(rect, this, NULL);
ProcessUIHandleResult(this, mRuler, t, t, refreshResult);
}
Track * TrackPanel::GetFirstSelectedTrack()

View File

@ -258,10 +258,6 @@ class AUDACITY_DLL_API TrackPanel final : public OverlayPanel {
virtual ~ TrackPanel();
virtual void BuildMenus(void);
virtual void DeleteMenus(void);
virtual void UpdatePrefs();
virtual void ApplyUpdatedTheme();
@ -734,8 +730,6 @@ protected:
mStretchCursor, mStretchLeftCursor, mStretchRightCursor;
#endif
Track *mPopupMenuTarget {};
friend class TrackPanelAx;
#if wxUSE_ACCESSIBILITY