diff options
Diffstat (limited to 'src/T2DLL/T2DlgItemIRepeater.cpp')
-rw-r--r-- | src/T2DLL/T2DlgItemIRepeater.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
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); +} |