-
Notifications
You must be signed in to change notification settings - Fork 0
/
AnalyzePane.cpp
103 lines (78 loc) · 2.21 KB
/
AnalyzePane.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// AnalyzePane.cpp : implementation file
//
#include "stdafx.h"
#include "VisualText.h"
#include "AnalyzePane.h"
#include "Utils.h"
// CAnalyzePane
IMPLEMENT_DYNCREATE(CAnalyzePane, CWnd)
CAnalyzePane::CAnalyzePane()
{
}
CAnalyzePane::~CAnalyzePane()
{
}
BEGIN_MESSAGE_MAP(CAnalyzePane, CWnd)
//{{AFX_MSG_MAP(CAnalyzePane)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
ON_WM_SETFOCUS()
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAnalyzePane message handlers
static int arColWidths[] = {
200,
600
};
static CString arColLabels[] = {
_T("Operation"),
_T("Description"),
};
int CAnalyzePane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (m_listCtrl.GetSafeHwnd() == 0)
{
// Define the default style for the output list controls.
//DWORD dwStyle = LVS_REPORT | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS |
// WS_CHILD | WS_VSCROLL | WS_TABSTOP | WS_VISIBLE | LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES;
DWORD dwStyle = LVS_REPORT | LVS_NOSORTHEADER | LVS_SHOWSELALWAYS |
WS_CHILD | WS_VSCROLL | WS_TABSTOP|WS_VISIBLE;
// Create the list control.
if (!m_listCtrl.Create( dwStyle, CRect(0,0,0,0), this, 0xff ))
{
TRACE0( "Failed to create list control.\n" );
return FALSE;
}
// Insert the columns.
m_listCtrl.BuildColumns(_countof(arColWidths), arColWidths, arColLabels);
// Subclass the flat header control.
m_listCtrl.SubclassHeader();
// lock the first two colums from sizing operations.
CXTPHeaderCtrl* pHeaderCtrl = m_listCtrl.XTPGetHeaderCtrl( );
if ( pHeaderCtrl != NULL )
{
//pHeaderCtrl->FreezeColumn(0);
// enable autosizing for columns.
pHeaderCtrl->EnableAutoSize();
}
ListView_SetExtendedListViewStyle(
m_listCtrl.m_hWnd, LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT);
m_listCtrl.SetMenuID(IDR_ANALYZE_LOG);
}
return 0;
}
void CAnalyzePane::OnSize(UINT nType, int cx, int cy)
{
CWnd::OnSize(nType, cx, cy);
if (m_listCtrl.GetSafeHwnd())
{
m_listCtrl.MoveWindow(0, 0, cx, cy);
}
}
void CAnalyzePane::OnSetFocus(CWnd* /*pOldWnd*/)
{
m_listCtrl.SetFocus();
}