Skip to content

Commit

Permalink
Deprecate wxBitmap::SetWidth/Height/Size/Depth, wxIcon::SetSize funct…
Browse files Browse the repository at this point in the history
…ions

wxBitmap and wxIcon dimensions and colour depth are determined during creation so using all these functions could lead to inconsistencies.
  • Loading branch information
a-wi committed Sep 12, 2018
1 parent 5115fe3 commit 26ee45e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
4 changes: 3 additions & 1 deletion include/wx/msw/bitmap.h
Expand Up @@ -199,7 +199,9 @@ class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage,
void MSWUpdateAlpha();

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(); }
bool InitFromHBITMAP(WXHBITMAP bmp, int width, int height, int depth);
void ResetHBITMAP() { InitFromHBITMAP(NULL, 0, 0, 0); }
Expand Down
18 changes: 8 additions & 10 deletions include/wx/msw/gdiimage.h
Expand Up @@ -118,16 +118,14 @@ class WXDLLIMPEXP_CORE wxGDIImage : public wxGDIObject
wxSize(GetGDIImageData()->m_width, GetGDIImageData()->m_height);
}

void SetWidth(int w) { AllocExclusive(); GetGDIImageData()->m_width = w; }
void SetHeight(int h) { AllocExclusive(); GetGDIImageData()->m_height = h; }
void SetDepth(int d) { AllocExclusive(); GetGDIImageData()->m_depth = d; }

void SetSize(int w, int h)
{
AllocExclusive();
GetGDIImageData()->SetSize(w, h);
}
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_INLINE(void SetWidth(int w), AllocExclusive(); GetGDIImageData()->m_width = w; )
wxDEPRECATED_INLINE(void SetHeight(int h), AllocExclusive(); GetGDIImageData()->m_height = h; )
wxDEPRECATED_INLINE(void SetDepth(int d), AllocExclusive(); GetGDIImageData()->m_depth = d; )

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); )
#endif // WXWIN_COMPATIBILITY_3_0

// forward some of base class virtuals to wxGDIImageRefData
bool FreeResource(bool force = false) wxOVERRIDE;
Expand Down
5 changes: 4 additions & 1 deletion include/wx/msw/icon.h
Expand Up @@ -69,7 +69,10 @@ class WXDLLIMPEXP_CORE wxIcon : public wxGDIImage
// implementation only from now on
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(); }
bool InitFromHICON(WXHICON icon, int width, int height);

Expand Down

0 comments on commit 26ee45e

Please sign in to comment.