OSDN Git Service

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