summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2EventDialog.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/T2EventDialog.cpp
parent37e364b2c6cc7487a1c888d256a73e5337bb7189 (diff)
downloadt2win-c0c336500955a23e344651e5412c9d9d441ef4ee.tar.gz
t2win-c0c336500955a23e344651e5412c9d9d441ef4ee.zip
first pass of T2DLL
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2EventDialog.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/T2DLL/T2EventDialog.cpp b/src/T2DLL/T2EventDialog.cpp
new file mode 100644
index 0000000..e57a608
--- /dev/null
+++ b/src/T2DLL/T2EventDialog.cpp
@@ -0,0 +1,44 @@
+#include "CTokenizer.h"
+#include "T2DlgItemAnimation.h"
+#include "T2EventDialog.h"
+
+/*static*/ T2EventDialog *T2EventDialog::Show(void *a, T2TowerDoc *inDoc, HINSTANCE inModule, int inResID) {
+ T2EventDialog *theDialog = new T2EventDialog;
+
+ CRect rect;
+ AfxGetMainWnd()->GetWindowRect(rect);
+
+ T2DLGTEMPLATE tmpl;
+ tmpl.pt = rect.CenterPoint();
+ tmpl.moduleHandle = inModule;
+ tmpl.resID = inResID;
+ theDialog->Realize(a, &tmpl, inDoc, NULL, NULL, true, NULL, 0, true);
+
+ return theDialog;
+}
+
+T2EventDialog::T2EventDialog() {
+}
+
+/*virtual*/ void T2EventDialog::CreateDlgItem(CTokenizer& tokenizer, T2DialogDef& def) {
+ if (!_stricmp(tokenizer.Current(), "ANIM")) {
+ RECT rect;
+ UINT id = tokenizer.NextInteger();
+ rect.left = tokenizer.NextInteger();
+ rect.top = tokenizer.NextInteger();
+ rect.right = tokenizer.NextInteger();
+ rect.bottom = tokenizer.NextInteger();
+
+ T2DlgItemAnimation *anim = new T2DlgItemAnimation(mTowerDoc, mImageObj, mPalette);
+ anim->Create("", def.flags, rect, this, id);
+ anim->CreateSubItem(NULL);
+ if (mCurrentFont >= 0)
+ anim->SetFont(*mFonts[mCurrentFont]);
+ } else {
+ T2Dialog::CreateDlgItem(tokenizer, def);
+ }
+}
+
+/*virtual*/ void T2EventDialog::ListenToMessage(unsigned int msg, void* data) {
+ DoClose(msg);
+}