summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2DlgItemTButton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/T2DLL/T2DlgItemTButton.cpp')
-rw-r--r--src/T2DLL/T2DlgItemTButton.cpp37
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;
}