Ownerdrawn stuff. Text display done, image display next.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9572 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-03-22 23:23:19 +00:00
parent 9c0b55475a
commit 5afb945835
6 changed files with 392 additions and 69 deletions

View File

@@ -28,6 +28,8 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
wxMemoryDC::wxMemoryDC(void)
{
ERRORID vError;
wxString sError;
HDC hDC;
HPS hPS;
DEVOPENSTRUC vDOP = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L};
@@ -48,6 +50,33 @@ wxMemoryDC::wxMemoryDC(void)
m_bOwnsDC = TRUE;
SetBrush(*wxWHITE_BRUSH);
SetPen(*wxBLACK_PEN);
if (!::GpiCreateLogColorTable( m_hPS
,0L
,LCOLF_CONSECRGB
,0L
,(LONG)wxTheColourDatabase->m_nSize
,(PLONG)wxTheColourDatabase->m_palTable
))
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError);
}
//
// Set the color table to RGB mode
//
if (!::GpiCreateLogColorTable( m_hPS
,0L
,LCOLF_RGB
,0L
,0L
,NULL
))
{
vError = ::WinGetLastError(vHabmain);
sError = wxPMErrorToStr(vError);
wxLogError("Unable to set current color table. Error: %s\n", sError);
}
}
else
{
@@ -155,7 +184,7 @@ void wxMemoryDC::SelectObject(
m_vSelectedBitmap.SetSelectedInto(this);
hBmp = (WXHBITMAP)::GpiSetBitmap(m_hPS, (HBITMAP)hBmp);
if (hBmp != HBM_ERROR)
if (hBmp == HBM_ERROR)
{
wxLogLastError(wxT("SelectObject(memDC, bitmap)"));
wxFAIL_MSG(wxT("Couldn't select a bitmap into wxMemoryDC"));