⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 logmanager.cpp

📁 短信群发系统
💻 CPP
字号:
// LogManager.cpp : implementation file
//

#include "stdafx.h"
#include "notesendsystem.h"
#include "LogManager.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CLogManager dialog


CLogManager::CLogManager(CWnd* pParent /*=NULL*/)
	: CDialog(CLogManager::IDD, pParent)
{
	//{{AFX_DATA_INIT(CLogManager)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
}


void CLogManager::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CLogManager)
//	DDX_Control(pDX, IDC_LOG_LIST, m_list);
	DDX_Control(pDX, IDC_TAB, m_tab);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CLogManager, CDialog)
	//{{AFX_MSG_MAP(CLogManager)
	ON_WM_CLOSE()
	ON_NOTIFY(TCN_SELCHANGE, IDC_TAB, OnSelchangeTab)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CLogManager message handlers

void CLogManager::OnOK() 
{
	// TODO: Add extra validation here
	
	//CDialog::OnOK();
}

void CLogManager::OnCancel() 
{
	// TODO: Add extra cleanup here
	

}

void CLogManager::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	delete sendlog;
	delete receivelog;
	CDialog::OnCancel();
	CDialog::OnClose();
}

BOOL CLogManager::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	sendlog		= new CPageSendLog;
	receivelog	= new CPageReceiveLog;

	if (!sendlog->m_hWnd || !receivelog->m_hWnd)
	{
		m_tab.InsertItem(0, "发送日志查询");
		m_tab.InsertItem(1, "接收日志查询");

		sendlog->Create(IDP_SEND_LOG, &m_tab);
		receivelog->Create(IDP_RECEIVE_LOG, &m_tab);	
		
		//设置页面的位置在m_tab控件范围内 
		
		CRect rs; 		
		m_tab.GetClientRect(rs); 	
		rs.top+=20; 	
		rs.bottom-=4; 	
		rs.left+=4; 	
		rs.right-=4; 
		
		sendlog->MoveWindow(rs); 	
		receivelog->MoveWindow(rs); 
		
		sendlog->ShowWindow(TRUE);
		
		m_tab.SetCurSel(0);
	}
// 
// 	//初始化列表控件
// 	m_list.ModifyStyle(0, LVS_REPORT);	
// 	CString		str[5] = {"日志ID", "订单ID", "对方号码", "发送时间", "状态"};
// 	int i;
// 	for (i = 0; i < 5; i++)
// 	{
// 		m_list.InsertColumn(i, str[i], LVCFMT_LEFT, 100);
// 	}	
// 	m_list.SetExtendedStyle(m_list.GetExtendedStyle() | LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);	

	return TRUE;  
}

void CLogManager::OnSelchangeTab(NMHDR* pNMHDR, LRESULT* pResult) 
{
	int CulSel	= m_tab.GetCurSel();
	switch(CulSel)
	{
	case 0:
		sendlog->ShowWindow(TRUE);
		receivelog->ShowWindow(FALSE);
		break;
	case 1:
		sendlog->ShowWindow(FALSE);
		receivelog->ShowWindow(TRUE);
		break;
	default:
	    break;
	}
	*pResult = 0;
}

void CLogManager::UpdateListView()
{
// 	if (m_list.m_hWnd)
// 	{
// 		m_list.DeleteAllItems();
// 	}
// 	CString			str;
// 	CNoteSendSystemApp *pApp =(CNoteSendSystemApp *)AfxGetApp();
// 	int len = pApp->SendListVect.size();
// 	
// 	for (int i=0; i<len; i++)
// 	{
// 		str.Format("%d", pApp->SendListVect[i].send_id);
// 		m_list.InsertItem(i, str);
// 		str.Empty();
		
		
// 		str = pApp->OrderListVect[i].SendListVect.Format("%Y-%m-%d");
// 		m_list.SetItemText(i, 1, str);
// 		str.Empty();
// 		//结束日期
// 		str = pApp->OrderListVect[i].SendListVect.Format("%Y-%m-%d");
// 		m_list.SetItemText(i, 2, str);
// 		str.Empty();
// 		//开始时间
// 		str = pApp->OrderListVect[i].SendListVect.Format("%H:%M:%S");
// 		m_list.SetItemText(i, 3, str);
// 		str.Empty();
// 		//结束时间
// 		str = pApp->OrderListVect[i].SendListVect.Format("%H:%M:%S");
// 		m_list.SetItemText(i, 4, str);
// 		str.Empty();
// 		//内容
// 		str.Format("%s", pApp->SendListVect[i].content);
// 		m_list.SetItemText(i, 5, str);
// 		str.Empty();
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -