From c0c336500955a23e344651e5412c9d9d441ef4ee Mon Sep 17 00:00:00 2001 From: Ash Wolf Date: Wed, 28 Jun 2023 22:22:32 +0100 Subject: first pass of T2DLL --- src/T2DLL/T2DlgItemBox.cpp | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'src/T2DLL/T2DlgItemBox.cpp') 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; } -- cgit v1.2.3