diff options
Diffstat (limited to 'src/T2DLL/T2DlgItemBox.cpp')
-rw-r--r-- | src/T2DLL/T2DlgItemBox.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/T2DLL/T2DlgItemBox.cpp b/src/T2DLL/T2DlgItemBox.cpp index f1dfe3b..514b300 100644 --- a/src/T2DLL/T2DlgItemBox.cpp +++ b/src/T2DLL/T2DlgItemBox.cpp @@ -1,7 +1,40 @@ #include "T2DlgItemBox.h" -T2DlgItemBox::T2DlgItemBox(T2TowerDoc*, T2ImageObj*, CPalette*) { +T2DlgItemBox::T2DlgItemBox(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette) + : T2DlgItem(inDoc, inImageObj, inPalette) +{ } -/*virtual*/ int T2DlgItemBox::OnT2DlgItemEraseBkgnd(CDC*) { +/*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 save = 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(save); + + return true; } |