1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29: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() void AudacityProject::RebuildOtherMenus()
{ {
if (mTrackPanel) {
mTrackPanel->BuildMenus();
}
} }
CommandFlag AudacityProject::GetFocusedFrame() CommandFlag AudacityProject::GetFocusedFrame()

View File

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

View File

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