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

📄 zuotu.cpp

📁 数据结构求最短路径vc++ 实现手动作图
💻 CPP
字号:
// ZUOTU.cpp : implementation file
//

#include "stdafx.h"
#include "direction2.h"
#include "ZUOTU.h"

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

/////////////////////////////////////////////////////////////////////////////
// CZUOTU dialog


CZUOTU::CZUOTU(CWnd* pParent /*=NULL*/)
	: CDialog(CZUOTU::IDD, pParent)
{
	//{{AFX_DATA_INIT(CZUOTU)
	m_chang = 0;
	//}}AFX_DATA_INIT
m_pParentWnd=pParent;
}





void CZUOTU::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CZUOTU)
	DDX_Control(pDX, IDC_COMBO2, m_combo);
	DDX_Text(pDX, IDC_EDIT1, m_chang);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CZUOTU, CDialog)
	//{{AFX_MSG_MAP(CZUOTU)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CZUOTU message handlers

//DEL void CZUOTU::OnDropdownCombo3() 
//DEL {
//DEL 	// TODO: Add your control notification handler code here
//DEL CFontDialog dlg;
//DEL dlg.m_cf.lpLogFont =&lf;
//DEL dlg.m_cf.rgbColors=textcolor;
//DEL dlg.m_cf.Flags|=CF_INITTOLOGFONTSTRUCT; //设置标志
//DEL if(dlg.DoModal() == IDOK)
//DEL {
//DEL dlg.GetCurrentFont(&lf);
//DEL textcolor = dlg.GetColor();
//DEL m_textstyle = lf.lfFaceName;
//DEL this->Invalidate();
//DEL }	
//DEL }
  
  

//DEL HBRUSH CZUOTU::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
//DEL {
//DEL 	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
//DEL 	
//DEL 	// TODO: Change any attributes of the DC here
//DEL   if((pWnd->GetDlgCtrlID()==IDC_COMBO4))   
//DEL   {   
//DEL   pDC->SetBkMode(textcolor);     
//DEL   return HBRUSH(GetStockObject(HOLLOW_BRUSH));   
//DEL   } 
//DEL    if((pWnd->GetDlgCtrlID()==IDC_COMBO5))   
//DEL   {   
//DEL   pDC->SetBkMode(pencolor);     
//DEL   return HBRUSH(GetStockObject(HOLLOW_BRUSH));   
//DEL   } 
//DEL     if((pWnd->GetDlgCtrlID()==IDC_COMBO6))   
//DEL   {   
//DEL   pDC->SetBkMode(fillcolor);     
//DEL   return HBRUSH(GetStockObject(HOLLOW_BRUSH));   
//DEL   }   
//DEL 
//DEL 	// TODO: Return a different brush if the default is not desired
//DEL 	return hbr;
//DEL }

  

  

//DEL void CZUOTU::OnDropdownCombo4() 
//DEL {
//DEL 	// TODO: Add your control notification handler code here
//DEL CColorDialog Colordialog(textcolor,CC_FULLOPEN,this);
//DEL if(Colordialog.DoModal()==IDOK)
//DEL {
//DEL textcolor = Colordialog.GetColor();
//DEL this->Invalidate(); 
//DEL }	
//DEL }

//DEL void CZUOTU::OnDropdownCombo5() 
//DEL {
//DEL 	// TODO: Add your control notification handler code here
//DEL CColorDialog Colordialog(pencolor,CC_FULLOPEN,this);
//DEL if(Colordialog.DoModal()==IDOK)
//DEL {
//DEL pencolor = Colordialog.GetColor();
//DEL this->Invalidate(); 
//DEL }	
//DEL 	
//DEL }

//DEL void CZUOTU::OnDropdownCombo6() 
//DEL {
//DEL 	// TODO: Add your control notification handler code here
//DEL CColorDialog Colordialog(fillcolor,CC_FULLOPEN,this);
//DEL if(Colordialog.DoModal()==IDOK)
//DEL {
//DEL fillcolor = Colordialog.GetColor();
//DEL this->Invalidate(); 
//DEL }	
//DEL }

//DEL BOOL CZUOTU::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) 
//DEL {
//DEL 	// TODO: Add your specialized code here and/or call the base class
//DEL 	//   TODO:   Add   extra   initialization   here   
//DEL   CString   str1[]={"实线","虚线","点线","虚点交替线","虚两点交替线","空画笔","带边线框"};
//DEL   for(int   i=0;i<7;i++)   
//DEL   {   
//DEL   m_combo.InsertString(i,str1[i]);   
//DEL   }   
//DEL m_combo.SetCurSel(0);//去掉后则什么也不显示,为什么?谢谢 
//DEL 
//DEL 	return CDialog::Create(IDD, pParentWnd);
//DEL }

BOOL CZUOTU::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	
CString str1[5]={"实   线 --------- ","虚   线 - - - - -  ","点   线 . . . . . ","点划线 _._._._._","双点划线 _.._.._.._"};
for(int   i=0;i<5;i++)   
{   
  m_combo.InsertString(i,str1[i]);   
}   
  m_combo.SetCurSel(0);//去掉后则什么也不显示,为什么?谢谢 


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

void CZUOTU::Setinfo(int width,int index)
{

m_chang=width;
m_combo.SetCurSel(index);
this->UpdateData(false);
}

void CZUOTU::OnOK() 
{
	// TODO: Add extra validation here
this->UpdateData(true);
    int index = m_chang; 
	int index2=m_combo.GetCurSel();
    m_pParentWnd->SendMessage(WM_CHANG_PEN,0,MAKELPARAM((WORD)index,(WORD)index2));	
     CDialog::OnOK();
}

⌨️ 快捷键说明

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