#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); }