www.pudn.com > TidyWin32-src.zip > MainDlg.h
#ifndef MAINDLG_H #define MAINDLG_H #include "resource.h" #include "TidyProxy.h" class COutputView; class CConfigDlg; //------------------------------------------------------------------- class CMainDlg : public CDialogImpl{ public: enum { IDD = IDD_MAIN_DLG }; CMainDlg(const char* cmdLine); BOOL IsDialogMsg(LPMSG lpMsg); private: COutputView* m_pOutputView; CConfigDlg* m_pConfigDlg; string m_CmdLineConfigFile; // Dialog item members string m_SourceFileName; CContainedWindow m_SourceFileEdit; CWindow m_TidyButton; ATLControls::CEdit m_MsgEdit; ATLControls::CListViewCtrl m_MsgList; ATLControls::CImageList m_MsgImgList; // The one and only CTidyProxy instance CTidyProxy m_TidyProxy; // values used by OnGetMinMaxInfo and OnSize() SIZE m_minWndSize; int m_marginLeft, m_marginRight;// space between child wnds and border int m_marginBottom; POINT m_MsgEdit_TopLeft; // top left corner of m_MsgEdit int m_MsgWnds_Gap; // space between m_MsgEdit and m_MsgList private: list SplitCmdLine(const char*); public: LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnQuit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnBrowseSourceFile(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnConfig(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnTidy(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT CMainDlg::OnShowOutput(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnGetMinMaxInfo(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnSourceFileChange(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); LRESULT OnDropSourceFile(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); LRESULT OnAbout(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); BEGIN_MSG_MAP(CMainDlg) MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) COMMAND_ID_HANDLER(IDCANCEL, OnQuit) COMMAND_ID_HANDLER(IDC_SOURCEF_BROWSE_BUTTON, OnBrowseSourceFile) COMMAND_ID_HANDLER(IDC_CONFIG_BUTTON, OnConfig) COMMAND_ID_HANDLER(IDC_TIDY_BUTTON, OnTidy) COMMAND_ID_HANDLER(IDC_SHOW_OUTPUT_BUTTON, OnShowOutput) COMMAND_HANDLER(IDC_SOURCEF_EDIT, EN_CHANGE, OnSourceFileChange) MESSAGE_HANDLER(WM_GETMINMAXINFO, OnGetMinMaxInfo) MESSAGE_HANDLER(WM_SIZE, OnSize) COMMAND_ID_HANDLER(IDC_ABOUT, OnAbout) ALT_MSG_MAP(1) MESSAGE_HANDLER(WM_DROPFILES, OnDropSourceFile) END_MSG_MAP() }; //------------------------------------------------------------------- class CAboutDlg : public CDialogImpl { public: enum { IDD = IDD_ABOUT }; LRESULT OnOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled) { EndDialog(0); return 0; } BEGIN_MSG_MAP(CAboutDlg) COMMAND_ID_HANDLER(IDOK, OnOK) COMMAND_ID_HANDLER(IDCANCEL, OnOK) END_MSG_MAP() }; //------------------------------------------------------------------- #endif // MAINDLG_H