diff options
Diffstat (limited to 'src/T2DLL/T2EventDialog.cpp')
-rw-r--r-- | src/T2DLL/T2EventDialog.cpp | 44 |
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); +} |