a
This commit is contained in:
@@ -0,0 +1,162 @@
|
||||
// appdataprolistview.cpp : implementation file
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "geomative.h"
|
||||
#include "appdataprolistview.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#undef THIS_FILE
|
||||
static char THIS_FILE[] = __FILE__;
|
||||
#endif
|
||||
|
||||
extern int g_iCurrListColIndex;
|
||||
extern int g_iCurrListColOrder;
|
||||
extern int CALLBACK ListStrCompare(LPARAM lParam1, LPARAM lParam2, LPARAM lSortObject);
|
||||
extern int g_UIOffset;
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAppDataProListView
|
||||
|
||||
IMPLEMENT_DYNCREATE(CAppDataProListView, CListView)
|
||||
|
||||
CAppDataProListView::CAppDataProListView()
|
||||
{
|
||||
m_pMngFrm = NULL;
|
||||
}
|
||||
|
||||
CAppDataProListView::~CAppDataProListView()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
BEGIN_MESSAGE_MAP(CAppDataProListView, CListView)
|
||||
//{{AFX_MSG_MAP(CAppDataProListView)
|
||||
ON_NOTIFY_REFLECT(LVN_COLUMNCLICK, OnColumnclick)
|
||||
ON_NOTIFY_REFLECT(NM_DBLCLK, OnDblclk)
|
||||
//}}AFX_MSG_MAP
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAppDataProListView drawing
|
||||
|
||||
void CAppDataProListView::OnDraw(CDC* pDC)
|
||||
{
|
||||
CDocument* pDoc = GetDocument();
|
||||
// TODO: add draw code here
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAppDataProListView diagnostics
|
||||
|
||||
#ifdef _DEBUG
|
||||
void CAppDataProListView::AssertValid() const
|
||||
{
|
||||
CListView::AssertValid();
|
||||
}
|
||||
|
||||
void CAppDataProListView::Dump(CDumpContext& dc) const
|
||||
{
|
||||
CListView::Dump(dc);
|
||||
}
|
||||
#endif //_DEBUG
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// CAppDataProListView message handlers
|
||||
|
||||
void CAppDataProListView::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
|
||||
// TODO: Add your control notification handler code here
|
||||
g_iCurrListColIndex = pNMListView->iSubItem;
|
||||
g_iCurrListColOrder = !g_iCurrListColOrder;
|
||||
GetListCtrl().SortItems(ListStrCompare, (LPARAM)&GetListCtrl());
|
||||
*pResult = 0;
|
||||
}
|
||||
|
||||
void CAppDataProListView::OnInitialUpdate()
|
||||
{
|
||||
CListView::OnInitialUpdate();
|
||||
|
||||
// TODO: Add your specialized code here and/or call the base class
|
||||
CString szColTitle;
|
||||
|
||||
GetListCtrl().SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP
|
||||
| LVS_EX_ONECLICKACTIVATE | LVS_EX_GRIDLINES);
|
||||
|
||||
m_pMngFrm = (CMDIChildWnd*)GetParentFrame();
|
||||
|
||||
g_iCurrListColIndex = (int)VAL_ZERO;
|
||||
g_iCurrListColOrder = (int)VAL_ZERO;
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_CN+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(0, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_PRNAME+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(1, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_DESC+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(2, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_LOCATION+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(3, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_PRDATE+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(4, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_DURATION+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(5, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_PS+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(6, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_CS+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(7, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_PM+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(8, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_QAS+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(9, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
szColTitle.Empty();
|
||||
szColTitle.LoadString(IDS_DB_PROJECT_STANDARD+g_UIOffset);
|
||||
GetListCtrl().InsertColumn(10, szColTitle, LVCFMT_LEFT, 100);
|
||||
|
||||
}
|
||||
|
||||
BOOL CAppDataProListView::PreCreateWindow(CREATESTRUCT& cs)
|
||||
{
|
||||
// TODO: Add your specialized code here and/or call the base class
|
||||
cs.style &= ~LVS_TYPEMASK;
|
||||
cs.style |= LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS;
|
||||
return CListView::PreCreateWindow(cs);
|
||||
}
|
||||
|
||||
void CAppDataProListView::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
|
||||
{
|
||||
// TODO: Add your control notification handler code here
|
||||
int iItemIndex = (int)VAL_ZERO;
|
||||
POSITION posItem;
|
||||
DWORD dwItemHandle = (DWORD)VAL_ZERO;
|
||||
|
||||
posItem = GetListCtrl().GetFirstSelectedItemPosition();
|
||||
iItemIndex = GetListCtrl().GetNextSelectedItem(posItem);
|
||||
|
||||
if ((int)VAL_MINUS_ONE != iItemIndex)
|
||||
{
|
||||
dwItemHandle = GetListCtrl().GetItemData(iItemIndex);
|
||||
::SendMessage(m_pMngFrm->m_hWnd, WM_SKIP, (WPARAM )dwItemHandle, (LPARAM)VAL_ZERO);
|
||||
}
|
||||
*pResult = 0;
|
||||
}
|
||||
Reference in New Issue
Block a user