- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
- // SpiderDoc.cpp : implementation of the CSpiderDoc class
- //
- #include "stdafx.h"
- #include "Spider.h"
- #include "SpiderDoc.h"
- #include "SpiderView.h"
- #include "SpiderList.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CSpiderDoc
- IMPLEMENT_DYNCREATE(CSpiderDoc, CDocument)
- BEGIN_MESSAGE_MAP(CSpiderDoc, CDocument)
- //{{AFX_MSG_MAP(CSpiderDoc)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSpiderDoc construction/destruction
- CSpiderDoc::CSpiderDoc()
- {
- }
- CSpiderDoc::~CSpiderDoc()
- {
- }
- BOOL CSpiderDoc::OnNewDocument()
- {
- if (!CDocument::OnNewDocument())
- return FALSE;
- // TODO: add reinitialization code here
- // (SDI documents will reuse this document)
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- // CSpiderDoc serialization
- void CSpiderDoc::Serialize(CArchive& ar)
- {
- // CEditView contains an edit control which handles all serialization
- ((CEditView*)m_viewList.GetHead())->SerializeRaw(ar);
- }
- /////////////////////////////////////////////////////////////////////////////
- // CSpiderDoc diagnostics
- #ifdef _DEBUG
- void CSpiderDoc::AssertValid() const
- {
- CDocument::AssertValid();
- }
- void CSpiderDoc::Dump(CDumpContext& dc) const
- {
- CDocument::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CSpiderDoc commands
- CSpiderDoc * CSpiderDoc::GetDoc()
- {
- CMDIChildWnd * pChild =
- ((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive();
- if ( !pChild )
- return NULL;
- CDocument * pDoc = pChild->GetActiveDocument();
- if ( !pDoc )
- return NULL;
- // Fail if doc is of wrong kind
- if ( ! pDoc->IsKindOf( RUNTIME_CLASS(CSpiderDoc) ) )
- return NULL;
- return (CSpiderDoc *) pDoc;
- }
- BOOL CSpiderDoc::ShowURL(LPCTSTR lpString)
- {
- CSpiderView* pView = (CSpiderView*)m_viewList.GetHead();
- ASSERT_KINDOF(CSpiderView, pView);
- pView->GetEditCtrl ().ReplaceSel( lpString, TRUE );
- return TRUE;
- }
- BOOL CSpiderDoc::CheckURLUpdate (LPCTSTR lpString)
- {
- CString rString;
- rString.Format("%s",lpString);
- rString +="rn";
- CSpiderView* pView = (CSpiderView*)m_viewList.GetHead();
- ASSERT_KINDOF(CSpiderView, pView);
- pView->GetEditCtrl ().ReplaceSel( rString, TRUE );
- return TRUE;
- }