dlgpagetwo.cpp

来自「本程序源码是为日本一家地震监测机构编写的」· C++ 代码 · 共 111 行

CPP
111
字号
// DlgPageTwo.cpp : implementation file
//

#include "stdafx.h"
#include "CQuakeDemo.h"
#include "DlgPageTwo.h"

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

#include "QuakeView.h"

/////////////////////////////////////////////////////////////////////////////
// CDlgPageTwo dialog


CDlgPageTwo::CDlgPageTwo(CWnd* pParent /*=NULL*/)
	: CResizableDialog(CDlgPageTwo::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgPageTwo)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_pInterface = NULL;
}


void CDlgPageTwo::DoDataExchange(CDataExchange* pDX)
{
	CResizableDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgPageTwo)
	DDX_Control(pDX, IDC_LIST_VIEW_PAGETWO, m_List);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgPageTwo, CResizableDialog)
	//{{AFX_MSG_MAP(CDlgPageTwo)
	ON_WM_SHOWWINDOW()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgPageTwo message handlers

BOOL CDlgPageTwo::OnInitDialog() 
{
	CResizableDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	AddAnchor(IDC_LIST_VIEW_PAGETWO,TOP_LEFT,BOTTOM_RIGHT);
	m_List.ModifyStyle(NULL,LVS_SHOWSELALWAYS);
	m_List.SetExtendedStyle(LVS_EX_FULLROWSELECT);
	
	CString str1,str2;
	str1.LoadString(IDS_STRING_PAGETWO_1);
	str2.LoadString(IDS_STRING_PAGETWO_2);
	m_List.InsertColumn(1,str1,LVCFMT_LEFT,60);
	m_List.InsertColumn(2,str2,LVCFMT_LEFT,115);	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgPageTwo::Update()
{
	if(IsWindowVisible())
		Show();
}

void CDlgPageTwo::Show()
{
	if(m_pInterface == NULL)return;
	CQuakeView* pView = m_pInterface->m_pView;
	if(pView == NULL)return;
	int nFloor = pView->GetFloorSize();
	m_List.SetRedraw(FALSE);
	//
	static DispStruct TempDisp;
	CString str;
	for(int i = 0; i < nFloor; i++)
	{
		pView->GetMaxDisp(i,TempDisp);
		
		str.Format(_T(" %d-F"),nFloor-i);
		m_List.SetItemText(i,0,str);
		str.Format(_T("%f[%d]"),TempDisp.Disp,TempDisp.Time);
		m_List.SetItemText(i,1,str);
	}
	//
	m_List.SetRedraw(TRUE);
}

void CDlgPageTwo::Init()
{
	CQuakeView* pView = m_pInterface->m_pView;
	m_List.DeleteAllItems();
	for(int i = 0; i < pView->GetFloorSize(); i++)
	{
		m_List.InsertItem(i,_T(""));
	}
}

void CDlgPageTwo::OnShowWindow(BOOL bShow, UINT nStatus) 
{
	CResizableDialog::OnShowWindow(bShow, nStatus);
	if(bShow)
		Show();
}

⌨️ 快捷键说明

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