1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-25 08:58:06 +02:00

Cursor change and status message for mouse over label text boxes

This commit is contained in:
Paul Licameli 2017-06-18 14:29:08 -04:00
parent 828d9c3ccd
commit 24ebf27bb6
2 changed files with 15 additions and 2 deletions

View File

@ -16,6 +16,7 @@ Paul Licameli split from TrackPanel.cpp
#include "../../../RefreshCode.h"
#include "../../../TrackPanelMouseEvent.h"
#include "../../../ViewInfo.h"
#include "../../../images/Cursors.h"
LabelTextHandle::LabelTextHandle()
{
@ -27,13 +28,23 @@ LabelTextHandle &LabelTextHandle::Instance()
return instance;
}
HitTestPreview LabelTextHandle::HitPreview()
{
static auto ibeamCursor =
::MakeCursor(wxCURSOR_IBEAM, IBeamCursorXpm, 17, 16);
return {
_("Click to edit label text"),
ibeamCursor.get()
};
}
HitTestResult LabelTextHandle::HitTest(const wxMouseEvent &event, LabelTrack *pLT)
{
// If Control is down, let the select handle be hit instead
if (!event.ControlDown() &&
pLT->OverATextBox(event.m_x, event.m_y) >= 0)
// There was no cursor change or status message for mousing over a label text box
return { {}, &Instance() };
return { HitPreview(), &Instance() };
return {};
}
@ -140,7 +151,7 @@ UIHandle::Result LabelTextHandle::Drag
HitTestPreview LabelTextHandle::Preview
(const TrackPanelMouseEvent &evt, const AudacityProject *pProject)
{
return {};
return HitPreview();
}
UIHandle::Result LabelTextHandle::Release

View File

@ -28,6 +28,8 @@ class LabelTextHandle final : public LabelDefaultClickHandle
LabelTextHandle &operator=(const LabelTextHandle&) = delete;
static LabelTextHandle& Instance();
static HitTestPreview HitPreview();
public:
static HitTestResult HitTest(const wxMouseEvent &event, LabelTrack *pLT);