todolistwnd.h

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

H
553 行
字号
	afx_msg void OnUpdateEditTimeTrackTask(CCmdUI* pCmdUI);
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnViewNextSel();
	afx_msg void OnUpdateViewNextSel(CCmdUI* pCmdUI);
	afx_msg void OnViewPrevSel();
	afx_msg void OnUpdateViewPrevSel(CCmdUI* pCmdUI);
	afx_msg void OnEditCut();
	afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
	afx_msg void OnToolsToggleCheckin();
	afx_msg void OnUpdateToolsToggleCheckin(CCmdUI* pCmdUI);
	afx_msg void OnSplitTaskIntoPieces(UINT nCmdID);
	afx_msg void OnUpdateSplitTaskIntoPieces(CCmdUI* pCmdUI);
	afx_msg void OnToolsShowtasksDue(UINT nCmdID);
	afx_msg void OnDeleteTask();
	afx_msg void OnDeleteAllTasks();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnGetMinMaxInfo(MINMAXINFO FAR* lpMMI);
	afx_msg void OnSave();
	afx_msg void OnLoad();
	afx_msg void OnNew();
	afx_msg void OnUpdateDeletetask(CCmdUI* pCmdUI);
	afx_msg void OnUpdateTaskcolor(CCmdUI* pCmdUI);
	afx_msg void OnUpdateTaskdone(CCmdUI* pCmdUI);
	afx_msg void OnUpdateDeletealltasks(CCmdUI* pCmdUI);
	afx_msg void OnUpdateSave(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNew(CCmdUI* pCmdUI);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnNewtaskAttopSelected();
	afx_msg void OnNewtaskAtbottomSelected();
	afx_msg void OnNewtaskAfterselectedtask();
	afx_msg void OnNewtaskBeforeselectedtask();
	afx_msg void OnNewsubtaskAtbottom();
	afx_msg void OnNewsubtaskAttop();
	afx_msg void OnEditTaskcolor();
	afx_msg void OnEditTaskdone();
	afx_msg void OnEditTasktext();
	afx_msg void OnMovetaskdown();
	afx_msg void OnUpdateMovetaskdown(CCmdUI* pCmdUI);
	afx_msg void OnMovetaskup();
	afx_msg void OnUpdateMovetaskup(CCmdUI* pCmdUI);
	afx_msg void OnClose();
	afx_msg void OnTrayiconClose();
	afx_msg void OnUpdateNewsubtaskAtBottom(CCmdUI* pCmdUI);
	afx_msg void OnSaveas();
	afx_msg void OnUpdateSaveas(CCmdUI* pCmdUI);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnTrayiconShow();
	afx_msg void OnTrayiconShowDueTasks(UINT nCmdID);
	afx_msg BOOL OnQueryEndSession();
	afx_msg void OnUpdateRecentFileMenu(CCmdUI* pCmdUI);
	afx_msg void OnAbout();
	afx_msg void OnPreferences();
	afx_msg BOOL OnCopyData(CWnd* pWnd, COPYDATASTRUCT* pCopyDataStruct);
	afx_msg void OnEditCopy();
	afx_msg void OnEditPasteSub();
	afx_msg void OnEditCopyastext();
	afx_msg void OnEditCopyashtml();
	afx_msg void OnUpdateEditPasteSub(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewtaskAttopSelected(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewtaskAtbottomSelected(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewtaskAfterselectedtask(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewtaskBeforeselectedtask(CCmdUI* pCmdUI);
	afx_msg void OnUpdateNewsubtaskAttop(CCmdUI* pCmdUI);
	afx_msg void OnSimplemode();
	afx_msg void OnUpdateSimplemode(CCmdUI* pCmdUI);
	afx_msg void OnReload();
	afx_msg void OnUpdateReload(CCmdUI* pCmdUI);
	afx_msg void OnArchiveCompletedtasks();
	afx_msg void OnUpdateArchiveCompletedtasks(CCmdUI* pCmdUI);
	afx_msg void OnPrint();
	afx_msg void OnUpdatePrint(CCmdUI* pCmdUI);
	afx_msg void OnMovetaskright();
	afx_msg void OnUpdateMovetaskright(CCmdUI* pCmdUI);
	afx_msg void OnMovetaskleft();
	afx_msg void OnUpdateMovetaskleft(CCmdUI* pCmdUI);
	afx_msg void OnSelchangeTabcontrol(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelchangingTabcontrol(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnMBtnClickTabcontrol(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnCloseTasklist();
	afx_msg void OnSaveall();
	afx_msg void OnUpdateSaveall(CCmdUI* pCmdUI);
	afx_msg void OnCloseall();
	afx_msg void OnUpdateCloseall(CCmdUI* pCmdUI);
	afx_msg void OnExit();
	afx_msg void OnUpdateExit(CCmdUI* pCmdUI);
	afx_msg void OnUpdateMovetask(CCmdUI* pCmdUI);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnImportTasklist();
	afx_msg void OnSortBy(UINT nCmdID);
	afx_msg void OnUpdateSortBy(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditTasktext(CCmdUI* pCmdUI);
	afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
	afx_msg void OnTrayiconCreatetask();
	afx_msg void OnSetPriority(UINT nCmdUI);
	afx_msg void OnUpdateSetPriority(CCmdUI* pCmdUI);
	afx_msg void OnEditSetfileref();
	afx_msg void OnUpdateEditSetfileref(CCmdUI* pCmdUI);
	afx_msg void OnEditOpenfileref();
	afx_msg void OnUpdateEditOpenfileref(CCmdUI* pCmdUI);
	afx_msg void OnUpdateUserTool(CCmdUI* pCmdUI);
	afx_msg void OnUserTool(UINT nCmdID);
	afx_msg void OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu);
	afx_msg void OnTrayIconClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnTrayIconDblClk(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnTrayIconRClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnNeedTooltipText(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg BOOL OnOpenRecentFile(UINT nID);
	afx_msg void OnUpdateSBSelectionCount(CCmdUI* pCmdUI);
	afx_msg LRESULT OnGetIcon(WPARAM bLargeIcon, LPARAM /*not used*/);
	afx_msg LRESULT OnToDoCtrlNotifySort(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoCtrlNotifyMod(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoCtrlNotifyMinWidthChange(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoCtrlNotifyTimeTrack(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoCtrlDoTaskLink(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnToDoCtrlTaskIsDone(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnToDoListShowWindow(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoCtrlNotifyListChange(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoListGetVersion(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoListIsClosing(WPARAM /*wp*/, LPARAM /*lp*/) { return m_bClosing; }
	afx_msg LRESULT OnToDoListRefreshPrefs(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnToDoListRestore(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnFindDlgFind(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnFindSelectResult(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnFindSelectAll(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnFindDlgClose(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnDropFile(WPARAM wParam, LPARAM lParam);
	afx_msg LRESULT OnPreferencesTestTool(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnPreferencesClearMRU(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnPostOnCreate(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnWebUpdateWizard(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnAddToolbarTools(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnHotkey(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnPowerBroadcast(WPARAM wp, LPARAM lp);
	afx_msg LRESULT OnGetFont(WPARAM wp, LPARAM lp);

#ifdef _DEBUG
	afx_msg void OnDebugQueryEndSession() { SendMessage(WM_QUERYENDSESSION); }
#endif
	DECLARE_MESSAGE_MAP()
		
	// OnTimer helpers
	void OnTimerReadOnlyStatus(int nCtrl = -1);
	void OnTimerTimestampChange(int nCtrl = -1);
	void OnTimerAutoSave();
	void OnTimerCheckoutStatus(int nCtrl = -1);
	void OnTimerDueItems(int nCtrl = -1);
	void OnTimerTimeTracking();
	
	virtual void LoadSettings();
	virtual void SaveSettings();
	CRect OffsetCtrl(UINT uCtrlID, int cx = 0, int cy = 0);
	void RestorePosition();
	void RestoreVisibility();
	
	// tdc not const because we need to flush it first
	BOOL Export2Html(CFilteredToDoCtrl& tdc, LPCTSTR szFilePath, LPCTSTR szStylesheet = NULL) const;
	BOOL Export2Html(const CTaskFile& tasks, LPCTSTR szFilePath, LPCTSTR szStylesheet = NULL) const;

	TDC_FILE DelayOpenTaskList(LPCTSTR szFilePath); // 0 = failed, 1 = success, -1 = cancelled
	TDC_FILE OpenTaskList(LPCTSTR szFilePath, BOOL bNotifyDueTasks = TRUE); // 0 = failed, 1 = success, -1 = cancelled
	TDC_FILE OpenTaskList(CFilteredToDoCtrl* pCtrl, LPCTSTR szFilePath = NULL, LPCTSTR szArchivePath = NULL, TDC_ARCHIVE nRemove = TDC_REMOVEALL);
	void ReloadTaskList(int nIndex, BOOL bNotifyDueTasks);
	BOOL VerifyTaskListOpen(int nIndex, BOOL bWantNotifyDueTasks);

	BOOL ImportFile(LPCTSTR szFilePath);

	void InitShortcutManager();
	void InitMenuIconManager();
	void InitUIFont();
	BOOL LoadMenubar();
	BOOL InitCheckboxImageList();
	BOOL InitToolbar();
	BOOL InitStatusbar();

	BOOL NewTask(LPCTSTR szTitle, TDC_INSERTWHERE nInsertWhere, BOOL bSelect = TRUE, BOOL bEdit = TRUE);
	TDC_SORTBY GetSortBy(UINT nSortID);
	UINT GetSortID(TDC_SORTBY nSortBy);
	void CheckMinWidth();
	void MinimizeToTray();
	void Show(BOOL bAllowToggle);
	BOOL DoDueTaskNotification(const CFilteredToDoCtrl* pCtrl, int nDueBy);
	BOOL DoDueTaskNotification(int nDueBy); // works on active tasklist
	void DoExit();
	void RefreshPauseTimeTracking();
	void SetTimer(UINT nTimerID, BOOL bOn);
	void EnsureVisible();
	void RefreshTabOrder();
	void UpdateGlobalHotkey();
	LPCTSTR GetFileFilter();
	LPCTSTR GetDefaultFileExt();
	void DoPreferences(int nInitPage = -1);
	void DoPrint(BOOL bPreview = FALSE);
	void HandleLoadTasklistError(TDC_FILE nErr, LPCTSTR szTasklist);
	void CheckForUpdates(BOOL bManual);
	void UpdateCwd();
	BOOL WantTabBarVisible() const { return GetTDCCount() > 1 || !Prefs().GetAutoHideTabbar(); }

	enum { CT_ASHTML, CT_ASTEXT, CT_ASREF, CT_ASDEPENDS, CT_ASREFFULL, CT_ASDEPENDSFULL, CT_ASPATH };
	void CopySelectedTasksToClipboard(int nAsFormat);

	void RefreshFilterControls();
	void RefreshFilterLabelAlignment();
	
	void ResizeDlg(int cx = 0, int cy = 0, BOOL bMaximized = FALSE);
	BOOL CalcToDoCtrlRect(CRect& rect, int cx = 0, int cy = 0, BOOL bMaximized = FALSE);
	int ReposTabBar(CDeferWndMove& dwm, const CPoint& ptOrg, int nWidth, BOOL bCalcOnly = FALSE);

	void PrepareEditMenu(CMenu* pMenu);
	void PrepareSortMenu(CMenu* pMenu);
	void PrepareSourceControlMenu(CMenu* pMenu);

	int MapFindWhat(FIND_WHAT fw);
	void AddFindResult(const SEARCHRESULT& result, const SEARCHPARAMS& params, int nTaskList);
	
	void PrepareToolbar(int nOption);
	void SetToolbarOption(int nOption);
	void AppendTools2Toolbar(BOOL bAppend = TRUE);
	
	CFilteredToDoCtrl& GetToDoCtrl();
	CFilteredToDoCtrl& GetToDoCtrl(int nIndex);
	const CFilteredToDoCtrl& GetToDoCtrl() const;
	const CFilteredToDoCtrl& GetToDoCtrl(int nIndex) const;
	CFilteredToDoCtrl* NewToDoCtrl();
	BOOL CreateToDoCtrl(CFilteredToDoCtrl* pCtrl);
	int AddToDoCtrl(CFilteredToDoCtrl* pCtrl, BOOL bResizeDlg = TRUE);
	inline int GetTDCCount() const { return m_mgrToDoCtrls.GetCount(); }
	BOOL SelectToDoCtrl(LPCTSTR szFilePath, BOOL bCheckPassword, int nNotifyDueTasksBy = -1);
	BOOL SelectToDoCtrl(int nIndex, BOOL bCheckPassword, int nNotifyDueTasksBy = -1);
	int GetSelToDoCtrl() const;
	BOOL CreateNewTaskList(BOOL bAddDefTask);
	BOOL VerifyToDoCtrlPassword() const;
	BOOL VerifyToDoCtrlPassword(int nIndex) const;
	
	// caller must flush todoctrls if required before calling these
	BOOL CloseToDoCtrl(int nIndex);
	BOOL ConfirmSaveTaskList(int nIndex, BOOL bClosingTaskList, BOOL bClosingWindows);
	BOOL SaveTaskList(int nIndex, LPCTSTR szFilePath = NULL); // returns FALSE only if the user was prompted to save and cancelled
	BOOL SaveAll(BOOL bIncUnsaved, BOOL bClosingTaskLists, BOOL bClosingWindows, BOOL bFlush); // returns FALSE only if the user was prompted to save and cancelled
	
	void UpdateCaption();
	void UpdateStatusbar();
	void UpdateTabSwitchTooltip();
		
	void UpdateToDoCtrlPreferences(CFilteredToDoCtrl* pCtrl);
	void UpdateToDoCtrlPreferences();
	CPreferencesDlg& Prefs() const;
	void ResetPrefs();

	UINT MapNewTaskPos(int nPos, BOOL bSubtask);
	UINT GetNewTaskCmdID();
	UINT GetNewSubtaskCmdID();

	int MessageBox(UINT nIDText, UINT nIDCaption, UINT nType = MB_OK);
	int MessageBox(LPCTSTR szText, UINT nIDCaption, UINT nType = MB_OK);
	int MessageBox(LPCTSTR szText, LPCTSTR szCaption, UINT nType = MB_OK)
	{
		return CFrameWnd::MessageBox(szText, szCaption, nType);
	}

	int GetTasks(int nTDC, BOOL bWantCompleted, BOOL bWantIncomplete,
               BOOL bWantSelected, BOOL bWantSelSubtasks, BOOL bHtmlComments, 
			   BOOL bTransform, CTaskFile& tasks);

	void DoSendTasks(TD_SENDWHAT nWhat, TD_SENDAS nSendAs);

	TDC_ARCHIVE GetAutoArchiveOptions(LPCTSTR szFilePath, CString& sArchivePath) const;

	static void PrepareOpenFilePath(CString& sFilePath);
	static void EnableTDLProtocol(BOOL bEnable);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TODOLISTWND_H__13051D32_D372_4205_BA71_05FAC2159F1C__INCLUDED_)

⌨️ 快捷键说明

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