root/trunk/LogDlg.cpp

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

Initial ( and last :( ) commit

Line 
1 // LogDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "LogDlg.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 // CLogDlg dialog
16
17
18 CLogDlg::CLogDlg(CWnd* pParent /*=NULL*/)
19     : CDialog(CLogDlg::IDD, pParent)
20 {
21     //{{AFX_DATA_INIT(CLogDlg)
22         // NOTE: the ClassWizard will add member initialization here
23     //}}AFX_DATA_INIT
24 }
25
26
27 void CLogDlg::DoDataExchange(CDataExchange* pDX)
28 {
29     CDialog::DoDataExchange(pDX);
30     //{{AFX_DATA_MAP(CLogDlg)
31     DDX_Control(pDX, IDC_LIST1, m_log);
32     //}}AFX_DATA_MAP
33 }
34
35
36 BEGIN_MESSAGE_MAP(CLogDlg, CDialog)
37     //{{AFX_MSG_MAP(CLogDlg)
38     ON_WM_SIZE()
39     ON_WM_RBUTTONUP()
40     ON_NOTIFY(NM_RCLICK, IDC_LIST1, OnRclickList1)
41     ON_WM_KEYUP()
42     ON_NOTIFY(LVN_KEYDOWN, IDC_LIST1, OnKeydownList1)
43     //}}AFX_MSG_MAP
44 END_MESSAGE_MAP()
45
46 /////////////////////////////////////////////////////////////////////////////
47 // CLogDlg message handlers
48
49 BOOL CLogDlg::OnInitDialog()
50 {
51     CDialog::OnInitDialog();
52    
53     m_log.InsertColumn(0,"Log",LVCFMT_LEFT,200);
54    
55     return TRUE;  // return TRUE unless you set the focus to a control
56                   // EXCEPTION: OCX Property Pages should return FALSE
57 }
58
59 void CLogDlg::OnSize(UINT nType, int cx, int cy)
60 {
61     CDialog::OnSize(nType, cx, cy);
62    
63     m_log.SetColumnWidth(0,cx);
64
65     //m_fileCombo.MoveWindow(0,0,cx,cy);   
66     m_log.MoveWindow(0,0,cx ,cy   );            // TODO: Add your message handler code here
67        
68 }
69
70
71
72 void CLogDlg::OnRButtonUp(UINT nFlags, CPoint point)
73 {
74     LoadAndShowMenu(IDR_LOG_MENU,point,this);       
75     CDialog::OnRButtonUp(nFlags, point);
76 }
77
78 void CLogDlg::OnRclickList1(NMHDR* pNMHDR, LRESULT* pResult)
79 {
80
81     // TODO: Add your control notification handler code here
82    
83     *pResult = 0;
84 }
85
86 BOOL CLogDlg::PreTranslateMessage(MSG* pMsg)
87 {
88    
89    
90    
91     return Globals::theApp.m_pMainWnd->PreTranslateMessage(pMsg);
92 }
93
94 void CLogDlg::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)
95 {
96     if (nChar == VK_RETURN )
97     {
98
99         // repeat step ...
100
101
102
103     }
104     else    if ( nChar == VK_ESCAPE )
105     {
106
107         AfxMessageBox("HERE");
108         CMainFrame* m = (CMainFrame*)Globals::theApp.m_pMainWnd;
109         if ( m ){
110        
111         CElephantView* v = m->GetActiveView();
112         if ( v )
113         {
114             CScintillaCtrl& rCtrl = v->GetCtrl();
115             rCtrl.SetFocus();
116         }
117
118         return;
119         }
120        
121
122
123     }
124    
125     CDialog::OnKeyUp(nChar, nRepCnt, nFlags);
126 }
127
128 void CLogDlg::OnKeydownList1(NMHDR* pNMHDR, LRESULT* pResult)
129 {
130     LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
131     if ( pNMHDR->code == VK_ESCAPE )
132     {
133
134         CMainFrame* m = (CMainFrame*)Globals::theApp.m_pMainWnd;
135         if ( m ){
136        
137         CElephantView* v = m->GetActiveView();
138         if ( v )
139         {
140             CScintillaCtrl& rCtrl = v->GetCtrl();
141             rCtrl.SetFocus();
142         }
143
144         return;
145         }
146        
147
148
149     }
150    
151     *pResult = 0;
152 }
Note: See TracBrowser for help on using the browser.