1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2009-2012 - TortoiseGit
4 // Copyright (C) 2012 - Sven Strickroth <email@cs-ware.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 #include "StandAloneDlg.h"
26 #define REPOBROWSER_CTRL_MIN_WIDTH 20
28 class CShadowFilesTree
;
30 typedef std::map
<CString
, CShadowFilesTree
> TShadowFilesTreeMap
;
32 class CShadowFilesTree
48 TShadowFilesTreeMap m_ShadowTree
;
49 CShadowFilesTree
* m_pParent
;
51 CString
GetFullName() const
53 if (m_pParent
== NULL
)
56 return m_pParent
->GetFullName() + _T("/") + m_sName
;
59 typedef std::vector
<CShadowFilesTree
*> TShadowFilesTreeList
;
61 class CRepositoryBrowser
: public CResizableStandAloneDialog
63 DECLARE_DYNAMIC(CRepositoryBrowser
)
66 CRepositoryBrowser(CString rev
, CWnd
* pParent
= NULL
); // standard constructor
67 virtual ~CRepositoryBrowser();
70 enum { IDD
= IDD_REPOSITORY_BROWSER
};
72 static bool s_bSortLogical
;
76 eCmd_ViewLog
= WM_APP
,
89 virtual void DoDataExchange(CDataExchange
* pDX
); // DDX/DDV support
94 afx_msg
void OnCancel();
95 virtual BOOL
OnInitDialog();
100 afx_msg
void OnLvnColumnclickRepoList(NMHDR
*pNMHDR
, LRESULT
*pResult
);
104 CShadowFilesTree m_TreeRoot
;
105 int ReadTreeRecursive(git_repository
&repo
, git_tree
* tree
, CShadowFilesTree
* treeroot
);
106 int ReadTree(CShadowFilesTree
* treeroot
);
108 int m_nOpenIconFolder
;
112 void FillListCtrlForTreeNode(HTREEITEM treeNode
);
113 void FillListCtrlForShadowTree(CShadowFilesTree
* pTree
);
114 afx_msg
void OnTvnSelchangedRepoTree(NMHDR
*pNMHDR
, LRESULT
*pResult
);
116 afx_msg
void OnNMDblclk_RepoList(NMHDR
*pNMHDR
, LRESULT
*pResult
);
117 afx_msg
void OnContextMenu(CWnd
* pWndFrom
, CPoint point
);
118 void OnContextMenu_RepoList(CPoint point
);
120 void FileSaveAs(const CString path
);
122 afx_msg
void OnBnClickedButtonRevision();
124 virtual BOOL
PreTranslateMessage(MSG
* pMsg
);
126 /// resizes the control so that the divider is at position 'point'
127 void HandleDividerMove(CPoint point
, bool bDraw
);
129 void SaveDividerPosition();
131 /// draws the bar when the tree and list control are resized
132 void DrawXorBar(CDC
* pDC
, int x1
, int y1
, int width
, int height
);
133 afx_msg BOOL
OnSetCursor(CWnd
* pWnd
, UINT nHitTest
, UINT message
);
134 afx_msg
void OnMouseMove(UINT nFlags
, CPoint point
);
135 afx_msg
void OnCaptureChanged(CWnd
*pWnd
);
136 afx_msg
void OnLButtonDown(UINT nFlags
, CPoint point
);
137 afx_msg
void OnLButtonUp(UINT nFlags
, CPoint point
);