root/trunk/FindOutputBarDlg.cpp

Revision 5, 2.3 kB (checked in by qbert, 6 years ago)

Initial ( and last :( ) commit

Line 
1 // FindOutputBarDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "FindOutputBarDlg.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 // CFindOutputBarDlg dialog
16
17
18 CFindOutputBarDlg::CFindOutputBarDlg(CWnd* pParent /*=NULL*/)
19     : CDialog(CFindOutputBarDlg::IDD, pParent)
20 {
21     //{{AFX_DATA_INIT(CFindOutputBarDlg)
22         // NOTE: the ClassWizard will add member initialization here
23     //}}AFX_DATA_INIT
24 }
25
26
27 void CFindOutputBarDlg::DoDataExchange(CDataExchange* pDX)
28 {
29     CDialog::DoDataExchange(pDX);
30     //{{AFX_DATA_MAP(CFindOutputBarDlg)
31     DDX_Control(pDX, IDC_LIST1, m_findList);
32     //}}AFX_DATA_MAP
33 }
34
35
36 BEGIN_MESSAGE_MAP(CFindOutputBarDlg, CDialog)
37     //{{AFX_MSG_MAP(CFindOutputBarDlg)
38     ON_WM_SIZE()
39     ON_WM_KEYUP()
40     //}}AFX_MSG_MAP
41 END_MESSAGE_MAP()
42
43 /////////////////////////////////////////////////////////////////////////////
44 // CFindOutputBarDlg message handlers
45  
46 void CFindOutputBarDlg::OnSize(UINT nType, int cx, int cy)
47 {
48     CDialog::OnSize(nType, cx, cy);
49     m_findList.SetColumnWidth(3,cx-560);
50     m_findList.MoveWindow(0,0,cx,cy);       
51 }
52
53 BOOL CFindOutputBarDlg::OnInitDialog()
54 {
55     CDialog::OnInitDialog();
56    
57    
58     m_findList.InsertColumn(0,"Line no.",LVCFMT_LEFT,60);
59     m_findList.InsertColumn(1,"File",LVCFMT_LEFT,100);
60     m_findList.InsertColumn(2,"Line",LVCFMT_LEFT,400);
61     m_findList.InsertColumn(3,"Path",LVCFMT_LEFT,250);
62
63     m_findList.SetExtendedStyle(LVS_EX_FULLROWSELECT  | LVS_EX_GRIDLINES);
64
65    
66     return TRUE;  // return TRUE unless you set the focus to a control
67                   // EXCEPTION: OCX Property Pages should return FALSE
68 }
69
70 BOOL CFindOutputBarDlg::PreTranslateMessage(MSG* pMsg)
71 {
72     // TODO: Add your specialized code here and/or call the base class
73    
74     return Globals::theApp.m_pMainWnd->PreTranslateMessage(pMsg);
75 }
76
77
78
79
80 void CFindOutputBarDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
81 {
82 if ( nChar == VK_ESCAPE )
83     {
84
85         CMainFrame* m = (CMainFrame*)Globals::theApp.m_pMainWnd;
86         if ( m ){
87        
88         CElephantView* v = m->GetActiveView();
89         if ( v )
90         {
91             CScintillaCtrl& rCtrl = v->GetCtrl();
92             rCtrl.SetFocus();
93         }
94
95         return;
96         }
97        
98
99
100     }   
101     CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
102 }
Note: See TracBrowser for help on using the browser.