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.
20 #include "StandAloneDlg.h"
21 #include "RevisionGraph/AllGraphOptions.h"
22 #include "ProgressDlg.h"
24 #include "RevisionGraphWnd.h"
25 #include "StandAloneDlg.h"
28 * \ingroup TortoiseProc
29 * Helper class extending CToolBar, needed only to have the toolbar include
32 class CRevGraphToolBar
: public CToolBar
35 CComboBoxEx m_ZoomCombo
;
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
)
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();
64 char m_szTip
[MAX_TT_LENGTH
+1];
65 wchar_t m_wszTip
[MAX_TT_LENGTH
+1];
71 BOOL
InitializeToolbar();
73 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
74 virtual BOOL
OnInitDialog();
75 virtual void OnCancel();
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();
109 void UpdateZoomBox();
110 void UpdateOptionAvailability (UINT id
, bool available
);
111 void UpdateOptionAvailability();
113 static UINT
WorkerThread(LPVOID pVoid
);
116 CRevisionGraphWnd m_Graph
;
117 CStatusBarCtrl m_StatusBar
;
118 CRevGraphToolBar m_ToolBar
;
119 ULONG_PTR m_gdiPlusToken
;