// Modify the following defines if you have to target a platform prior to the ones specified below.\r
// Refer to MSDN for the latest info on corresponding values for different platforms.\r
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.\r
-#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define WINVER 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.\r
-#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.\r
#include "TortoiseGitBlameDoc.h"\r
#include "TortoiseGitBlameView.h"\r
#include "MainFrm.h"\r
+#include "Balloon.h"\r
\r
#ifdef _DEBUG\r
#define new DEBUG_NEW\r
m_wEditor = m_TextView.m_hWnd;\r
CreateFont();\r
InitialiseEditor();\r
+ m_ToolTip.Create(this->GetParent()); \r
+ m_ToolTip.AddTool(this,_T("Test"));\r
+ \r
return CView::OnCreate(lpcs);\r
}\r
\r
::SetTextColor(hDC, m_textcolor);\r
if (m_CommitHash[i].GetLength()>0)\r
{\r
- if (m_CommitHash[i].Compare(m_MouseHash)==0)\r
- ::SetBkColor(hDC, m_mouseauthorcolor);\r
+ //if (m_CommitHash[i].Compare(m_MouseHash)==0)\r
+ // ::SetBkColor(hDC, m_mouseauthorcolor);\r
if (m_CommitHash[i].Compare(m_SelectedHash)==0)\r
{\r
::SetBkColor(hDC, m_selectedauthorcolor);\r
this->Invalidate();\r
this->m_TextView.Invalidate();\r
\r
+}\r
+\r
+void CTortoiseGitBlameView::OnMouseHover(UINT nFlags, CPoint point)\r
+{\r
+\r
+ LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE);\r
+ LONG_PTR height = SendEditor(SCI_TEXTHEIGHT);\r
+ line = line + (point.y/height);\r
+ \r
+ if (line < (LONG)m_CommitHash.size())\r
+ {\r
+ if (line != m_MouseLine)\r
+ {\r
+ m_MouseLine = line;//m_CommitHash[line];\r
+// app.m_selectedorigrev = app.origrevs[line];\r
+// app.m_selectedauthor = app.authors[line];\r
+// app.m_selecteddate = app.dates[line];\r
+ \r
+ \r
+ GitRev *pRev;\r
+ pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]);\r
+ //this->GetDocument()->GetMainFrame()->m_wndProperties.UpdateProperties(pRev);\r
+ this->ClientToScreen(&point);\r
+ //BALLOON_INFO bi;\r
+ //if(m_ToolTip.GetTool(this, bi))\r
+ //{\r
+ // bi.sBalloonTip=pRev->m_CommitHash;\r
+ CString str;\r
+ str.Format(_T("%s\n<b>%s</b>\n%s"),pRev->m_CommitHash,pRev->m_Subject,pRev->m_AuthorDate.Format(_T("%Y-%m-%d %H:%M")));\r
+ m_ToolTip.AddTool(this,str);\r
+ m_ToolTip.DisplayToolTip(&point);\r
+ //}\r
+\r
+ }\r
+ else\r
+ {\r
+ m_MouseLine=-1;\r
+// app.m_selecteddate.clear();\r
+// app.m_selectedrev = -2;\r
+// app.m_selectedorigrev = -2;\r
+ }\r
+ //::InvalidateRect( NULL, FALSE);\r
+ //this->Invalidate();\r
+ }\r
+ \r
+// const CString str=_T("this is a <b>Message Balloon</b>\n<hr=100%>\n<ct=0x0000FF>Warning! Warning!</ct>\nSomething unexpected happened");\r
+ //CBalloon::ShowBalloon(NULL, point, \r
+ // str,\r
+ // FALSE, (HICON)IDI_EXCLAMATION,\r
+ // (UINT)CBalloon ::BALLOON_RIGHT_TOP, (UINT)CBalloon ::BALLOON_EFFECT_SOLID,(COLORREF)NULL, (COLORREF)NULL, (COLORREF)NULL);\r
+}\r
+\r
+void CTortoiseGitBlameView::OnMouseMove(UINT nFlags, CPoint point)\r
+{\r
+ TRACKMOUSEEVENT tme;\r
+ tme.cbSize=sizeof(TRACKMOUSEEVENT);\r
+ tme.dwFlags=TME_HOVER|TME_LEAVE;\r
+ tme.hwndTrack=this->m_hWnd;\r
+ tme.dwHoverTime=1;\r
+ TrackMouseEvent(&tme);\r
+}\r
+\r
+\r
+BOOL CTortoiseGitBlameView::PreTranslateMessage(MSG* pMsg)\r
+{\r
+ m_ToolTip.RelayEvent(pMsg);\r
+ return CView::PreTranslateMessage(pMsg);\r
}
\ No newline at end of file
#include "SciEdit.h"\r
\r
#include "GitBlameLogList.h"\r
+#include "Balloon.h"\r
\r
const COLORREF black = RGB(0,0,0);\r
const COLORREF white = RGB(0xff,0xff,0xff);\r
\r
// Generated message map functions\r
protected:\r
+ BOOL PreTranslateMessage(MSG* pMsg);\r
afx_msg void OnFilePrintPreview();\r
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);\r
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);\r
afx_msg void OnLButtonDown(UINT nFlags,CPoint point);\r
afx_msg void OnRButtonDown(UINT nFlags,CPoint point){OnLButtonDown(nFlags,point);CView::OnRButtonDown(nFlags,point);};\r
afx_msg void OnSciGetBkColor(NMHDR*, LRESULT*);\r
+ afx_msg void OnMouseHover(UINT nFlags, CPoint point);\r
+ afx_msg void OnMouseMove(UINT nFlags, CPoint point);\r
DECLARE_MESSAGE_MAP()\r
\r
public:\r
void FocusOn(GitRev *pRev);\r
\r
CSciEdit m_TextView;\r
+ CBalloon m_ToolTip;\r
\r
HINSTANCE hInstance;\r
HINSTANCE hResource;\r
void SetSelectedLine(LONG line) { m_SelectedLine=line;};\r
\r
LONG m_mouserev;\r
- CString m_MouseHash;\r
+ LONG m_MouseLine;\r
LONG m_selectedrev;\r
LONG m_selectedorigrev;\r
CString m_SelectedHash;\r
// Modify the following defines if you have to target a platform prior to the ones specified below.\r
// Refer to MSDN for the latest info on corresponding values for different platforms.\r
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.\r
-#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define WINVER 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.\r
-#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.\r
// Modify the following defines if you have to target a platform prior to the ones specified below.\r
// Refer to MSDN for the latest info on corresponding values for different platforms.\r
#ifndef WINVER // Specifies that the minimum required platform is Windows Vista.\r
-#define WINVER 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define WINVER 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista.\r
-#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows.\r
+#define _WIN32_WINNT 0x0500 // Change this to the appropriate value to target other versions of Windows.\r
#endif\r
\r
#ifndef _WIN32_WINDOWS // Specifies that the minimum required platform is Windows 98.\r