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

📄 automakeview1.cpp

📁 编译原理课程设计之正则表达式与自动机之间的变换
💻 CPP
字号:
// AutoMakeView1.cpp : implementation file
//

#include "stdafx.h"
#include "AutoMake.h"
#include "AutoMakeView1.h"

#include "Globals.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView1

IMPLEMENT_DYNCREATE(CAutoMakeView1, CScrollView)

CAutoMakeView1::CAutoMakeView1()
{
}

CAutoMakeView1::~CAutoMakeView1()
{
}


BEGIN_MESSAGE_MAP(CAutoMakeView1, CScrollView)
	//{{AFX_MSG_MAP(CAutoMakeView1)
	ON_WM_HSCROLL()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView1 drawing

void CAutoMakeView1::OnDraw(CDC* pDC)
{
	CDocument* pDoc = GetDocument();
	// TODO: add draw code here
	if(CurrentIter!=NULL)
	{
     PaintNFA(pDC,CurrentIter);
	/*CClientDC dc(this);
	OnPrepareDC(&dc);
	CRect rc;
	GetClientRect(&rc);
	dc.FillRect(&rc,&CBrush(RGB(255,255,255)));
	PaintDFA(&dc,this);*/
	}
	//}
}

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView1 diagnostics

#ifdef _DEBUG
void CAutoMakeView1::AssertValid() const
{
	CScrollView::AssertValid();
}

void CAutoMakeView1::Dump(CDumpContext& dc) const
{
	CScrollView::Dump(dc);
}
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CAutoMakeView1 message handlers

void CAutoMakeView1::OnInitialUpdate() 
{
	CScrollView::OnInitialUpdate();
	
	// TODO: Add your specialized code here and/or call the base class
	CRect rc;
	GetClientRect(&rc);
	CSize sizeTotal;
	sizeTotal.cx=rc.Width()+18000;
    sizeTotal.cy=rc.Height()+10000;
	
	SetScrollSizes(MM_TEXT,sizeTotal);
	DEC=0;
//	ResizeParentToFit();
}
/*
UINT draw(LPVOID param)
{
	CAutoMakeView1* pView1=(CAutoMakeView1*)param;
	CClientDC dc(pView1);
	PaintNFA(&dc,pView1);
	return 0;
}*/

void CAutoMakeView1::drawNFA()
{
	CClientDC dc(this);
	OnPrepareDC(&dc);
	CRect rc;
	GetClientRect(&rc);
	dc.FillRect(&rc,&CBrush(RGB(255,255,255)));
	AutoShowNFA(&dc,this);
//	PaintDFA(&dc,this);
//	PaintMinDFA(&dc,this);
	DEC=1;
//	AfxBeginThread(draw,this);
}

void CAutoMakeView1::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
{
	// TODO: Add your message handler code here and/or call default
	int dx=GetScrollLimit(SB_HORZ);
	int dy=GetScrollLimit(SB_VERT);
	if(nPos>dx)
	{
		SetScrollSizes(MM_TEXT,CSize(dx+100,dy));
		SetScrollPos(SB_HORZ,dx+100);
	}
	CScrollView::OnHScroll(nSBCode, nPos, pScrollBar);
}

⌨️ 快捷键说明

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