todolistwnd.h

来自「管理项目进度工具的原代码」· C头文件 代码 · 共 553 行 · 第 1/2 页

H
553
字号
// ToDoListWnd.h : header file
//

#if !defined(AFX_TODOLISTWND_H__13051D32_D372_4205_BA71_05FAC2159F1C__INCLUDED_)
#define AFX_TODOLISTWND_H__13051D32_D372_4205_BA71_05FAC2159F1C__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

//#include "todoctrl.h"
#include "filteredtodoctrl.h"
#include "preferencesdlg.h"
#include "findtaskDlg.h"
#include "todoctrlmgr.h"
#include "TDLImportExportMgr.h"
#include "TDLContentMgr.h"
#include "filterbar.h"
#include "TDLSendTasksDlg.h"

#include "..\shared\trayicon.h"
#include "..\shared\toolbarhelper.h"
#include "..\shared\filemisc.h"
#include "..\shared\ShortcutManager.h"
#include "..\shared\driveinfo.h"
#include "..\shared\entoolbar.h"
#include "..\shared\tabctrlex.h"
#include "..\shared\enrecentfilelist.h"
#include "..\shared\menuex.h"
#include "..\shared\dialoghelper.h"
#include "..\shared\tabbedcombobox.h"
#include "..\shared\checkcombobox.h"
#include "..\shared\deferWndMove.h"
#include "..\shared\colorcombobox.h"
#include "..\shared\enBrowserctrl.h"
#include "..\shared\UIExtensionMgr.h"
#include "..\shared\menuiconmgr.h"

#include "..\3rdparty\statusbarACT.h"

/////////////////////////////////////////////////////////////////////////////
// CToDoListWnd dialog

const UINT WM_TDL_SHOWWINDOW = ::RegisterWindowMessage("WM_TDL_SHOWWINDOW");
const UINT WM_TDL_GETVERSION = ::RegisterWindowMessage("WM_TDL_GETVERSION");
const UINT WM_TDL_ISCLOSING = ::RegisterWindowMessage("WM_TDL_ISCLOSING");
const UINT WM_TDL_REFRESHPREFS = ::RegisterWindowMessage("WM_TDL_REFRESHPREFS");
const UINT WM_TDL_RESTORE = ::RegisterWindowMessage("WM_TDL_RESTORE");

// WM_COPYDATA 
enum 
{
	OPENTASKLIST,   // data is char*
	ADDNEWTASK,     // data is char*
	SETCOMMENTS,    // data is char*
	SELECTTASK,     // data is DWORD
	IMPORTFILE,		// data is char*
};

// creation flags
enum
{
	TLD_FORCEVISIBLE		= 0x01,
    TLD_PASSWORDPROMPTING	= 0x02,
};

enum FIND_WHAT;

class CToDoListWnd : public CFrameWnd, public CDialogHelper
{
	// Construction
public:
	CToDoListWnd(); // standard constructor
	~CToDoListWnd();
	
	static int GetVersion();
	BOOL Create(DWORD dwFlags = 0, LPCTSTR szTDListPath = NULL);
	
protected:
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CToDoListWnd)
	protected:
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL
	virtual void OnOK() {}
	virtual void OnCancel();
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	int OnCreate(LPCREATESTRUCT lpCreateStruct);
	
	// Implementation
protected:
	HICON m_hIcon;
	CImageList m_ilTabCtrl, m_ilToDoCtrl;
	CEnToolBar m_toolbar;
	CTrayIcon m_ti;
	CEnRecentFileList m_mruList;
	CTabCtrlEx m_tabCtrl;
	CShortcutManager m_mgrShortcuts;
	CTaskListDropTarget m_dropTarget;
	CPreferencesDlg* m_pPrefs;
	CFindTaskDlg m_findDlg;
	CTDLImportExportMgr m_mgrImportExport;
	CToDoCtrlMgr m_mgrToDoCtrls;
	CFont m_fontTree, m_fontComments; // shared by all tasklists
	CMenuEx m_menubar;
	CTDLContentMgr m_mgrContent;
	CEnBrowserCtrl m_IE;
	CFilterBar m_filterBar;
	CStatusBarACT	m_statusBar;
	HWND m_hwndLastFocus;
	CMenuIconMgr m_mgrMenuIcons;
	CUIExtensionMgr m_mgrUIExtensions;

	struct TDCSTARTUP
	{
		TDCSTARTUP() : dwIDSel(0) {}
		void Clear() { sFilePath.Empty(); sNewTask.Empty(); sComments.Empty(); dwIDSel = 0; }

		CString	sFilePath; // tasklist to load
		DWORD dwIDSel; // task to select
		CString sNewTask, sComments; // task title/comments
	};
	TDCSTARTUP m_startupOptions;

	CDWordArray m_aPriorityColors;
	CFont m_fontMain;
	int m_nLastSelItem; // just for flicker-free todoctrl switching

	BOOL m_bVisible;
	BOOL m_bMaxTasklists;
	BOOL m_bShowFilterBar, m_bShowProjectName;
	BOOL m_bShowStatusBar, m_bShowToolbar;
	BOOL m_bInNewTask;
	BOOL m_bSaving;
	BOOL m_bInTimer;
	BOOL m_bClosing;
	BOOL m_bFindShowing;
	BOOL m_bQueryOpenAllow;
	BOOL m_bPasswordPrompting;
	BOOL m_bReloading; // on startup
	BOOL m_bStartHidden;

	// Generated message map functions
	//{{AFX_MSG(CToDoListWnd)
	afx_msg void OnViewExpandtask();
	afx_msg void OnUpdateViewExpandtask(CCmdUI* pCmdUI);
	afx_msg void OnViewCollapsetask();
	afx_msg void OnUpdateViewCollapsetask(CCmdUI* pCmdUI);
	afx_msg void OnViewCollapseall();
	afx_msg void OnViewExpandall();
	afx_msg void OnUpdateViewExpandall(CCmdUI* pCmdUI);
	afx_msg void OnUpdateViewCollapseall(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUserExport1(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUserImport1(CCmdUI* pCmdUI);
	afx_msg void OnUpdateWindow(CCmdUI* pCmdUI);
	afx_msg void OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized);
	afx_msg void OnEnable(BOOL bEnable);
	afx_msg void OnNewtask();
	afx_msg void OnNewsubtask();
	afx_msg void OnUpdateNewsubtask(CCmdUI* pCmdUI);
	afx_msg void OnToolsTransformactivetasklist();
	afx_msg void OnViewSorttasklisttabs();
	afx_msg void OnUpdateViewSorttasklisttabs(CCmdUI* pCmdUI);
	afx_msg void OnMeasureItem(int nIDCtl, LPMEASUREITEMSTRUCT lpMeasureItemStruct);
	afx_msg void OnEditInctaskpercentdone();
	afx_msg void OnUpdateEditInctaskpercentdone(CCmdUI* pCmdUI);
	afx_msg void OnEditDectaskpercentdone();
	afx_msg void OnUpdateEditDectaskpercentdone(CCmdUI* pCmdUI);
	afx_msg void OnEditDectaskpriority();
	afx_msg void OnUpdateEditDectaskpriority(CCmdUI* pCmdUI);
	afx_msg void OnEditInctaskpriority();
	afx_msg void OnUpdateEditInctaskpriority(CCmdUI* pCmdUI);
	afx_msg void OnEditFlagtask();
	afx_msg void OnUpdateEditFlagtask(CCmdUI* pCmdUI);
	afx_msg void OnFileOpenarchive();
	afx_msg void OnUpdateFileOpenarchive(CCmdUI* pCmdUI);
	afx_msg void OnWindowPosChanged(WINDOWPOS FAR* lpwndpos);
	afx_msg void OnViewRefreshfilter();
	afx_msg void OnUpdateViewRefreshfilter(CCmdUI* pCmdUI);
	afx_msg void OnViewShowfilterbar();
	afx_msg void OnUpdateViewShowfilterbar(CCmdUI* pCmdUI);
	afx_msg void OnViewClearfilter();
	afx_msg void OnUpdateViewClearfilter(CCmdUI* pCmdUI);
	afx_msg void OnViewFilter();
	afx_msg void OnUpdateViewFilter(CCmdUI* pCmdUI);
	afx_msg void OnTabctrlPreferences();
	afx_msg void OnTasklistSelectColumns();
	afx_msg void OnViewProjectname();
	afx_msg void OnUpdateViewProjectname(CCmdUI* pCmdUI);
	afx_msg void OnEditOffsetdates();
	afx_msg void OnUpdateEditOffsetdates(CCmdUI* pCmdUI);
	afx_msg void OnPrintpreview();
	afx_msg void OnShowTimelogfile();
	afx_msg void OnUpdateShowTimelogfile(CCmdUI* pCmdUI);
	afx_msg void OnViewStatusBar();
	afx_msg void OnUpdateViewStatusBar(CCmdUI* pCmdUI);
	afx_msg BOOL OnQueryOpen();
	afx_msg void OnCopyTaskasRef();
	afx_msg void OnUpdateCopyTaskasRef(CCmdUI* pCmdUI);
	afx_msg void OnCopyTaskasDependency();
	afx_msg void OnUpdateCopyTaskasDependency(CCmdUI* pCmdUI);
	afx_msg void OnCopyTaskasRefFull();
	afx_msg void OnUpdateCopyTaskasRefFull(CCmdUI* pCmdUI);
	afx_msg void OnCopyTaskasDependencyFull();
	afx_msg void OnUpdateCopyTaskasDependencyFull(CCmdUI* pCmdUI);
	afx_msg void OnCopyTaskasPath();
	afx_msg void OnUpdateCopyTaskasPath(CCmdUI* pCmdUI);
	afx_msg void OnWindowPosChanging(WINDOWPOS FAR* lpwndpos);
	afx_msg void OnToolsCheckforupdates();
	afx_msg void OnShowKeyboardshortcuts();
	afx_msg void OnEditInsertdatetime();
	afx_msg void OnUpdateEditInsertdatetime(CCmdUI* pCmdUI);
	afx_msg void OnSysColorChange();
	afx_msg void OnEditCleartaskcolor();
	afx_msg void OnUpdateEditCleartaskcolor(CCmdUI* pCmdUI);
	afx_msg void OnEditSelectall();
	afx_msg void OnUpdateEditSelectall(CCmdUI* pCmdUI);
	afx_msg void OnCloseallbutthis();
	afx_msg void OnUpdateCloseallbutthis(CCmdUI* pCmdUI);
	afx_msg void OnSendtasks();
	afx_msg void OnEditInsertdate();
	afx_msg void OnUpdateEditInsertdate(CCmdUI* pCmdUI);
	afx_msg void OnGotoNexttask();
	afx_msg void OnGotoPrevtask();
	afx_msg void OnUpdateGotoPrevtask(CCmdUI* pCmdUI);
	afx_msg void OnUpdateGotoNexttask(CCmdUI* pCmdUI);
	//}}AFX_MSG
	afx_msg LRESULT OnSelchangeFilter(WPARAM wp, LPARAM lp);
	afx_msg void OnWindow(UINT nCmdID);
	afx_msg void OnUserUIExtension(UINT nCmdID);
	afx_msg void OnUpdateUserUIExtension(CCmdUI* pCmdUI);
	afx_msg void OnUserImport(UINT nCmdID);
	afx_msg void OnUserExport(UINT nCmdID);
	afx_msg void OnViewNext();
	afx_msg void OnUpdateViewNext(CCmdUI* pCmdUI);
	afx_msg void OnViewPrev();
	afx_msg void OnUpdateViewPrev(CCmdUI* pCmdUI);
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnUpdateImport(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewtask(CCmdUI* pCmdUI);
	afx_msg void OnToolsCheckout();
	afx_msg void OnUpdateToolsCheckout(CCmdUI* pCmdUI);
	afx_msg void OnToolsCheckin();
	afx_msg void OnUpdateToolsCheckin(CCmdUI* pCmdUI);
	afx_msg void OnExport();
	afx_msg void OnUpdateExport(CCmdUI* pCmdUI);
	afx_msg void OnNexttopleveltask();
	afx_msg void OnPrevtopleveltask();
	afx_msg void OnUpdateNexttopleveltask(CCmdUI* pCmdUI);
	afx_msg void OnUpdatePrevtopleveltask(CCmdUI* pCmdUI);
	afx_msg void OnFindTasks();
	afx_msg void OnViewMovetasklistright();
	afx_msg void OnUpdateViewMovetasklistright(CCmdUI* pCmdUI);
	afx_msg void OnViewMovetasklistleft();
	afx_msg void OnUpdateViewMovetasklistleft(CCmdUI* pCmdUI);
	afx_msg void OnViewToolbar();
	afx_msg void OnUpdateViewToolbar(CCmdUI* pCmdUI);
	afx_msg void OnSort();
	afx_msg void OnUpdateSort(CCmdUI* pCmdUI);
	afx_msg void OnNewtaskAttop();
	afx_msg void OnUpdateNewtaskAttop(CCmdUI* pCmdUI);
	afx_msg void OnNewtaskAtbottom();
	afx_msg void OnUpdateNewtaskAtbottom(CCmdUI* pCmdUI);
	afx_msg void OnSpellcheckcomments();
	afx_msg void OnUpdateSpellcheckcomments(CCmdUI* pCmdUI);
	afx_msg void OnSpellchecktitle();
	afx_msg void OnUpdateSpellchecktitle(CCmdUI* pCmdUI);
	afx_msg void OnFileEncrypt();
	afx_msg void OnUpdateFileEncrypt(CCmdUI* pCmdUI);
	afx_msg void OnFileResetversion();
	afx_msg void OnUpdateFileResetversion(CCmdUI* pCmdUI);
	afx_msg void OnSpellcheckTasklist();
	afx_msg void OnUpdateSpellcheckTasklist(CCmdUI* pCmdUI);
	afx_msg void OnEditPasteAfter();
	afx_msg void OnUpdateEditPasteAfter(CCmdUI* pCmdUI);
	afx_msg void OnEditTimeTrackTask();

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?