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/T2EventDialog.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 src/T2DLL/T2EventDialog.cpp (limited to 'src/T2DLL/T2EventDialog.cpp') 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); +} -- cgit v1.2.3