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/T2DlgItemTButton.cpp | |
parent | 37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff) | |
download | t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip |
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r-- | src/T2DLL/T2DlgItemTButton.cpp | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/src/T2DLL/T2DlgItemTButton.cpp b/src/T2DLL/T2DlgItemTButton.cpp index e81b41d..11818a6 100644 --- a/src/T2DLL/T2DlgItemTButton.cpp +++ b/src/T2DLL/T2DlgItemTButton.cpp @@ -1,7 +1,40 @@ #include "T2DlgItemTButton.h" -T2DlgItemTButton::T2DlgItemTButton(T2TowerDoc*, T2ImageObj*, CPalette*) { +T2DlgItemTButton::T2DlgItemTButton(T2TowerDoc* inDoc, T2ImageObj* inImageObj, CPalette* inPalette) + : T2DlgItemButtonBase(inDoc, inImageObj, inPalette) +{ } -/*virtual*/ int T2DlgItemTButton::OnT2DlgItemEraseBkgnd(CDC*) { +/*virtual*/ BOOL T2DlgItemTButton::OnT2DlgItemEraseBkgnd(CDC* pDC) { +#pragma var_order(rect, save, text) + CString text; + GetWindowText(text); + + if (text == "NULL") + return true; + + CRect rect; + GetClientRect(rect); + + DrawButtonBase(pDC, rect, GetPattern() == 100); + + int save = pDC->SaveDC(); + pDC->SelectPalette(mPalette, false); + pDC->RealizePalette(); + + pDC->SelectObject(mFont); + pDC->SetBkMode(TRANSPARENT); + + if (!IsWindowEnabled()) + pDC->SetTextColor(PALETTERGB(179, 179, 179)); + else if (GetPattern() == 100) + rect.OffsetRect(1, 1); + else + pDC->SetTextColor(RGB(0, 0, 0)); + + pDC->DrawText(text, -1, rect, DT_CENTER | DT_VCENTER | DT_SINGLELINE | DT_NOPREFIX); + + pDC->RestoreDC(save); + + return true; } |