#pragma once #include "common.h" #include "LListener.h" struct T2DLGTEMPLATE { POINT pt; HINSTANCE moduleHandle; int resID; }; class AFX_EXT_CLASS T2Dialog : public CWnd, public LListener { DECLARE_DYNAMIC(T2Dialog) DECLARE_MESSAGE_MAP() public: T2Dialog(); virtual ~T2Dialog(); void Realize(void*, T2DLGTEMPLATE*, T2TowerDoc*, T2ImageObj*, CPalette*, BOOL isToolWindow, CWnd* parentWnd, UINT nID, BOOL autoShow); int DoModal(); void DoClose(int nResult); virtual int PreTranslateMessage(MSG*); void MakeRadioGroup(int inBaseID, int inCount, int inSelected); void MakeTabPanel(int inBaseID1, int inBaseID2, int inCount, int inSelected); HFONT GetFont(); T2TowerDoc* GetDocument() const { return mTowerDoc; } T2DlgItem* GetT2DlgItem(int id) const { return (T2DlgItem *) GetDlgItem(id); } void SetUserCon(long uc) { mUserCon = uc; } long GetUserCon() { return mUserCon; } class T2DialogDef { public: T2DialogDef(); virtual ~T2DialogDef(); int width; int height; int modal; const char *title; int _14; int center; int flags; }; int mDeleteOnClose; T2DLGTEMPLATE mTemplate; long mUserCon; T2TowerDoc *mTowerDoc; T2ImageObj *mImageObj; CPalette *mPalette; int mModal; int mInModalLoop; CFont *mFonts[10]; int mFontNums[10]; int mFontCount; int mCurrentFont; void *mEC; CString mFontName; BOOL mAutoShow; protected: int OnCreate(CREATESTRUCT*); void OnLButtonDblClk(UINT nFlags, CPoint pt); void OnLButtonDown(UINT nFlags, CPoint pt); void OnLButtonUp(UINT nFlags, CPoint pt); void OnActivateApp(BOOL bActive, HTASK hTask); void OnDestroy(); BOOL OnQueryNewPalette(); BOOL OnEraseBkgnd(CDC* pDC); virtual int PreCreateWindow(CREATESTRUCT&); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); virtual void PostNcDestroy(); virtual void AfterBurner(T2DialogDef& def); virtual void DoOnCreate(char* data); void CreateDlgItemLoop(T2DialogDef& def, char* data); virtual void CreateDlgItem(CTokenizer& inTokenizer, T2DialogDef& inDef); virtual BOOL OnT2DialogCommand(WPARAM inWParam, LPARAM inLParam) { return true; } virtual BOOL OnT2EraseBkgnd(CDC* dc) { return true; } virtual BOOL OnT2PreEraseBkgnd(CDC* dc) { return false; } virtual void OnT2Create() {} virtual void OnT2Destroy() {} virtual void OnT2DlgLButtonDown(UINT nFlags, CPoint pt) {} virtual void OnT2DlgLButtonUp(UINT nFlags, CPoint pt) {} virtual void OnT2DlgLButtonDblClk(UINT nFlags, CPoint pt) {} virtual void OnT2OK() {} virtual void OnT2Cancel() {} };