| 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. |
| 189 | std::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 | |
| 208 | namespace{ |
no test coverage detected