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