summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2DlgItemIRepeater.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
committerAsh Wolf <ninji@wuffs.org>2023-06-28 22:22:32 +0100
commitc0c336500955a23e344651e5412c9d9d441ef4ee (patch)
tree790769c748db307cf3314f6e896e2f61c68561a2 /src/T2DLL/T2DlgItemIRepeater.cpp
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to 'src/T2DLL/T2DlgItemIRepeater.cpp')
-rw-r--r--src/T2DLL/T2DlgItemIRepeater.cpp42
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);
+}