Ticket #15699: Allow-creating-wxBitmap-from-wxCursor-wxMSW-v2.patch

File Allow-creating-wxBitmap-from-wxCursor-wxMSW-v2.patch, 904 bytes (added by awi, 6 years ago)

Allow converting wxCursor to wxBitmap under wxMSW.

  • include/wx/msw/bitmap.h

    diff --git a/include/wx/msw/bitmap.h b/include/wx/msw/bitmap.h
    a b public: 
    9797        CopyFromIcon(icon, transp);
    9898    }
    9999
     100    // Convert from wxCursor
     101    wxEXPLICIT wxBitmap(const wxCursor& cursor)
     102    {
     103        (void)CopyFromCursor(cursor, wxBitmapTransparency_Auto);
     104    }
     105
    100106    wxBitmap& operator=(const wxIcon& icon)
    101107    {
    102108        (void)CopyFromIcon(icon);
    103109
    104110        return *this;
    105111    }
    106 
     112#ifdef WXWIN_COMPATIBILITY_3_0
     113    // This assignment is not supported on another ports (wxGTK).
     114    wxDEPRECATED_MSG("don't assign wxCursor to existing wxBitmap. Instantiate new wxBitmap from wxCursor instead.")
    107115    wxBitmap& operator=(const wxCursor& cursor)
    108116    {
    109117        (void)CopyFromCursor(cursor);
    110118
    111119        return *this;
    112120    }
    113 
     121#endif // WXWIN_COMPATIBILITY_3_0
    114122    virtual ~wxBitmap();
    115123
    116124#if wxUSE_IMAGE