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

📄 popupdocument.cpp

📁 用bcg库编写的java IDE 源码
💻 CPP
字号:
// PopUpDocument.cpp : implementation file
//

#include "stdafx.h"
#include "VisualJava.h"
#include "PopUpDocument.h"
#include "VisualJavaDoc.h"

#include "PopUpView.h"

#include "browser.h"

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

/////////////////////////////////////////////////////////////////////////////
// CPopUpDocument

IMPLEMENT_DYNCREATE(CPopUpDocument, CDocument)

CPopUpDocument::CPopUpDocument()
{
  m_pTextBuffer = new CBaseTextBuffer;
}

BOOL CPopUpDocument::OnNewDocument()
{
	if (!CDocument::OnNewDocument())
		return FALSE;
	return TRUE;
}

CPopUpDocument::~CPopUpDocument()
{
}


BEGIN_MESSAGE_MAP(CPopUpDocument, CDocument)
	//{{AFX_MSG_MAP(CPopUpDocument)
		// NOTE - the ClassWizard will add and remove mapping macros here.
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CPopUpDocument diagnostics

#ifdef _DEBUG
void CPopUpDocument::AssertValid() const
{
	CDocument::AssertValid();
}

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

/////////////////////////////////////////////////////////////////////////////
// CPopUpDocument serialization

void CPopUpDocument::Serialize(CArchive& ar)
{
	if (ar.IsStoring())
	{
		// TODO: add storing code here
	}
	else
	{
		// TODO: add loading code here
	}
}

/////////////////////////////////////////////////////////////////////////////
// CPopUpDocument commands

BOOL CPopUpDocument::OnOpenDocument(LPCTSTR lpszPathName) 
{
	if (!CDocument::OnOpenDocument(lpszPathName))
		return FALSE;
	
	
	return m_pTextBuffer->LoadFromFile(lpszPathName);
}

#include "JavaApiTool.h"
void CPopUpDocument::OpenDoc(LPCTSTR lszpPath,__DeclBound &nTextRange)
{
	/**
   CString strPath(theApp.m_pJavaApiTool->getSrcPath());  
   strPath +="\\";strPath += lszpPath;strPath +=".java";
   
   //if(m_pTextBuffer->LoadFromFile(strPath))
   {
	  int x = nTextRange.m_nStartIndex;int y = nTextRange.m_nStartLine;
	  int cx = (*(nTextRange.m_pBlockEndIndex));
	  int cy = (*(nTextRange.m_pBlockEndLine));
     
	  if(cy == -1)cy = m_pTextBuffer->GetLineCount()-1;
	  if(cx == -1)cx = m_pTextBuffer->GetLineLength(cy)-1;

	  int count = m_pTextBuffer->GetLineCount();
      CString strText;
	  m_pTextBuffer->GetText(y,x,cy,cx,strText);


      x=0;y=0;
	  if(count>0)
	    cx = m_pTextBuffer->GetLineLength(count-1)-1;
	  else
		cx =0;

      if(cx<0)cx =0;

	  cy = m_pTextBuffer->GetLineCount()-1;
	  if(cy<0)cy =0;

      
      POSITION pos = GetFirstViewPosition();
	  CView* pView = NULL;
      
	  if(pos)
	  {
	     pView = GetNextView(pos); // get first one
	     ASSERT_VALID(pView);
	  }
      else return;

	  m_pTextBuffer->DeleteText((CCrystalTextView*)pView,y,x,cy,cx);

	  x = nTextRange.m_nStartIndex;y = nTextRange.m_nStartLine;
	  cx = (*(nTextRange.m_pBlockEndIndex));
	  cy = (*(nTextRange.m_pBlockEndLine));

      m_pTextBuffer->InsertText((CCrystalTextView*)pView,0,0,strText,cy,cx);
   }**/
}

⌨️ 快捷键说明

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