mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-19 22:27:43 +02:00
Defaulting TrackPanel cursor, status message; simplifies other code
This commit is contained in:
parent
f5b0afc2fc
commit
c079544667
@ -928,6 +928,10 @@ void TrackPanel::HandleMotion( const TrackPanelMouseState &tpmState )
|
||||
refreshCode |= code;
|
||||
mMouseOverUpdateFlags |= code;
|
||||
}
|
||||
if (!pCursor) {
|
||||
static wxCursor defaultCursor{ wxCURSOR_ARROW };
|
||||
pCursor = &defaultCursor;
|
||||
}
|
||||
mListener->TP_DisplayStatusMessage(tip);
|
||||
if (pCursor)
|
||||
SetCursor( *pCursor );
|
||||
|
@ -86,7 +86,7 @@ HitTestResult VelocitySliderHandle::HitTest
|
||||
sliderFn, sliderRect, pTrack );
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
|
||||
return { HitPreview(), result };
|
||||
return { HitTestPreview{}, result };
|
||||
}
|
||||
else
|
||||
return {};
|
||||
|
@ -53,7 +53,7 @@ HitTestResult MuteButtonHandle::HitTest
|
||||
auto result = std::make_shared<MuteButtonHandle>(pTrack, buttonRect);
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
@ -99,7 +99,7 @@ HitTestResult SoloButtonHandle::HitTest
|
||||
auto result = std::make_shared<SoloButtonHandle>( pTrack, buttonRect );
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
return HitTestResult(
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
);
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ HitTestResult GainSliderHandle::HitTest
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
@ -179,7 +179,7 @@ HitTestResult PanSliderHandle::HitTest
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
|
@ -31,12 +31,6 @@ ButtonHandle::~ButtonHandle()
|
||||
{
|
||||
}
|
||||
|
||||
HitTestPreview ButtonHandle::HitPreview()
|
||||
{
|
||||
static wxCursor arrowCursor{ wxCURSOR_ARROW };
|
||||
return { {}, &arrowCursor };
|
||||
}
|
||||
|
||||
UIHandle::Result ButtonHandle::Click
|
||||
(const TrackPanelMouseEvent &evt, AudacityProject *pProject)
|
||||
{
|
||||
|
@ -38,9 +38,6 @@ protected:
|
||||
virtual Result CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) = 0;
|
||||
|
||||
// For derived class to define hit tests
|
||||
static HitTestPreview HitPreview();
|
||||
|
||||
Result Click
|
||||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
|
@ -27,12 +27,6 @@ SliderHandle::~SliderHandle()
|
||||
{
|
||||
}
|
||||
|
||||
HitTestPreview SliderHandle::HitPreview()
|
||||
{
|
||||
// No special message or cursor
|
||||
return {};
|
||||
}
|
||||
|
||||
UIHandle::Result SliderHandle::Click
|
||||
(const TrackPanelMouseEvent &evt, AudacityProject *pProject)
|
||||
{
|
||||
|
@ -44,9 +44,6 @@ protected:
|
||||
virtual Result CommitChanges
|
||||
(const wxMouseEvent &event, AudacityProject *pProject) = 0;
|
||||
|
||||
// For derived classes to define hit tests
|
||||
static HitTestPreview HitPreview();
|
||||
|
||||
Result Click
|
||||
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
|
||||
|
||||
|
@ -60,7 +60,7 @@ HitTestResult MinimizeButtonHandle::HitTest
|
||||
auto result = std::make_shared<MinimizeButtonHandle>( pTrack, buttonRect );
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
@ -114,7 +114,7 @@ HitTestResult CloseButtonHandle::HitTest
|
||||
auto result = std::make_shared<CloseButtonHandle>( pTrack, buttonRect );
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
@ -157,7 +157,7 @@ HitTestResult MenuButtonHandle::HitTest
|
||||
auto result = std::make_shared<MenuButtonHandle>( pCell, pTrack, buttonRect );
|
||||
result = AssignUIHandlePtr(holder, result);
|
||||
return {
|
||||
HitPreview(),
|
||||
HitTestPreview{},
|
||||
result
|
||||
};
|
||||
}
|
||||
|
@ -35,9 +35,7 @@ std::shared_ptr<Track> TrackVRulerControls::FindTrack()
|
||||
HitTestResult TrackVRulerControls::HitTest
|
||||
(const TrackPanelMouseState &, const AudacityProject *)
|
||||
{
|
||||
// Use a space for the tip, otherwise we get the default message.
|
||||
static wxCursor arrowCursor{ wxCURSOR_ARROW };
|
||||
return { { _(" "), &arrowCursor }, {} };
|
||||
return {};
|
||||
}
|
||||
|
||||
void TrackVRulerControls::DrawZooming
|
||||
|
Loading…
x
Reference in New Issue
Block a user