Deprecate wxBitmap::SetWidth/Height/Size/Depth, wxIcon::SetSize functions

wxBitmap and wxIcon dimensions and colour depth are determined during creation so using all these functions could lead to inconsistencies.
This commit is contained in:
Artur Wieczorek
2018-09-11 21:52:11 +02:00
parent 5115fe31ef
commit 26ee45e4a5
3 changed files with 14 additions and 11 deletions

View File

@@ -199,7 +199,9 @@ public:
void MSWUpdateAlpha(); void MSWUpdateAlpha();
public: public:
void SetHBITMAP(WXHBITMAP bmp) { SetHandle((WXHANDLE)bmp); } #if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_INLINE(void SetHBITMAP(WXHBITMAP bmp), SetHandle((WXHANDLE)bmp); )
#endif // WXWIN_COMPATIBILITY_3_0
WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); } WXHBITMAP GetHBITMAP() const { return (WXHBITMAP)GetHandle(); }
bool InitFromHBITMAP(WXHBITMAP bmp, int width, int height, int depth); bool InitFromHBITMAP(WXHBITMAP bmp, int width, int height, int depth);
void ResetHBITMAP() { InitFromHBITMAP(NULL, 0, 0, 0); } void ResetHBITMAP() { InitFromHBITMAP(NULL, 0, 0, 0); }

View File

@@ -118,16 +118,14 @@ public:
wxSize(GetGDIImageData()->m_width, GetGDIImageData()->m_height); wxSize(GetGDIImageData()->m_width, GetGDIImageData()->m_height);
} }
void SetWidth(int w) { AllocExclusive(); GetGDIImageData()->m_width = w; } #if WXWIN_COMPATIBILITY_3_0
void SetHeight(int h) { AllocExclusive(); GetGDIImageData()->m_height = h; } wxDEPRECATED_INLINE(void SetWidth(int w), AllocExclusive(); GetGDIImageData()->m_width = w; )
void SetDepth(int d) { AllocExclusive(); GetGDIImageData()->m_depth = d; } wxDEPRECATED_INLINE(void SetHeight(int h), AllocExclusive(); GetGDIImageData()->m_height = h; )
wxDEPRECATED_INLINE(void SetDepth(int d), AllocExclusive(); GetGDIImageData()->m_depth = d; )
void SetSize(int w, int h) wxDEPRECATED_INLINE(void SetSize(int w, int h), AllocExclusive(); GetGDIImageData()->SetSize(w, h); )
{ wxDEPRECATED_INLINE(void SetSize(const wxSize& size), AllocExclusive(); GetGDIImageData()->SetSize(size.x, size.y); )
AllocExclusive(); #endif // WXWIN_COMPATIBILITY_3_0
GetGDIImageData()->SetSize(w, h);
}
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
// forward some of base class virtuals to wxGDIImageRefData // forward some of base class virtuals to wxGDIImageRefData
bool FreeResource(bool force = false) wxOVERRIDE; bool FreeResource(bool force = false) wxOVERRIDE;

View File

@@ -69,7 +69,10 @@ public:
// implementation only from now on // implementation only from now on
wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; } wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; }
void SetHICON(WXHICON icon) { SetHandle((WXHANDLE)icon); } #if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_INLINE(void SetHICON(WXHICON icon), SetHandle((WXHANDLE)icon); )
#endif // WXWIN_COMPATIBILITY_3_0
WXHICON GetHICON() const { return (WXHICON)GetHandle(); } WXHICON GetHICON() const { return (WXHICON)GetHandle(); }
bool InitFromHICON(WXHICON icon, int width, int height); bool InitFromHICON(WXHICON icon, int width, int height);