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

📄 messageviewerdialog.cpp

📁 本代码为使用vc平台开发stk软件x插件的一个范例。
💻 CPP
字号:
/******************************************************************************/
/*****       Copyright 2004-2004, Analytical Graphics, Incorporated.      *****/
/******************************************************************************/
// MessageViewerDialog.cpp : implementation file
//

#include "stdafx.h"
#include "cppmdi.h"
#include "MessageViewerDialog.h"
#include "agpickinfodata.h"


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

/////////////////////////////////////////////////////////////////////////////
// CMessageViewerDialog dialog


CMessageViewerDialog::CMessageViewerDialog(CWnd* pParent /*=NULL*/)
	: CDialog(CMessageViewerDialog::IDD, pParent)
{
	//{{AFX_DATA_INIT(CMessageViewerDialog)
	//}}AFX_DATA_INIT
}


void CMessageViewerDialog::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CMessageViewerDialog)
	DDX_Control(pDX, IDC_MESSAGE_TEXT, m_MessageText);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CMessageViewerDialog, CDialog)
	//{{AFX_MSG_MAP(CMessageViewerDialog)
	ON_WM_SIZE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()


/////////////////////////////////////////////////////////////////////////////
// CMessageViewerDialog Public Methods

void CMessageViewerDialog::AddMessage(/*const*/ CAgPickInfoData& pickInfoData)
{
	CString			msg;

	msg.Format("Selected Object: %s, Lat: %f, Lon: %f, Alt:%f",
					(pickInfoData.GetObjPath() != "") ? pickInfoData.GetObjPath() : "none",
					pickInfoData.GetLat(),
					pickInfoData.GetLon(),
					pickInfoData.GetAlt());

	AddMessage(msg);
}

void CMessageViewerDialog::AddMessage(const CString& msg)
{
	m_MessageText.SetSel(-1, -1);
	m_MessageText.ReplaceSel(msg + "\n");

	UpdateData(FALSE);
}

// OnSize
//  make the rich edit control take up the entire dialog
void CMessageViewerDialog::OnSize(UINT nType, int cx, int cy) 
{
	CDialog::OnSize(nType, cx, cy);
	
	if (nType != SIZE_MINIMIZED && m_MessageText)
	{
		RECT rectMsgView;
		GetClientRect(&rectMsgView);

		m_MessageText.MoveWindow(&rectMsgView);
	}
}

/******************************************************************************/
/*****       Copyright 2004-2004, Analytical Graphics, Incorporated.      *****/
/******************************************************************************/


⌨️ 快捷键说明

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