git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@19519
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxBitmapRefData::wxBitmapRefData()
{
wxBitmapRefData::wxBitmapRefData()
{
m_bitmapMask = NULL;
m_hBitmap = (WXHBITMAP) NULL;
m_hasAlpha = FALSE;
m_bitmapMask = NULL;
m_hBitmap = (WXHBITMAP) NULL;
m_hasAlpha = FALSE;
return GetBitmapData() ? GetBitmapData()->GetMask() : (wxMask *) NULL;
}
return GetBitmapData() ? GetBitmapData()->GetMask() : (wxMask *) NULL;
}
wxDC *wxBitmap::GetSelectedInto() const
{
return GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC *) NULL;
}
wxDC *wxBitmap::GetSelectedInto() const
{
return GetBitmapData() ? GetBitmapData()->m_selectedInto : (wxDC *) NULL;
}
#if WXWIN_COMPATIBILITY_2_4
int wxBitmap::GetQuality() const
#if WXWIN_COMPATIBILITY_2_4
int wxBitmap::GetQuality() const
// wxBitmap setters
// ----------------------------------------------------------------------------
// wxBitmap setters
// ----------------------------------------------------------------------------
void wxBitmap::SetSelectedInto(wxDC *dc)
{
if ( GetBitmapData() )
GetBitmapData()->m_selectedInto = dc;
}
void wxBitmap::SetSelectedInto(wxDC *dc)
{
if ( GetBitmapData() )
GetBitmapData()->m_selectedInto = dc;
}
#if wxUSE_PALETTE
void wxBitmap::SetPalette(const wxPalette& palette)
#if wxUSE_PALETTE
void wxBitmap::SetPalette(const wxPalette& palette)
if (m_oldBitmap)
{
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
if (m_oldBitmap)
{
::SelectObject((HDC) dc, (HBITMAP) m_oldBitmap);
if (m_selectedBitmap.Ok())
{
m_selectedBitmap.SetSelectedInto(NULL);
}
if (m_selectedBitmap.Ok())
{
m_selectedBitmap.SetSelectedInto(NULL);
}
}
m_oldBitmap = 0;
if (m_oldPen)
}
m_oldBitmap = 0;
if (m_oldPen)
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
::SelectObject(GetHdc(), (HBITMAP) m_oldBitmap);
if ( m_selectedBitmap.Ok() )
{
m_selectedBitmap.SetSelectedInto(NULL);
m_selectedBitmap.SetSelectedInto(NULL);
m_selectedBitmap = wxNullBitmap;
}
}
m_selectedBitmap = wxNullBitmap;
}
}
m_selectedBitmap.SetSelectedInto(this);
m_selectedBitmap.SetSelectedInto(this);
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )
hBmp = (WXHBITMAP)::SelectObject(GetHdc(), (HBITMAP)hBmp);
if ( !hBmp )