More progress on wxMotif, incl. wxTreeCtrl/wxListCtrl beginning to work

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1107 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1998-12-04 10:30:39 +00:00
parent b2b3ccc524
commit a367b9b3f8
21 changed files with 182 additions and 93 deletions

View File

@@ -394,6 +394,7 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
LPBITMAPINFO lpDib;
void *lpBits = NULL;
/*
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
tmpBitmap.SetPalette(this->GetPalette());
@@ -401,6 +402,23 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
memDC.SetPalette(this->GetPalette());
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
*/
if( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) )
{
tmpBitmap.SetPalette(this->GetPalette());
memDC.SelectObject(tmpBitmap);
memDC.SetPalette(this->GetPalette());
hPal = (HPALETTE) this->GetPalette()->GetHPALETTE();
}
else
{
hPal = (HPALETTE) ::GetStockObject(DEFAULT_PALETTE);
wxPalette palette;
palette.SetHPALETTE( (WXHPALETTE)hPal );
tmpBitmap.SetPalette( palette );
memDC.SelectObject(tmpBitmap);
memDC.SetPalette( palette );
}
// set the height negative because in a DIB the order of the lines is reversed
createDIB(this->GetWidth(), -this->GetHeight(), this->GetDepth(), hPal, &lpDib);