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

📄 informdlg.cpp

📁 这是我自己写的从数据库中读出数据
💻 CPP
字号:
// InformDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Mine.h"
#include "InformDlg.h"

#include "ReadData.h"
#include "math.h"
#include "DB.h"

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


extern CNode *g_pNodeHead;
extern CEdge *g_pEdgeHead;
extern CPolygon *g_pPolygonHead;
/////////////////////////////////////////////////////////////////////////////
// CInformDlg dialog


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


void CInformDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CInformDlg)
	DDX_Control(pDX, IDC_RSTATIC, m_rect);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CInformDlg, CDialog)
	//{{AFX_MSG_MAP(CInformDlg)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CInformDlg message handlers

void CInformDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
    _DrawPic();	

	if (IsIconic())
	{
		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
		
		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;
		
		// Draw the icon
		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDC *pDC = m_rect.GetDC();	
		CNode *node1,*node2;
		node1=g_pNodeHead->next;
		node2=node1->next;
		while ((node1->m_CDNode)&&(node2->m_CDNode))
		{
			pDC->Ellipse((int)node1->x-2,(int)node1->z-2,(int)node1->x+2,(int)node1->z+2);
			pDC->Ellipse((int)node2->x-2,(int)node2->z-2,(int)node2->x+2,(int)node2->z+2);
			pDC->MoveTo((int)node1->x,(int)node1->z);
	 	    pDC->LineTo((int)node2->x,(int)node2->z);
			
			node1=node2;
			node2=node2->next;
		}
	 	
        m_rect.ReleaseDC(pDC);
		CDialog::OnPaint();
	}
	// Do not call CDialog::OnPaint() for painting messages
}

void CInformDlg::_DrawPic()
{
	CRect rect=_GetRect();	

}

CRect CInformDlg::_GetRect()
{

	CRect rect;
	m_rect.GetWindowRect(rect);
	ScreenToClient(rect);
	return rect;
}

⌨️ 快捷键说明

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