#include "StdAfx.h" #include "T2DlgItemBox.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif T2DlgItemBox::T2DlgItemBox(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette) : T2DlgItem(inDoc, inImageObj, inPalette) { } /*virtual*/ BOOL T2DlgItemBox::OnT2DlgItemEraseBkgnd(CDC* pDC) { CRect rect; GetClientRect(rect); CPen whitePen; whitePen.CreatePen(PS_SOLID, 0, PALETTERGB(255, 255, 255)); CPen greyPen; greyPen.CreatePen(PS_SOLID, 0, PALETTERGB(133, 133, 133)); CBrush brush; int saveDC = pDC->SaveDC(); pDC->SelectPalette(mPalette, false); pDC->RealizePalette(); if (IsWindowEnabled()) { pDC->SelectObject(greyPen); pDC->MoveTo(rect.right - 1, rect.top); pDC->LineTo(rect.left, rect.top); pDC->LineTo(rect.left, rect.bottom); pDC->SelectObject(whitePen); pDC->MoveTo(rect.right - 1, rect.top + 1); pDC->LineTo(rect.right - 1, rect.bottom - 1); pDC->LineTo(rect.left, rect.bottom - 1); } else { brush.CreateSolidBrush(PALETTERGB(179, 179, 179)); pDC->FrameRect(rect, &brush); } pDC->RestoreDC(saveDC); return true; }