Modify position of filter and date at log dialog
[TortoiseGit.git] / src / TortoiseProc / RevisionGraph / RevisionGraphDlg.h
blob0abf674dd774dd88d18094cd288e0b1f06db7d08
1 // TortoiseSVN - a Windows shell extension for easy version control
3 // Copyright (C) 2003-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
20 #include "StandAloneDlg.h"
21 #include "RevisionGraph/AllGraphOptions.h"
22 #include "ProgressDlg.h"
23 #include "Colors.h"
24 #include "RevisionGraphWnd.h"
25 #include "StandAloneDlg.h"
27 /**
28 * \ingroup TortoiseProc
29 * Helper class extending CToolBar, needed only to have the toolbar include
30 * a combobox.
32 class CRevGraphToolBar : public CToolBar
34 public:
35 CComboBoxEx m_ZoomCombo;
38 /**
39 * \ingroup TortoiseProc
40 * A dialog showing a revision graph.
42 * The analyzation of the log data is done in the child class CRevisionGraph,
43 * the drawing is done in the member class CRevisionGraphWnd
44 * Here, we handle window messages.
46 class CRevisionGraphDlg : public CResizableStandAloneDialog
48 DECLARE_DYNAMIC(CRevisionGraphDlg)
49 public:
50 CRevisionGraphDlg(CWnd* pParent = NULL); // standard constructor
51 virtual ~CRevisionGraphDlg();
52 enum { IDD = IDD_REVISIONGRAPH };
55 void SetPath(const CString& sPath) {m_Graph.m_sPath = sPath;}
56 void SetPegRevision(SVNRev revision) {m_Graph.m_pegRev = revision;}
57 void DoZoom (float factor);
59 void UpdateFullHistory();
60 void StartWorkerThread();
62 protected:
63 bool m_bFetchLogs;
64 char m_szTip[MAX_TT_LENGTH+1];
65 wchar_t m_wszTip[MAX_TT_LENGTH+1];
67 CString m_sFilter;
69 HACCEL m_hAccel;
71 BOOL InitializeToolbar();
73 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
74 virtual BOOL OnInitDialog();
75 virtual void OnCancel();
76 virtual void OnOK();
77 virtual BOOL PreTranslateMessage(MSG* pMsg);
78 afx_msg void OnSize(UINT nType, int cx, int cy);
79 afx_msg void OnViewFilter();
80 afx_msg void OnViewZoomin();
81 afx_msg void OnViewZoomout();
82 afx_msg void OnViewZoom100();
83 afx_msg void OnViewZoomHeight();
84 afx_msg void OnViewZoomWidth();
85 afx_msg void OnViewZoomAll();
86 afx_msg void OnViewCompareheadrevisions();
87 afx_msg void OnViewComparerevisions();
88 afx_msg void OnViewUnifieddiff();
89 afx_msg void OnViewUnifieddiffofheadrevisions();
90 afx_msg void OnViewShowoverview();
91 afx_msg void OnFileSavegraphas();
92 afx_msg void OnMenuexit();
93 afx_msg void OnMenuhelp();
94 afx_msg void OnChangeZoom();
95 afx_msg BOOL OnToggleOption (UINT controlID);
96 afx_msg BOOL OnToggleReloadOption (UINT controlID);
97 afx_msg BOOL OnToggleRedrawOption (UINT controlID);
98 afx_msg BOOL OnToolTipNotify (UINT id, NMHDR *pNMHDR, LRESULT *pResult);
100 DECLARE_MESSAGE_MAP()
102 BOOL ToggleOption (UINT controlID);
103 void SetOption (UINT controlID);
105 CRect GetGraphRect();
106 void UpdateStatusBar();
108 private:
109 void UpdateZoomBox();
110 void UpdateOptionAvailability (UINT id, bool available);
111 void UpdateOptionAvailability();
113 static UINT WorkerThread(LPVOID pVoid);
115 float m_fZoomFactor;
116 CRevisionGraphWnd m_Graph;
117 CStatusBarCtrl m_StatusBar;
118 CRevGraphToolBar m_ToolBar;
119 ULONG_PTR m_gdiPlusToken;