diff options
author | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
---|---|---|
committer | Ash Wolf <ninji@wuffs.org> | 2023-06-28 22:22:32 +0100 |
commit | c0c336500955a23e344651e5412c9d9d441ef4ee (patch) | |
tree | 790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2DlgItemBox.cpp | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-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; } |