X-Git-Url: http://git.sourceforge.jp/view?p=tortoisegit%2FTortoiseGitJp.git;a=blobdiff_plain;f=src%2FTortoiseGitBlame%2FTortoiseGitBlameView.cpp;h=c5a679634fad1dede32d6c2c2ecc03b9e8f74d94;hp=97fedbe9e754ae76e5c8cf686db670a7ebd647b0;hb=37cc0a5dac9c85bc5c55996c282678ed7947afd6;hpb=c6a39f9102d652432a14c9cc97d968fb5bda3b8d diff --git a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp index 97fedbe..c5a6796 100644 --- a/src/TortoiseGitBlame/TortoiseGitBlameView.cpp +++ b/src/TortoiseGitBlame/TortoiseGitBlameView.cpp @@ -25,11 +25,14 @@ #include "TortoiseGitBlameDoc.h" #include "TortoiseGitBlameView.h" #include "MainFrm.h" +#include "Balloon.h" +#include "EditGotoDlg.h" #ifdef _DEBUG #define new DEBUG_NEW #endif +UINT CTortoiseGitBlameView::m_FindDialogMessage; // CTortoiseGitBlameView @@ -40,10 +43,21 @@ BEGIN_MESSAGE_MAP(CTortoiseGitBlameView, CView) ON_COMMAND(ID_FILE_PRINT, &CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_DIRECT, &CView::OnFilePrint) ON_COMMAND(ID_FILE_PRINT_PREVIEW, &CTortoiseGitBlameView::OnFilePrintPreview) + ON_COMMAND(ID_EDIT_FIND,OnEditFind) + ON_COMMAND(ID_EDIT_GOTO,OnEditGoto) ON_WM_CREATE() ON_WM_SIZE() + ON_WM_MOUSEMOVE() + ON_WM_MOUSEHOVER() + ON_WM_MOUSELEAVE() + ON_WM_LBUTTONDOWN() + ON_WM_RBUTTONDOWN() + ON_NOTIFY(SCN_PAINTED,0,OnSciPainted) + ON_NOTIFY(SCN_GETBKCOLOR,0,OnSciGetBkColor) + ON_REGISTERED_MESSAGE(m_FindDialogMessage, OnFindDialogMessage) END_MESSAGE_MAP() + // CTortoiseGitBlameView construction/destruction CTortoiseGitBlameView::CTortoiseGitBlameView() @@ -58,7 +72,7 @@ CTortoiseGitBlameView::CTortoiseGitBlameView() m_font = 0; m_italicfont = 0; - m_blamewidth = 100; + m_blamewidth = 0; m_revwidth = 0; m_datewidth = 0; m_authorwidth = 0; @@ -85,6 +99,12 @@ CTortoiseGitBlameView::CTortoiseGitBlameView() m_colorage = true; m_bShowLine=true; + + m_bShowAuthor=true; + m_bShowDate=false; + + m_FindDialogMessage = ::RegisterWindowMessage(FINDMSGSTRING); + m_pFindDialog = NULL; } CTortoiseGitBlameView::~CTortoiseGitBlameView() @@ -101,7 +121,7 @@ int CTortoiseGitBlameView::OnCreate(LPCREATESTRUCT lpcs) CRect rect,rect1; this->GetWindowRect(&rect1); - rect.left=m_blamewidth; + rect.left=m_blamewidth+LOCATOR_WIDTH; rect.right=rect.Width(); rect.top=0; rect.bottom=rect.Height(); @@ -112,7 +132,12 @@ int CTortoiseGitBlameView::OnCreate(LPCREATESTRUCT lpcs) m_wEditor = m_TextView.m_hWnd; CreateFont(); InitialiseEditor(); + m_ToolTip.Create(this->GetParent()); + m_ToolTip.AddTool(this,_T("Test")); + + ::AfxGetApp()->GetMainWnd(); return CView::OnCreate(lpcs); + } void CTortoiseGitBlameView::OnSize(UINT nType,int cx, int cy) @@ -145,6 +170,7 @@ void CTortoiseGitBlameView::OnDraw(CDC* /*pDC*/) return; DrawBlame(this->GetDC()->m_hDC); + DrawLocatorBar(this->GetDC()->m_hDC); // TODO: add draw code for native data here } @@ -570,7 +596,7 @@ void CTortoiseGitBlameView::InitialiseEditor() void CTortoiseGitBlameView::StartSearch() { - if (currentDialog) + if (m_pFindDialog) return; bool bCase = false; // Initialize FINDREPLACE @@ -587,87 +613,53 @@ void CTortoiseGitBlameView::StartSearch() currentDialog = FindText(&fr); } -bool CTortoiseGitBlameView::DoSearch(LPSTR what, DWORD flags) +bool CTortoiseGitBlameView::DoSearch(CString what, DWORD flags) { -#if 0 - TCHAR szWhat[80]; + + //char szWhat[80]; int pos = SendEditor(SCI_GETCURRENTPOS); int line = SendEditor(SCI_LINEFROMPOSITION, pos); bool bFound = false; bool bCaseSensitive = !!(flags & FR_MATCHCASE); - strcpy_s(szWhat, sizeof(szWhat), what); + //strcpy_s(szWhat, sizeof(szWhat), what); if(!bCaseSensitive) { - char *p; - size_t len = strlen(szWhat); - for (p = szWhat; p < szWhat + len; p++) - { - if (isupper(*p)&&__isascii(*p)) - *p = _tolower(*p); - } + what=what.MakeLower(); } - CString sWhat = CString(szWhat); + //CString sWhat = CString(szWhat); - char buf[20]; - int i=0; - for (i=line; (i<(int)authors.size())&&(!bFound); ++i) + //char buf[20]; + //int i=0; + int i=line; + do { int bufsize = SendEditor(SCI_GETLINE, i); char * linebuf = new char[bufsize+1]; SecureZeroMemory(linebuf, bufsize+1); SendEditor(SCI_GETLINE, i, (LPARAM)linebuf); + CString oneline=this->m_TextView.StringFromControl(linebuf); if (!bCaseSensitive) { - char *p; - for (p = linebuf; p < linebuf + bufsize; p++) - { - if (isupper(*p)&&__isascii(*p)) - *p = _tolower(*p); - } + oneline=oneline.MakeLower(); } - _stprintf_s(buf, 20, _T("%ld"), revs[i]); - if (authors[i].compare(sWhat)==0) + //_stprintf_s(buf, 20, _T("%ld"), revs[i]); + if (this->m_Authors[i].Find(what)>=0) bFound = true; - else if ((!bCaseSensitive)&&(_stricmp(authors[i].c_str(), szWhat)==0)) + else if ((!bCaseSensitive)&&(this->m_Authors[i].MakeLower().Find(what)>=0)) bFound = true; - else if (strcmp(buf, szWhat) == 0) - bFound = true; - else if (strstr(linebuf, szWhat)) + else if (oneline.Find(what) >=0) bFound = true; + delete [] linebuf; - } - if (!bFound) - { - for (i=0; (i=m_CommitHash.size()) + i=0; + }while(i!=line &&(!bFound)); + if (bFound) { GotoLine(i); @@ -679,21 +671,20 @@ bool CTortoiseGitBlameView::DoSearch(LPSTR what, DWORD flags) } else { - ::MessageBox(wMain, searchstringnotfound, "CTortoiseGitBlameView", MB_ICONINFORMATION); + ::MessageBox(wMain, what+_T(" not found"), _T("CTortoiseGitBlameView"), MB_ICONINFORMATION); } -#endif + return true; } bool CTortoiseGitBlameView::GotoLine(long line) { -#if 0 --line; if (line < 0) return false; - if ((unsigned long)line >= authors.size()) + if ((unsigned long)line >= m_CommitHash.size()) { - line = authors.size()-1; + line = m_CommitHash.size()-1; } int nCurrentPos = SendEditor(SCI_GETCURRENTPOS); @@ -723,7 +714,7 @@ bool CTortoiseGitBlameView::GotoLine(long line) int nPosStart = SendEditor(SCI_POSITIONFROMLINE,line); int nPosEnd = SendEditor(SCI_GETLINEENDPOSITION,line); SendEditor(SCI_SETSEL,nPosEnd,nPosStart); -#endif + return true; } @@ -994,38 +985,58 @@ void CTortoiseGitBlameView::GotoLineDlg() LONG CTortoiseGitBlameView::GetBlameWidth() { -#if 0 - if (m_blamewidth) - return m_blamewidth; LONG blamewidth = 0; SIZE width; CreateFont(); - HDC hDC = ::GetDC(wBlame); + HDC hDC = this->GetDC()->m_hDC; HFONT oldfont = (HFONT)::SelectObject(hDC, m_font); + TCHAR buf[MAX_PATH]; - _stprintf_s(buf, MAX_PATH, _T("%8ld "), 88888888); + //_stprintf_s(buf, MAX_PATH, _T("%8ld "), 88888888); + //::GetTextExtentPoint(hDC, buf, _tcslen(buf), &width); + //m_revwidth = width.cx + BLAMESPACE; + //blamewidth += m_revwidth; + + int maxnum=0; + for (int i=0;im_Authors.size();i++) + { + if(m_ID[i]>maxnum) + maxnum=m_ID[i]; + } + _stprintf_s(buf, MAX_PATH, _T("%d."), maxnum); ::GetTextExtentPoint(hDC, buf, _tcslen(buf), &width); m_revwidth = width.cx + BLAMESPACE; blamewidth += m_revwidth; - if (ShowDate) + +#if 0 + _stprintf_s(buf, MAX_PATH, _T("%d"), m_CommitHash.size()); + ::GetTextExtentPoint(hDC, buf, _tcslen(buf), &width); + m_linewidth = width.cx + BLAMESPACE; + blamewidth += m_revwidth; +#endif + + if (m_bShowDate) { _stprintf_s(buf, MAX_PATH, _T("%30s"), _T("31.08.2001 06:24:14")); ::GetTextExtentPoint32(hDC, buf, _tcslen(buf), &width); m_datewidth = width.cx + BLAMESPACE; blamewidth += m_datewidth; } - if (ShowAuthor) + if ( m_bShowAuthor) { SIZE maxwidth = {0}; - for (std::vector::iterator I = authors.begin(); I != authors.end(); ++I) + + for (int i=0;im_Authors.size();i++) + //for (std::vector::iterator I = authors.begin(); I != authors.end(); ++I) { - ::GetTextExtentPoint32(hDC, I->c_str(), I->size(), &width); + ::GetTextExtentPoint32(hDC,m_Authors[i] , m_Authors[i].GetLength(), &width); if (width.cx > maxwidth.cx) maxwidth = width; } m_authorwidth = maxwidth.cx + BLAMESPACE; blamewidth += m_authorwidth; } +#if 0 if (ShowPath) { SIZE maxwidth = {0}; @@ -1038,14 +1049,16 @@ LONG CTortoiseGitBlameView::GetBlameWidth() m_pathwidth = maxwidth.cx + BLAMESPACE; blamewidth += m_pathwidth; } +#endif ::SelectObject(hDC, oldfont); POINT pt = {blamewidth, 0}; LPtoDP(hDC, &pt, 1); m_blamewidth = pt.x; - ReleaseDC(wBlame, hDC); -#endif + //::ReleaseDC(wBlame, hDC); + //return m_blamewidth; - return 100; + return blamewidth; + } void CTortoiseGitBlameView::CreateFont() @@ -1099,8 +1112,8 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC) ::SetTextColor(hDC, m_textcolor); if (m_CommitHash[i].GetLength()>0) { - if (m_CommitHash[i].Compare(m_MouseHash)==0) - ::SetBkColor(hDC, m_mouseauthorcolor); + //if (m_CommitHash[i].Compare(m_MouseHash)==0) + // ::SetBkColor(hDC, m_mouseauthorcolor); if (m_CommitHash[i].Compare(m_SelectedHash)==0) { ::SetBkColor(hDC, m_selectedauthorcolor); @@ -1108,6 +1121,10 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC) sel = TRUE; } } + + if(m_MouseLine == i) + ::SetBkColor(hDC, m_mouserevcolor); + //if ((revs[i] == m_mouserev)&&(!sel)) // ::SetBkColor(hDC, m_mouserevcolor); //if (revs[i] == m_selectedrev) @@ -1117,14 +1134,23 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC) //} CString str; - str.Format(_T("%d.%s"),m_ID[i],m_Authors[i]); + str.Format(_T("%d"),m_ID[i]); //_stprintf_s(buf, MAX_PATH, _T("%8ld "), revs[i]); - rc.top=Y;rc.left=0; + rc.top=Y; + rc.left=LOCATOR_WIDTH; rc.bottom=Y+height; - rc.right = rc.left + 100; - ::ExtTextOut(hDC, 0, Y, ETO_CLIPPED, &rc, str, str.GetLength(), 0); + rc.right = rc.left + m_blamewidth; + ::ExtTextOut(hDC, LOCATOR_WIDTH, Y, ETO_CLIPPED, &rc, str, str.GetLength(), 0); int Left = m_revwidth; + + if (m_bShowAuthor) + { + rc.right = rc.left + Left + m_authorwidth; + //_stprintf_s(buf, MAX_PATH, _T("%-30s "), authors[i].c_str()); + ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, m_Authors[i], m_Authors[i].GetLength(), 0); + Left += m_authorwidth; + } #if 0 if (ShowDate) { @@ -1133,13 +1159,7 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC) ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0); Left += m_datewidth; } - if (ShowAuthor) - { - rc.right = rc.left + Left + m_authorwidth; - _stprintf_s(buf, MAX_PATH, _T("%-30s "), authors[i].c_str()); - ::ExtTextOut(hDC, Left, Y, ETO_CLIPPED, &rc, buf, _tcslen(buf), 0); - Left += m_authorwidth; - } + #endif #if 0 if (ShowPath) @@ -1150,7 +1170,7 @@ void CTortoiseGitBlameView::DrawBlame(HDC hDC) Left += m_authorwidth; } #endif - if ((i==m_SelectedLine)&&(currentDialog)) + if ((i==m_SelectedLine)&&(m_pFindDialog)) { LOGBRUSH brush; brush.lbColor = m_textcolor; @@ -1226,7 +1246,6 @@ void CTortoiseGitBlameView::DrawHeader(HDC hDC) void CTortoiseGitBlameView::DrawLocatorBar(HDC hDC) { -#if 0 if (hDC == NULL) return; @@ -1236,13 +1255,17 @@ void CTortoiseGitBlameView::DrawLocatorBar(HDC hDC) COLORREF blackColor = GetSysColor(COLOR_WINDOWTEXT); RECT rc; - ::GetClientRect(wLocator, &rc); + //::GetClientRect(wLocator, &rc); + this->GetClientRect(&rc); + + rc.right=LOCATOR_WIDTH; + RECT lineRect = rc; LONG height = rc.bottom-rc.top; LONG currentLine = 0; // draw the colored bar - for (std::vector::const_iterator it = revs.begin(); it != revs.end(); ++it) + for (std::vector::const_iterator it = m_ID.begin(); it != m_ID.end(); ++it) { currentLine++; // get the line color @@ -1253,23 +1276,23 @@ void CTortoiseGitBlameView::DrawLocatorBar(HDC hDC) } SetBkColor(hDC, cr); lineRect.top = Y; - lineRect.bottom = (currentLine * height / revs.size()); + lineRect.bottom = (currentLine * height / m_ID.size()); ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL); Y = lineRect.bottom; } - if (revs.size()) + if (m_ID.size()) { // now draw two lines indicating the scroll position of the source view SetBkColor(hDC, blackColor); - lineRect.top = line * height / revs.size(); + lineRect.top = line * height / m_ID.size(); lineRect.bottom = lineRect.top+1; ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL); - lineRect.top = (line + linesonscreen) * height / revs.size(); + lineRect.top = (line + linesonscreen) * height / m_ID.size(); lineRect.bottom = lineRect.top+1; ::ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &lineRect, NULL, 0, NULL); } -#endif + } void CTortoiseGitBlameView::StringExpand(LPSTR str) @@ -1900,34 +1923,6 @@ LRESULT CALLBACK WndBlameProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa // fall through case WM_LBUTTONDOWN: { - int y = ((int)(short)HIWORD(lParam)); - LONG_PTR line = app.SendEditor(SCI_GETFIRSTVISIBLELINE); - LONG_PTR height = app.SendEditor(SCI_TEXTHEIGHT); - line = line + (y/height); - if (line < (LONG)app.revs.size()) - { - app.SetSelectedLine(line); - if (app.revs[line] != app.m_selectedrev) - { - app.m_selectedrev = app.revs[line]; - app.m_selectedorigrev = app.origrevs[line]; - app.m_selectedauthor = app.authors[line]; - app.m_selecteddate = app.dates[line]; - } - else - { - app.m_selectedauthor.clear(); - app.m_selecteddate.clear(); - app.m_selectedrev = -2; - app.m_selectedorigrev = -2; - } - ::InvalidateRect(app.wBlame, NULL, FALSE); - } - else - { - app.SetSelectedLine(-1); - } - } break; case WM_SETFOCUS: ::SetFocus(app.wBlame); @@ -2464,6 +2459,8 @@ void CTortoiseGitBlameView::UpdateInfo() while( pos>=0 ) { one=data.Tokenize(_T("\n"),pos); + if(one.IsEmpty()) + continue; m_CommitHash.push_back(one.Left(40)); int start=0; start=one.Find(_T(')'),40); @@ -2473,7 +2470,7 @@ void CTortoiseGitBlameView::UpdateInfo() this->m_TextView.InsertText(line,true); } int id=pRevs->m_HashMap[one.Left(40)]; - if(id>=0) + if(id>=0 && id size()) { m_ID.push_back(pRevs->size()-id); m_Authors.push_back(pRevs->at(id).m_AuthorName); @@ -2492,11 +2489,232 @@ void CTortoiseGitBlameView::UpdateInfo() SendEditor(SCI_SETSCROLLWIDTHTRACKING, TRUE); SendEditor(SCI_SETREADONLY, TRUE); + m_lowestrev=1; + m_highestrev=this->GetLogData()->size(); + + GetBlameWidth(); + CRect rect; + this->GetClientRect(rect); + //this->m_TextView.GetWindowRect(rect); + //this->m_TextView.ScreenToClient(rect); + rect.left=this->m_blamewidth; + this->m_TextView.MoveWindow(rect); this->Invalidate(); } +CGitBlameLogList * CTortoiseGitBlameView::GetLogList() +{ + return &(GetDocument()->GetMainFrame()->m_wndOutput.m_LogList); +} + + CLogDataVector * CTortoiseGitBlameView::GetLogData() { return &(GetDocument()->GetMainFrame()->m_wndOutput.m_LogList.m_logEntries); -} \ No newline at end of file +} + +void CTortoiseGitBlameView::OnSciPainted(NMHDR *,LRESULT *) +{ + this->Invalidate(); +} + +void CTortoiseGitBlameView::OnLButtonDown(UINT nFlags,CPoint point) +{ + + LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE); + LONG_PTR height = SendEditor(SCI_TEXTHEIGHT); + line = line + (point.y/height); + + if (line < (LONG)m_CommitHash.size()) + { + SetSelectedLine(line); + if (m_CommitHash[line] != m_SelectedHash) + { + m_SelectedHash = m_CommitHash[line]; +// app.m_selectedorigrev = app.origrevs[line]; +// app.m_selectedauthor = app.authors[line]; +// app.m_selecteddate = app.dates[line]; + + + this->GetLogList()->SetItemState(this->GetLogList()->GetItemCount()-m_ID[line], + LVIS_SELECTED, + LVIS_SELECTED); + + GitRev *pRev; + pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]); + this->GetDocument()->GetMainFrame()->m_wndProperties.UpdateProperties(pRev); + } + else + { + m_SelectedHash.Empty(); +// app.m_selecteddate.clear(); +// app.m_selectedrev = -2; +// app.m_selectedorigrev = -2; + } + //::InvalidateRect( NULL, FALSE); + this->Invalidate(); + this->m_TextView.Invalidate(); + + } + else + { + SetSelectedLine(-1); + } + + CView::OnLButtonDown(nFlags,point); +} + +void CTortoiseGitBlameView::OnSciGetBkColor(NMHDR* hdr, LRESULT* result) +{ + + SCNotification *notification=reinterpret_cast(hdr); + + if ((m_colorage)&&(notification->line < (int)m_CommitHash.size())) + { + if(m_CommitHash[notification->line] == this->m_SelectedHash ) + notification->lParam = m_selectedauthorcolor; + else + notification->lParam = InterColor(DWORD(m_regOldLinesColor), DWORD(m_regNewLinesColor), (m_ID[notification->line]-m_lowestrev)*100/((m_highestrev-m_lowestrev)+1)); + } + +} + +void CTortoiseGitBlameView::FocusOn(GitRev *pRev) +{ + m_SelectedHash = pRev->m_CommitHash; + + //GitRev *pRev; + //pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]); + this->GetDocument()->GetMainFrame()->m_wndProperties.UpdateProperties(pRev); + + this->Invalidate(); + this->m_TextView.Invalidate(); + +} + +void CTortoiseGitBlameView::OnMouseHover(UINT nFlags, CPoint point) +{ + + LONG_PTR line = SendEditor(SCI_GETFIRSTVISIBLELINE); + LONG_PTR height = SendEditor(SCI_TEXTHEIGHT); + line = line + (point.y/height); + + if (line < (LONG)m_CommitHash.size()) + { + if (line != m_MouseLine) + { + m_MouseLine = line;//m_CommitHash[line]; +// app.m_selectedorigrev = app.origrevs[line]; +// app.m_selectedauthor = app.authors[line]; +// app.m_selecteddate = app.dates[line]; + + + GitRev *pRev; + pRev=&this->GetLogData()->at(this->GetLogList()->GetItemCount()-m_ID[line]); + //this->GetDocument()->GetMainFrame()->m_wndProperties.UpdateProperties(pRev); + this->ClientToScreen(&point); + //BALLOON_INFO bi; + //if(m_ToolTip.GetTool(this, bi)) + //{ + // bi.sBalloonTip=pRev->m_CommitHash; + CString str; + str.Format(_T("%s\n%s\n%s\n%s"),pRev->m_CommitHash, + pRev->m_Subject, + pRev->m_AuthorDate.Format(_T("%Y-%m-%d %H:%M")), + pRev->m_Body); + m_ToolTip.AddTool(this,str); + m_ToolTip.DisplayToolTip(&point); + //} + + CRect rect; + this->ScreenToClient(&point); + rect.left=LOCATOR_WIDTH; + rect.right=this->m_blamewidth+rect.left; + rect.top=point.y-height; + rect.bottom=point.y+height; + this->InvalidateRect(rect); + + } + else + { + m_MouseLine=-1; +// app.m_selecteddate.clear(); +// app.m_selectedrev = -2; +// app.m_selectedorigrev = -2; + } + //::InvalidateRect( NULL, FALSE); + //this->Invalidate(); + } + +// const CString str=_T("this is a Message Balloon\n\nWarning! Warning!\nSomething unexpected happened"); + //CBalloon::ShowBalloon(NULL, point, + // str, + // FALSE, (HICON)IDI_EXCLAMATION, + // (UINT)CBalloon ::BALLOON_RIGHT_TOP, (UINT)CBalloon ::BALLOON_EFFECT_SOLID,(COLORREF)NULL, (COLORREF)NULL, (COLORREF)NULL); +} + +void CTortoiseGitBlameView::OnMouseMove(UINT nFlags, CPoint point) +{ + TRACKMOUSEEVENT tme; + tme.cbSize=sizeof(TRACKMOUSEEVENT); + tme.dwFlags=TME_HOVER|TME_LEAVE; + tme.hwndTrack=this->m_hWnd; + tme.dwHoverTime=1; + TrackMouseEvent(&tme); +} + + +BOOL CTortoiseGitBlameView::PreTranslateMessage(MSG* pMsg) +{ + m_ToolTip.RelayEvent(pMsg); + return CView::PreTranslateMessage(pMsg); +} + +void CTortoiseGitBlameView::OnEditFind() +{ + m_pFindDialog=new CFindReplaceDialog(); + + m_pFindDialog->Create(TRUE,_T(""),NULL,FR_DOWN,this); +} + +void CTortoiseGitBlameView::OnEditGoto() +{ + CEditGotoDlg dlg; + if(dlg.DoModal()==IDOK) + { + this->GotoLine(dlg.m_LineNumber); + } +} + +LRESULT CTortoiseGitBlameView::OnFindDialogMessage(WPARAM wParam, LPARAM lParam)//Õâ¸öÒ²ÊÇÕÒÄǸö³ÌÐò¸ÄµÄ£¬Ö»²»¹ý»»³ÉÁË×Ô¼ºµÄÀà +{ + ASSERT(m_pFindDialog != NULL); + + // If the FR_DIALOGTERM flag is set, + // invalidate the handle identifying the dialog box. + if (m_pFindDialog->IsTerminating()) + { + m_pFindDialog = NULL; + return 0; + } + + // If the FR_FINDNEXT flag is set, + // call the application-defined search routine + // to search for the requested string. + if(m_pFindDialog->FindNext()) + { + //read data from dialog + CString FindName = m_pFindDialog->GetFindString(); + bool bMatchCase = m_pFindDialog->MatchCase() == TRUE; + bool bMatchWholeWord = m_pFindDialog->MatchWholeWord() == TRUE; + bool bSearchDown = m_pFindDialog->SearchDown() == TRUE; + + DoSearch(FindName,m_pFindDialog->m_fr.Flags); + //with given name do search + // *FindWhatYouNeed(FindName, bMatchCase, bMatchWholeWord, bSearchDown); + } + + return 0; +} +