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

📄 c_editorview.cpp

📁 C 语言编辑器(具有编辑器
💻 CPP
字号:
// C_EditorView.cpp : implementation of the CC_EditorView class
//

#include "stdafx.h"
#include "C_Editor.h"

#include "C_EditorDoc.h"
#include "CntrItem.h"
#include "C_EditorView.h"
#include "SynEditView.h"

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

/////////////////////////////////////////////////////////////////////////////
// CC_EditorView

IMPLEMENT_DYNCREATE(CC_EditorView, CSynEditView)

BEGIN_MESSAGE_MAP(CC_EditorView, CSynEditView)
	//{{AFX_MSG_MAP(CC_EditorView)
	ON_COMMAND(ID_COMPILE_FORMAT_ADJUST, OnCompileFormatAdjust)
	ON_COMMAND(ID_COMPILE_SYNTAX_CHECK, OnCompileSyntaxCheck)
	ON_WM_DESTROY()
	ON_WM_RBUTTONDBLCLK()
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
	// Standard printing commands
	ON_COMMAND(ID_FILE_PRINT, CSynEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_DIRECT, CSynEditView::OnFilePrint)
	ON_COMMAND(ID_FILE_PRINT_PREVIEW, CSynEditView::OnFilePrintPreview)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CC_EditorView construction/destruction

CC_EditorView::CC_EditorView()
{
	// TODO: add construction code here

}

CC_EditorView::~CC_EditorView()
{
}

BOOL CC_EditorView::PreCreateWindow(CREATESTRUCT& cs)
{
	// TODO: Modify the Window class or styles here by modifying
	//  the CREATESTRUCT cs

	return CSynEditView::PreCreateWindow(cs);
}

void CC_EditorView::OnInitialUpdate()
{
	CSynEditView::OnInitialUpdate();

	Invalidate();	
	// Set the printing margins (720 twips = 1/2 inch).
	SetMargins(CRect(720, 720, 720, 720));
}

/////////////////////////////////////////////////////////////////////////////
// CC_EditorView printing

BOOL CC_EditorView::OnPreparePrinting(CPrintInfo* pInfo)
{
	// default preparation
	return DoPreparePrinting(pInfo);
}


/*void CC_EditorView::OnDestroy()
{
	// Deactivate the item on destruction; this is important
	// when a splitter view is being used.
/*   CSynEditView::OnDestroy();
   COleClientItem* pActiveItem = GetDocument()->GetInPlaceActiveItem(this);
   if (pActiveItem != NULL && pActiveItem->GetActiveView() == this)
   {
      pActiveItem->Deactivate();
      ASSERT(GetDocument()->GetInPlaceActiveItem(this) == NULL);
   }
}*/


/////////////////////////////////////////////////////////////////////////////
// CC_EditorView diagnostics

#ifdef _DEBUG
void CC_EditorView::AssertValid() const
{
	CSynEditView::AssertValid();
}

void CC_EditorView::Dump(CDumpContext& dc) const
{
	CSynEditView::Dump(dc);
}

/*CC_EditorDoc* CC_EditorView::GetDocument() // non-debug version is inline
{
	ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CC_EditorDoc)));
	return (CC_EditorDoc*)m_pDocument;
}*/
#endif //_DEBUG

/////////////////////////////////////////////////////////////////////////////
// CC_EditorView message handlers



void CC_EditorView::OnCompileFormatAdjust() 
{
	// TODO: Add your command handler code here
	
}

void CC_EditorView::OnCompileSyntaxCheck() 
{
	// TODO: Add your command handler code here
/*	CC_EditorView * pView = (CC_EditorView*)m_viewList.GetHead();
	ASSERT_VALID( pView );
	ASSERT_KINDOF( CC_EditorView, pView );

	CString strBuf;
	m_TextBuffer.GetText( 0, 0, m_TextBuffer.GetLineCount() - 1,
		m_TextBuffer.GetLineLength(m_TextBuffer.GetLineCount() - 1), strBuf );
	if( strBuf.IsEmpty() ) return;

	OnFileSave();// save the file

	ShowOutput();
	ClearOutput();
	ClearErrFlag();

	SetOutputAttachedView( pView );

	OutputPhaseMsg( "building syntax tree..." );

	CParser* pParser = new CParser( strBuf );
	CString strPathName = GetPathName();
	strPathName = GetTitleFromPathName( strPathName );
	strPathName += ".parse";
	pParser->Trace( strPathName );

	delete pParser;

	if( !bErrFlag ) OpenTextFile( strPathName );*/
}

void CC_EditorView::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	
	// TODO: Add your message handler code here
	
	// Do not call CSynEditView::OnPaint() for painting messages

}

void CC_EditorView::OnDraw(CDC* pDC) 
{
	
	
}

⌨️ 快捷键说明

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