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/T2DlgItemIRepeater.cpp | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 src/T2DLL/T2DlgItemIRepeater.cpp (limited to 'src/T2DLL/T2DlgItemIRepeater.cpp') diff --git a/src/T2DLL/T2DlgItemIRepeater.cpp b/src/T2DLL/T2DlgItemIRepeater.cpp new file mode 100644 index 0000000..40c8a2a --- /dev/null +++ b/src/T2DLL/T2DlgItemIRepeater.cpp @@ -0,0 +1,42 @@ +#include "T2DlgItemIRepeater.h" + +T2DlgItemIRepeater::T2DlgItemIRepeater(T2TowerDoc *inDoc, T2ImageObj *inImageObj, CPalette *inPalette) + : T2DlgItemIButton(inDoc, inImageObj, inPalette) +{ +} + +T2DlgItemIRepeater::~T2DlgItemIRepeater() { +} + +/*virtual*/ void T2DlgItemIRepeater::OnT2DlgItemLButtonDown(UINT inFlags, CPoint inPt) { + SetCapture(); + + mIsClicked = true; + m74 = true; + SetPattern(100); + Invalidate(); + + Notify(GetDlgCtrlID(), 0, NULL); + mTimerID = SetTimer(999, 100, NULL); +} + +/*virtual*/ void T2DlgItemIRepeater::OnT2DlgItemLButtonUp(UINT inFlags, CPoint inPt) { + if (mIsClicked) { + if (mTimerID) + KillTimer(mTimerID); + + SetPattern(0); + ReleaseCapture(); + mIsClicked = false; + + if (m74) { + m74 = false; + Invalidate(); + } + } +} + +/*virtual*/ void T2DlgItemIRepeater::OnT2Timer(UINT inID) { + if (inID == mTimerID && m74) + Notify(GetDlgCtrlID(), 0, NULL); +} -- cgit v1.2.3