| 1 |
// FindBarListCtrl.cpp : implementation file |
|---|
| 2 |
// |
|---|
| 3 |
|
|---|
| 4 |
#include "stdafx.h" |
|---|
| 5 |
#include "Elephant.h" |
|---|
| 6 |
#include "FindBarListCtrl.h" |
|---|
| 7 |
|
|---|
| 8 |
#ifdef _DEBUG |
|---|
| 9 |
#define new DEBUG_NEW |
|---|
| 10 |
#undef THIS_FILE |
|---|
| 11 |
static char THIS_FILE[] = __FILE__; |
|---|
| 12 |
#endif |
|---|
| 13 |
|
|---|
| 14 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 15 |
// CFindBarListCtrl |
|---|
| 16 |
|
|---|
| 17 |
CFindBarListCtrl::CFindBarListCtrl() |
|---|
| 18 |
{ |
|---|
| 19 |
} |
|---|
| 20 |
|
|---|
| 21 |
CFindBarListCtrl::~CFindBarListCtrl() |
|---|
| 22 |
{ |
|---|
| 23 |
} |
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
BEGIN_MESSAGE_MAP(CFindBarListCtrl, CListCtrl) |
|---|
| 27 |
//{{AFX_MSG_MAP(CFindBarListCtrl) |
|---|
| 28 |
ON_WM_LBUTTONDBLCLK() |
|---|
| 29 |
ON_WM_RBUTTONDOWN() |
|---|
| 30 |
//}}AFX_MSG_MAP |
|---|
| 31 |
END_MESSAGE_MAP() |
|---|
| 32 |
|
|---|
| 33 |
///////////////////////////////////////////////////////////////////////////// |
|---|
| 34 |
// CFindBarListCtrl message handlers |
|---|
| 35 |
|
|---|
| 36 |
void CFindBarListCtrl::OnLButtonDblClk(UINT nFlags, CPoint point) |
|---|
| 37 |
{ |
|---|
| 38 |
vector<string> files; |
|---|
| 39 |
vector<string> lineNumbers; |
|---|
| 40 |
GetSelListCtrlItems(this,&files,3 ); |
|---|
| 41 |
GetSelListCtrlItems(this,&lineNumbers,0 ); |
|---|
| 42 |
|
|---|
| 43 |
if ( files.size() ) |
|---|
| 44 |
{ |
|---|
| 45 |
CMainFrame* m = ( CMainFrame* ) Globals::theApp.m_pMainWnd; |
|---|
| 46 |
m->GotoFileAndLineNumber(files[0],atoi(lineNumbers[0].c_str())); |
|---|
| 47 |
|
|---|
| 48 |
} |
|---|
| 49 |
|
|---|
| 50 |
this->SetFocus(); |
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
CListCtrl::OnLButtonDblClk(nFlags, point); |
|---|
| 54 |
} |
|---|
| 55 |
|
|---|
| 56 |
void CFindBarListCtrl::OnRButtonDown(UINT nFlags, CPoint point) |
|---|
| 57 |
{ |
|---|
| 58 |
LoadAndShowMenu(IDR_FILELISTCTRL,point,this); |
|---|
| 59 |
CListCtrl::OnRButtonDown(nFlags, point); |
|---|
| 60 |
} |
|---|