dlgpageone.cpp

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

CPP
113
字号
// DlgPageOne.cpp : implementation file
//

#include "stdafx.h"
#include "CQuakeDemo.h"
#include "DlgPageOne.h"

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

#include "QuakeView.h"

/////////////////////////////////////////////////////////////////////////////
// CDlgPageOne dialog


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


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


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

/////////////////////////////////////////////////////////////////////////////
// CDlgPageOne message handlers

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

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

void CDlgPageOne::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->GetBufferAt(i,TempDisp);
		
		str.Format(_T(" %d-F"),nFloor-i);
		m_List.SetItemText(i,0,str);
		str.Format(_T("%f"),TempDisp.Disp);
		m_List.SetItemText(i,1,str);
	}
	//
	m_List.SetRedraw(TRUE);
}

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

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

⌨️ 快捷键说明

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