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

📄 editdlg.cpp

📁 人工智能中的A*算法解决8number问题
💻 CPP
字号:
// EditDlg.cpp : implementation file
//

#include "stdafx.h"
#include "EightNumber.h"
#include "EditDlg.h"
#include "Label.h"
#include "CreditStatic.h"

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


char *pArrCredit = { 
	"|八数码游戏 1.0\t||Copyright (c) 2003|"
        "山东师范大学信息管理学院|"
        "BITMAPBADGE^||"    // this is a quoted bitmap resource 
        "游戏设计者\r||20032679 李少辉||"
        "BITMAPCITY^||"    // this is a quoted bitmap resource 
        "八数码游戏源代码类\r||class CEightNumberView ||"
        "游戏说明类\r||class CExplainGame||"
        "Label控件中信息滚动类\r||class CLabel||"
        "电子邮件与网页自动连接类\r||class CCreditStatic||"
        "仿XP界面BUTTON类\r||class CXPButton||"
        "* * * * * * * * *\t|||"
        "界面设计\r||李少辉||"
        "源文件支持\r||李少辉     邱成功||"
        "应用程序生成\r||李少辉|||"
        "感谢邱成功、张英俐先生给予的大力支持\t|||||||||||||||"
        };

/////////////////////////////////////////////////////////////////////////////
// CEditDlg dialog
#define  DISPLAY_TIMER_ID		151

CEditDlg::CEditDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CEditDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CEditDlg)
	//}}AFX_DATA_INIT
	CBitmap bmp;
	srand(GetTickCount());

	m_BkBrush = CreatePatternBrush ((HBITMAP)bmp.GetSafeHandle()) ;
	bmp.DeleteObject();

	bitmapIDs[0] = IDB_BITMA2;
	bitmapIDs[1] = IDB_BITMA4;
}


void CEditDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CEditDlg)
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CEditDlg, CDialog)
	//{{AFX_MSG_MAP(CEditDlg)
	ON_BN_CLICKED(IDC_BUTTON_TOK, OnButtonTok)
	ON_WM_DESTROY()
	ON_WM_CTLCOLOR()
	ON_WM_TIMER()
	ON_WM_CANCELMODE()
	ON_WM_CAPTURECHANGED()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CEditDlg message handlers

void CEditDlg::OnButtonTok() 
{
	// TODO: Add your control notification handler code here
	exit(0);
}

void CEditDlg::OnDestroy() 
{
	CDialog::OnDestroy();
	
	// TODO: Add your message handler code here
	if(TimerOn)
		ASSERT(KillTimer(DISPLAY_TIMER_ID));
}

HBRUSH CEditDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
	
	// TODO: Change any attributes of the DC here
	if ( (nCtlColor==CTLCOLOR_DLG) || (nCtlColor==CTLCOLOR_STATIC) )
	{
		pDC->SetBkMode (TRANSPARENT);
		if( nCtlColor==CTLCOLOR_STATIC )
			pDC->SetTextColor(RGB(0,0,255));
		hbr = m_BkBrush;
	}
	// TODO: Return a different brush if the default is not desired
	return hbr;
}

void CEditDlg::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if (nIDEvent != DISPLAY_TIMER_ID)
	{
		CDialog::OnTimer(nIDEvent);
		return;
	}

	static int index = 0;

	index = ++index % 2;
	
	m_credit.SetBkImage(bitmapIDs[index]);

	CDialog::OnTimer(nIDEvent);
}

void CEditDlg::OnCancelMode() 
{
	CDialog::OnCancelMode();
	
	// TODO: Add your message handler code here
	
}

BOOL CEditDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_neuhomepage.SubclassDlgItem(IDC_STATIC_PAGE,this);
	m_myemail.SubclassDlgItem(IDC_STATIC_EMAIL,this);

	m_neuhomepage.SetLink(TRUE)
				 .SetTextColor(RGB(0,0,255))
		         .SetFontUnderline(TRUE)
				 .SetLinkCursor(AfxGetApp()->LoadCursor(IDC_HAND));
	m_myemail.SetLink(TRUE)
		     .SetTextColor(RGB(0,0,255))
		     .SetFontUnderline(TRUE)
		     .SetLinkCursor(AfxGetApp()->LoadCursor(IDC_HAND));
	         
	m_credit.SubclassDlgItem(IDC_STATIC_DISPLAY,this);
	m_credit.SetCredits(pArrCredit,'|');
	m_credit.SetSpeed(DISPLAY_FAST);
	m_credit.SetColor(BACKGROUND_COLOR, RGB(0,0,255));
	m_credit.SetTransparent();
	m_credit.SetBkImage(bitmapIDs[0]);
	m_credit.StartScrolling();
	TimerOn = SetTimer(DISPLAY_TIMER_ID,5000,NULL);
    ASSERT(TimerOn != 0);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CEditDlg::OnCaptureChanged(CWnd *pWnd) 
{
	// TODO: Add your message handler code here
	
	CDialog::OnCaptureChanged(pWnd);
}

⌨️ 快捷键说明

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