MCPcopy Create free account
hub / github.com/audacity/audacity / MakeCursor

Function MakeCursor

src/TrackPanel.cpp:189–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187/// Makes a cursor from an XPM, uses CursorId as a fallback.
188/// TODO: Move this function to some other source file for reuse elsewhere.
189std::unique_ptr<wxCursor> MakeCursor( int WXUNUSED(CursorId), const char * const pXpm[36], int HotX, int HotY )
190{
191#define CURSORS_SIZE32
192#ifdef CURSORS_SIZE32
193 const int HotAdjust =0;
194#else
195 const int HotAdjust =8;
196#endif
197
198 wxImage Image = wxImage(wxBitmap(pXpm).ConvertToImage());
199 Image.SetMaskColour(255,0,0);
200 Image.SetMask();// Enable mask.
201
202 Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_X, HotX-HotAdjust );
203 Image.SetOption( wxIMAGE_OPTION_CUR_HOTSPOT_Y, HotY-HotAdjust );
204 return std::make_unique<wxCursor>( Image );
205}
206
207
208namespace{

Callers 15

MovePlayRegionHandleMethod · 0.85
PreviewMethod · 0.85
HitPreviewMethod · 0.85
HitPreviewMethod · 0.85
HitPreviewTrimMethod · 0.85
HitPreviewStretchMethod · 0.85
PreviewMethod · 0.85
HitPreviewMethod · 0.85
PreviewMethod · 0.85
PreviewMethod · 0.85
HitPreviewMethod · 0.85
HitPreviewMethod · 0.85

Calls 2

wxImageClass · 0.70
wxBitmapClass · 0.50

Tested by

no test coverage detected