OSDN Git Service

Create TortoiseGitBlame
[tortoisegit/TortoiseGitJp.git] / src / TortoiseGitBlame / TortoiseGitBlameView.cpp
1 \r
2 // TortoiseGitBlameView.cpp : implementation of the CTortoiseGitBlameView class\r
3 //\r
4 \r
5 #include "stdafx.h"\r
6 #include "TortoiseGitBlame.h"\r
7 \r
8 #include "TortoiseGitBlameDoc.h"\r
9 #include "TortoiseGitBlameView.h"\r
10 \r
11 #ifdef _DEBUG\r
12 #define new DEBUG_NEW\r
13 #endif\r
14 \r
15 \r
16 // CTortoiseGitBlameView\r
17 \r
18 IMPLEMENT_DYNCREATE(CTortoiseGitBlameView, CView)\r
19 \r
20 BEGIN_MESSAGE_MAP(CTortoiseGitBlameView, CView)\r
21         // Standard printing commands\r
22         ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint)\r
23         ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint)\r
24         ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CTortoiseGitBlameView::OnFilePrintPreview)\r
25 END_MESSAGE_MAP()\r
26 \r
27 // CTortoiseGitBlameView construction/destruction\r
28 \r
29 CTortoiseGitBlameView::CTortoiseGitBlameView()\r
30 {\r
31         // TODO: add construction code here\r
32 \r
33 }\r
34 \r
35 CTortoiseGitBlameView::~CTortoiseGitBlameView()\r
36 {\r
37 }\r
38 \r
39 BOOL CTortoiseGitBlameView::PreCreateWindow(CREATESTRUCT& cs)\r
40 {\r
41         // TODO: Modify the Window class or styles here by modifying\r
42         //  the CREATESTRUCT cs\r
43 \r
44         return CView::PreCreateWindow(cs);\r
45 }\r
46 \r
47 // CTortoiseGitBlameView drawing\r
48 \r
49 void CTortoiseGitBlameView::OnDraw(CDC* /*pDC*/)\r
50 {\r
51         CTortoiseGitBlameDoc* pDoc = GetDocument();\r
52         ASSERT_VALID(pDoc);\r
53         if (!pDoc)\r
54                 return;\r
55 \r
56         // TODO: add draw code for native data here\r
57 }\r
58 \r
59 \r
60 // CTortoiseGitBlameView printing\r
61 \r
62 \r
63 void CTortoiseGitBlameView::OnFilePrintPreview()\r
64 {\r
65         AFXPrintPreview(this);\r
66 }\r
67 \r
68 BOOL CTortoiseGitBlameView::OnPreparePrinting(CPrintInfo* pInfo)\r
69 {\r
70         // default preparation\r
71         return DoPreparePrinting(pInfo);\r
72 }\r
73 \r
74 void CTortoiseGitBlameView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)\r
75 {\r
76         // TODO: add extra initialization before printing\r
77 }\r
78 \r
79 void CTortoiseGitBlameView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)\r
80 {\r
81         // TODO: add cleanup after printing\r
82 }\r
83 \r
84 void CTortoiseGitBlameView::OnRButtonUp(UINT nFlags, CPoint point)\r
85 {\r
86         ClientToScreen(&point);\r
87         OnContextMenu(this, point);\r
88 }\r
89 \r
90 void CTortoiseGitBlameView::OnContextMenu(CWnd* pWnd, CPoint point)\r
91 {\r
92         theApp.GetContextMenuManager()->ShowPopupMenu(IDR_POPUP_EDIT, point.x, point.y, this, TRUE);\r
93 }\r
94 \r
95 \r
96 // CTortoiseGitBlameView diagnostics\r
97 \r
98 #ifdef _DEBUG\r
99 void CTortoiseGitBlameView::AssertValid() const\r
100 {\r
101         CView::AssertValid();\r
102 }\r
103 \r
104 void CTortoiseGitBlameView::Dump(CDumpContext& dc) const\r
105 {\r
106         CView::Dump(dc);\r
107 }\r
108 \r
109 CTortoiseGitBlameDoc* CTortoiseGitBlameView::GetDocument() const // non-debug version is inline\r
110 {\r
111         ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CTortoiseGitBlameDoc)));\r
112         return (CTortoiseGitBlameDoc*)m_pDocument;\r
113 }\r
114 #endif //_DEBUG\r
115 \r
116 \r
117 // CTortoiseGitBlameView message handlers\r