Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
@@ -0,0 +1,97 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "Peeper.h"
#include "ChildFrm.h"
#include "PeeperView.h"
#include "RevLookUpView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if( !m_wndSplitter.CreateStatic( this, 1, 2, WS_CHILD | WS_VISIBLE ) )
{
TRACE0( "Failed to create splitter\n" );
return FALSE;
}
CRect rct;
GetClientRect(&rct);
if(!m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CPeeperView),CSize(rct.Width()/2,10),pContext))
{
TRACE0("Failed to create CResTreeView ");
return FALSE; // failed to create
}
if(!m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CRevLookUpView),CSize(rct.Width()/2,10),pContext))
{
TRACE0("Failed to create CResTreeView ");
return FALSE; // failed to create
}
return TRUE;
}
+55
View File
@@ -0,0 +1,55 @@
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__54356AA0_D30F_480C_9EE3_22FA6A71FA67__INCLUDED_)
#define AFX_CHILDFRM_H__54356AA0_D30F_480C_9EE3_22FA6A71FA67__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
CSplitterWnd m_wndSplitter;
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//{{AFX_MSG(CChildFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHILDFRM_H__54356AA0_D30F_480C_9EE3_22FA6A71FA67__INCLUDED_)
+473
View File
@@ -0,0 +1,473 @@
// HNode.cpp: implementation of the HNode class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Peeper.h"
#include "HNode.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
//CArray<HNode,HNode &> HNode::Guff;
//DWORD HNode::ObjCount;
HNode *HNode::Create()
{
return new HNode;
}
void HNode::Delete(HNode *node)
{
delete node;
}
HNode::HNode()
{
Children.SetSize(0,5);
Clones.SetSize(0,5);
Original=NULL;
Parent=NULL;
Item=NULL;
Flag=0;
}
bool HNode::AddLocalFile(const CString &fname,const CString &path)
{
return NewChild()->ParseLocalFile(fname,path);
}
bool HNode::ParseLocalFile(const CString &fname,const CString &path)
{
FName=fname;
Path=path;
Flag=0;
FName.Replace('/','\\');
int loc=FName.ReverseFind('\\');
if(loc>=0) // If path was included add it
{
Path+=FName.Left(loc+1);
FName=FName.Mid(loc+1);
}
CString fbuf;
if(SysGetFile(FName,Path,fbuf))
{
return Parse(fbuf.GetBuffer(0));
fbuf.ReleaseBuffer();
}
else
{
return ParseGlobalFile(fname);
}
}
bool HNode::ParseGlobalFile(const CString &fname)
{
FName=fname;
Flag=0;
CString path,fbuf;
if(PathMan->GetFile(FName,Path,fbuf))
{
FName.Replace('/','\\');
int loc=FName.ReverseFind('\\');
if(loc>=0) // If path was included add it
{
Path+=FName.Left(loc+1);
FName=FName.Mid(loc+1);
}
return Parse(fbuf.GetBuffer(0));
}
else
{
Flag|=HN_NOTFOUND;
}
return true;
}
bool HNode::IsAbove(HNode *node)
{
if(IsSameName(node)) return true;
if(Parent==NULL) return false;
return Parent->IsAbove(node);
}
bool HNode::Parse(char *fbuf)
{
if(Parent && Parent->IsAbove(this)) // If the file is in the Tree we have a loop
{
Flag|=HN_LOOP;
return false;
}
// If the file has been parsed before copy it
if(CopyFromTree(this))
return true;
int start=0;
int bufsize=strlen(fbuf);
bool foundinclude=false;
int sd,ed;
for(;;)
{
for(foundinclude=false;!foundinclude;)
{
while(
!(fbuf[start]=='/' && (fbuf[start+1]=='/') || fbuf[start+1]=='*') &&
fbuf[start]!='#' &&
start<bufsize)
start++;
if((fbuf[start]=='/') && (fbuf[start+1]=='/'))
{
while(fbuf[start]!='\x0D' && start<bufsize) start++; // swallow white spaces
if(start>=bufsize) return true;
}
else if((fbuf[start]=='/') && (fbuf[start+1]=='*'))
{
start+=2;
if(start>=bufsize) {Flag|=HN_PARSEERROR; return true;}
while(!(fbuf[start]!='*' && fbuf[start+1]!='/') && start<bufsize) start++; // swallow white spaces
if(start>=bufsize) {Flag|=HN_PARSEERROR; return true;}
}
else
{
if(start>=bufsize) return true;
start++;
while((fbuf[start]==' ' || fbuf[start]=='\t') && fbuf[start]!='\x0D') start++; // swallow white spaces
if(!strncmp(fbuf+start,"include",7))
{
start+=7;
foundinclude=true;
}
}
}
for(sd=start;fbuf[sd]!='\"' && fbuf[sd]!='\x0D';sd++);
if(fbuf[sd]=='\"')
{
sd++;
for(ed=sd;fbuf[ed]!='\"' && fbuf[ed]!='\x0D';ed++);
if(fbuf[ed]!='\"') { Flag|=HN_PARSEERROR; return true; }
fbuf[ed]=0;
NewChild()->ParseLocalFile(fbuf+sd,Path);
}
else
{
for(sd=start;fbuf[sd]!='<' && fbuf[sd]!='\x0D';sd++);
if(fbuf[sd]=='\x0D') { Flag|=HN_PARSEERROR; return true; }
sd++;
for(ed=sd;fbuf[ed]!='>' && fbuf[ed]!='\x0D';ed++);
if(fbuf[ed]!='>') { Flag|=HN_PARSEERROR; return true; }
fbuf[ed]=0;
NewChild()->ParseGlobalFile(fbuf+sd);
}
start=ed+2;
}
}
bool HNode::CopyFromTreeDown(HNode *dest)
{
if(IsCopy()) return false;
if(IsSameName(dest))
{
dest->Copy(this);
return true;
}
else
{
int size=Children.GetSize();
for(int i=0;i<size;i++)
{
HNode *node=Children[i];
if(node->CopyFromTreeDown(dest))
return true;
}
}
return false;
}
bool HNode::CopyFromTree(HNode *dest)
{
if(!Parent) return false;
for(int i=0;i<Parent->Children.GetSize();i++)
if(Parent->Children[i]!=this && !(Parent->Children[i]->Flag&HN_LOOP))
{
if(Parent->Children[i]->CopyFromTreeDown(dest))
return true;
}
return Parent->CopyFromTree(dest);
}
void HNode::FillTree(CTreeCtrl *tree,HNode *stopat,HTREEITEM parent)
{
if(stopat==NULL) return;
}
void HNode::FillTree(CTreeCtrl *tree,HTREEITEM parent,int level,int levelmax)
{
if(level>levelmax) return;
Item=parent;
if(!IsRoot() && level>0)
{
Item=AddItem(tree,parent);
}
for(int i=0;i<Children.GetSize();i++)
{
Children[i]->FillTree(tree,Item,level+1);
}
}
HTREEITEM HNode::AddItem(CTreeCtrl *tree,HTREEITEM parent)
{
HTREEITEM itm;
if(Flag&HN_NOTFOUND || Flag&HN_LOOP)
{
CString con;
if(Flag&HN_NOTFOUND) con+="(Not Found)";
if(Flag&HN_LOOP) con+="(Circular)";
itm=tree->InsertItem(Path+FName+con,parent);
}
else
{
itm=tree->InsertItem(Path+FName,parent);
}
tree->SetItemData(itm,(DWORD)this);
return itm;
}
void HNode::FillReverseTree(CTreeCtrl *tree,HTREEITEM parent)
{
if(IsRoot()) return;
HTREEITEM itm=AddItem(tree,parent);
if(!Parent) return;
Parent->FillReverseTree(tree,itm);
int i;
for(i=0;i<Clones.GetSize();i++)
if(Clones[i]!=this && Clones[i]->Parent)
Clones[i]->Parent->FillReverseTree(tree,itm);
if(IsCopy())
{
if(Original->Parent)
Original->Parent->FillReverseTree(tree,itm);
for(int i=0;i<Original->Clones.GetSize();i++)
if(Original->Clones[i]!=this && Original->Clones[i]->Parent)
Original->Clones[i]->Parent->FillReverseTree(tree,itm);
}
}
void HNode::Copy(HNode *node)
{
ASSERT(node!=this);
Destroy();
FName=node->FName;
Path=node->Path;
Flag=node->Flag;
PathMan=node->PathMan;
Original=node;
node->Clones.Add(this);
for(int i=0;i<node->Children.GetSize();i++)
{
Children.Add(node->Children[i]);
}
// VerifyNode();
}
void HNode::Destroy()
{
if(!IsCopy())
{
for(int i=0;i<Children.GetSize();i++)
{
HNode *node=Children[i];
ASSERT(node!=NULL);
ASSERT(node->Parent==this);
Delete(node);
Children[i]=NULL;
}
}
Children.RemoveAll();
Clones.RemoveAll();
FName="";
Path="";
Flag=0;
Original=NULL;
PathMan=NULL;
}
DWORD HNode::NodeCount()
{
int sum=1;
for(int i=0;i<Children.GetSize();i++)
{
sum+=Children[i]->NodeCount();
}
return sum;
}
DWORD HNode::TreeSize()
{
int sum=sizeof(HNode)+Children.GetSize()*sizeof(HNode *)+FName.GetLength()+Path.GetLength();
if(!IsCopy())
{
for(int i=0;i<Children.GetSize();i++)
{
sum+=Children[i]->TreeSize();
}
}
return sum;
}
HNode *HNode::AddChild(HNode *child)
{
ASSERT(child!=NULL);
ASSERT(child->Parent==NULL);
Children.Add(child);
child->Parent=this;
child->PathMan=PathMan;
return child;
}
void HNode::VerifyNode()
{
ASSERT(this);
for(int i=0;i<Children.GetSize();i++)
{
ASSERT(Children[i]);
ASSERT(Children[i]->Parent);
ASSERT(Children[i]->Parent==this);
Children[i]->VerifyNode();
}
}
void HNode::ParseDsp(const CString &fname,const CString &path)
{
FName=fname;
Path=path;
CString dspbuf;
// CString path=Path.Left(Path.ReverseFind('\\')+1);
bool res=SysGetFile(FName,Path,dspbuf);
ASSERT(res);
int start=0;
start=dspbuf.Find("SOURCE=");
CString sfname;
while(start>=0)
{
start+=strlen("SOURCE=");
int endl=dspbuf.Find('\x0D',start);
if(endl>=0)
{
sfname=dspbuf.Mid(start,endl-start);
if(sfname.Left(2)==".\\") sfname=sfname.Mid(2);
if(!sfname.Right(4).CompareNoCase(".cpp") || !sfname.Right(2).CompareNoCase(".c"))
AddLocalFile(sfname,Path);
}
start=dspbuf.Find("SOURCE=",start+1);
}
}
HNode *HNode::Find(const CString fname,HNode *after,bool returnnext)
{
if(after==NULL) returnnext=true;
if(!FName.CompareNoCase(fname))
{
if(returnnext) return this;
if(after==this) returnnext=true;
}
HNode *ret=NULL;
for(int i=0;i<Children.GetSize();i++)
{
ret=Children[i]->Find(fname,after,returnnext);
if(ret) return ret;
}
return NULL;
}
void HNode::DrillDownTo(CTreeCtrl *tree)
{
if(IsRoot())
{
return;
}
else
Parent->DrillDownTo(tree);
int i;
if(Item==NULL) // If I haven't been added
{
for(i=0;i>Parent->Children.GetSize();i++) // Add me and my siblings
Parent->Children[i]->Item=Parent->Children[i]->AddItem(tree,Parent->Item);
ASSERT(Item);
}
for(i=0;i>Children.GetSize();i++) // Add my children
if(!Children[i]->Item)
Children[i]->Item=Children[i]->AddItem(tree,Parent->Item);
tree->Expand(Parent->Item,TVE_EXPAND); // Expand my parent
}
HNode::~HNode()
{
Destroy();
Parent=NULL;
}
+76
View File
@@ -0,0 +1,76 @@
// HNode.h: interface for the HNode class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_HNODE_H__2920EBA4_6B04_4358_8960_3205660CDA26__INCLUDED_)
#define AFX_HNODE_H__2920EBA4_6B04_4358_8960_3205660CDA26__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxtempl.h>
#define HN_PARSEERROR 1<<0
#define HN_NOTFOUND 1<<1
#define HN_LOOP 1<<2
#include"PathManager.h"
class HNode
{
protected:
static HNode *Create();
static void Delete(HNode *node);
CString FName,Path;
CArray<HNode *,HNode *> Children;
CArray<HNode *,HNode *> Clones;
HNode *Parent,*Original;
DWORD Flag;
CPathManager *PathMan;
HTREEITEM Item;
HNode *AddChild(HNode *child);
HNode *NewChild() {return AddChild(Create());}
HNode *GetParent() {return Parent;}
bool Parse(char *fbuf);
bool IsAbove(HNode *node);
bool ParseLocalFile(const CString &fname,const CString &path);
bool ParseGlobalFile(const CString &fname);
bool IsRoot() {return Parent==NULL;};
bool IsCopy() {return Original!=NULL;};
void Copy(HNode *node);
bool CopyFromTree(HNode *dest);
bool CopyFromTreeDown(HNode *dest);
void Destroy();
void VerifyNode();
HTREEITEM AddItem(CTreeCtrl *tree,HTREEITEM parent);
public:
// static CArray<HNode,HNode &> Guff;
// static DWORD ObjCount;
HTREEITEM GetItem() {return Item;}
static void Initalize() {}
DWORD NodeCount();
DWORD TreeSize();
HNode *Find(const CString fname,HNode *after=NULL,bool returnnext=false);
void DrillDownTo(CTreeCtrl *tree);
void FillTree(CTreeCtrl *tree,HNode *stopat,HTREEITEM parent=TVI_ROOT);
void FillTree(CTreeCtrl *tree,HTREEITEM parent=TVI_ROOT,int level=0,int levelmax=3);
void FillReverseTree(CTreeCtrl *tree,HTREEITEM parent=TVI_ROOT);
void SetPathManager(CPathManager *pman) {PathMan=pman;}
CString GetFullPath() {return Path+FName;}
bool IsSameName(HNode *node) { return !(node->FName.CompareNoCase(FName) || node->Path.CompareNoCase(Path));}
void ParseDsp(const CString &fname,const CString &path);
bool AddLocalFile(const CString &fname,const CString &path);
HNode();
virtual ~HNode();
};
#endif // !defined(AFX_HNODE_H__2920EBA4_6B04_4358_8960_3205660CDA26__INCLUDED_)
+107
View File
@@ -0,0 +1,107 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "Peeper.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to
// be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
+57
View File
@@ -0,0 +1,57 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__91F717D4_374C_4144_9A0A_3DF207F2EFD6__INCLUDED_)
#define AFX_MAINFRM_H__91F717D4_374C_4144_9A0A_3DF207F2EFD6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__91F717D4_374C_4144_9A0A_3DF207F2EFD6__INCLUDED_)
@@ -0,0 +1,172 @@
// PathManager.cpp: implementation of the CPathManager class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "Peeper.h"
#include "PathManager.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CPathManager::CPathManager()
{
}
void CPathManager::ScanRegistry()
{
HKEY dirkey;
if(ERROR_SUCCESS==RegOpenKey(HKEY_CURRENT_USER,"Software\\Microsoft\\Devstudio\\6.0\\Build System\\Components\\Platforms\\Win32 (x86)\\Directories",&dirkey))
{
char cstr[8096];
DWORD size=8096;
if(ERROR_SUCCESS==RegQueryValueEx(dirkey,"Include Dirs",NULL,NULL,(unsigned char *)cstr,&size))
{
CString str=cstr;
int start=0,end;
end=str.Find(';');
while(end>=0)
{
AddPath(str.Mid(start,end-start));
start=end+1;
end=str.Find(';',start);
}
AddPath(str.Mid(start));
}
RegCloseKey(dirkey);
}
}
bool SysGetFile(const char *fname,const CString &path,CString &outbuf)
{
OFSTRUCT ofs;
HFILE file;
file=OpenFile(path+fname,&ofs,OF_READ);
if(file==HFILE_ERROR) return false;
DWORD rbts,fsize=GetFileSize((HANDLE)file,NULL);
char *buf=new char[fsize];
ReadFile((HANDLE)file,buf,fsize,&rbts, NULL);
outbuf = buf;
delete buf;
CloseHandle((HANDLE)file);
// outbuf.Replace("\x0D\x0A","\n");
return true;
}
bool CPathManager::DoesFileExist(const char *fname,const CString &path)
{
OFSTRUCT ofs;
HFILE file;
file=OpenFile(path+fname,&ofs,OF_READ);
if(file==HFILE_ERROR) return false;
CloseHandle((HANDLE)file);
return true;
}
bool CPathManager::GetPath(const char *fname,CString &path)
{
for(int i=0;i<PathList.GetSize();i++)
{
if(DoesFileExist(fname,PathList[i]))
{
path=PathList[i];
return true;
}
}
return false;
}
bool CPathManager::GetFile(const char *fname,CString &path,CString &outfile)
{
for(int i=0;i<PathList.GetSize();i++)
{
if(SysGetFile(fname,PathList[i],outfile))
{
path=PathList[i];
return true;
}
}
return false;
}
void CPathManager::ScanProject(CString dspfname)
{
PathList.RemoveAll();
CString dsppath,dspbase;
dsppath=dspfname.Left(dspfname.ReverseFind('\\'));
dspbase=dspfname.Mid(dspfname.ReverseFind('\\'));
CString file_data;
if(SysGetFile(dspbase,dsppath,file_data))
{
int startcpp=0,endl;
startcpp=file_data.Find("# ADD CPP",startcpp);
while(startcpp>=0)
{
endl=file_data.Find('\n',startcpp);
if(endl<0) endl=file_data.GetLength();
int startinc=0;
startinc=file_data.Find("/I",startinc);
while(startinc>=0 && startinc<endl)
{
int sst,sed;
CString subpath;
sst=file_data.Find('\"',startinc);
ASSERT(sst<=endl);
sed=file_data.Find('\"',sst+1);
ASSERT(sed<=endl);
subpath=dsppath+"\\"+file_data.Mid(sst+1,(sed-sst)-1);
AddPath(subpath);
startinc=file_data.Find("/I",sed);
}
startcpp=file_data.Find("# ADD CPP",startcpp+1);
}
}
ScanRegistry();
}
void CPathManager::AddPath(CString str)
{
for(int i=0;i<PathList.GetSize();i++)
{
if(!PathList[i].CompareNoCase(str))
return;
}
PathList.Add(str+'\\');
}
CPathManager::~CPathManager()
{
}
@@ -0,0 +1,31 @@
// PathManager.h: interface for the CPathManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_PATHMANAGER_H__BB8EF7BC_ABE5_4D19_82E4_FFAA5343F165__INCLUDED_)
#define AFX_PATHMANAGER_H__BB8EF7BC_ABE5_4D19_82E4_FFAA5343F165__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxtempl.h>
class CPathManager
{
protected:
CArray<CString, CString &> PathList;
void AddPath(CString str);
bool DoesFileExist(const char *fname,const CString &path);
public:
void ScanRegistry();
bool GetFile(const char *fname,CString &path,CString &outfile);
bool GetPath(const char *fname,CString &path);
void ScanProject(CString dspfname);
CPathManager();
virtual ~CPathManager();
};
#endif // !defined(AFX_PATHMANAGER_H__BB8EF7BC_ABE5_4D19_82E4_FFAA5343F165__INCLUDED_)
+161
View File
@@ -0,0 +1,161 @@
// Peeper.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "Peeper.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "PeeperDoc.h"
#include "PeeperView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPeeperApp
BEGIN_MESSAGE_MAP(CPeeperApp, CWinApp)
//{{AFX_MSG_MAP(CPeeperApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// 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
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPeeperApp construction
CPeeperApp::CPeeperApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CPeeperApp object
CPeeperApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CPeeperApp initialization
BOOL CPeeperApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_PEEPERTYPE,
RUNTIME_CLASS(CPeeperDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CPeeperView));
AddDocTemplate(pDocTemplate);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CPeeperApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperApp message handlers
+218
View File
@@ -0,0 +1,218 @@
# Microsoft Developer Studio Project File - Name="Peeper" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Peeper - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Peeper.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Peeper.mak" CFG="Peeper - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Peeper - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Peeper - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Peeper - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "Peeper - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "Peeper - Win32 Release"
# Name "Peeper - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ChildFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\HNode.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\PathManager.cpp
# End Source File
# Begin Source File
SOURCE=.\Peeper.cpp
# End Source File
# Begin Source File
SOURCE=.\Peeper.rc
# End Source File
# Begin Source File
SOURCE=.\PeeperDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\PeeperView.cpp
# End Source File
# Begin Source File
SOURCE=.\ProgDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\RevLookUpView.cpp
# End Source File
# Begin Source File
SOURCE=.\SearchDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
SOURCE=.\HNode.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\PathManager.h
# End Source File
# Begin Source File
SOURCE=.\Peeper.h
# End Source File
# Begin Source File
SOURCE=.\PeeperDoc.h
# End Source File
# Begin Source File
SOURCE=.\PeeperView.h
# End Source File
# Begin Source File
SOURCE=.\ProgDlg.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\RevLookUpView.h
# End Source File
# Begin Source File
SOURCE=.\SearchDlg.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\Peeper.ico
# End Source File
# Begin Source File
SOURCE=.\res\Peeper.rc2
# End Source File
# Begin Source File
SOURCE=.\res\PeeperDoc.ico
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# End Group
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
+29
View File
@@ -0,0 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Peeper"=.\Peeper.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+50
View File
@@ -0,0 +1,50 @@
// Peeper.h : main header file for the PEEPER application
//
#if !defined(AFX_PEEPER_H__E645CB32_ACC0_40F5_BC74_A3AA283F7837__INCLUDED_)
#define AFX_PEEPER_H__E645CB32_ACC0_40F5_BC74_A3AA283F7837__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CPeeperApp:
// See Peeper.cpp for the implementation of this class
//
class CPeeperApp : public CWinApp
{
public:
CPeeperApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPeeperApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CPeeperApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
bool SysGetFile(const char *fname,const CString &path,CString &outbuf);
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PEEPER_H__E645CB32_ACC0_40F5_BC74_A3AA283F7837__INCLUDED_)
+476
View File
@@ -0,0 +1,476 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\Peeper.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\Peeper.ico"
IDR_PEEPERTYPE ICON DISCARDABLE "res\\PeeperDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_FILE_PRINT
SEPARATOR
BUTTON ID_APP_ABOUT
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM SEPARATOR
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Help"
BEGIN
MENUITEM "&About Peeper...", ID_APP_ABOUT
END
END
IDR_PEEPERTYPE MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Close", ID_FILE_CLOSE
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
MENUITEM SEPARATOR
MENUITEM "Find...", ID_EDIT_SEARCH
MENUITEM "Find Next", ID_EDIT_FINDNEXT
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Window"
BEGIN
MENUITEM "&New Window", ID_WINDOW_NEW
MENUITEM "&Cascade", ID_WINDOW_CASCADE
MENUITEM "&Tile", ID_WINDOW_TILE_HORZ
MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE
END
POPUP "&Help"
BEGIN
MENUITEM "&About Peeper...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About Peeper"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "Peeper Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2001",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
CG_IDD_PROGRESS DIALOG DISCARDABLE 0, 0, 186, 79
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Cancel",IDCANCEL,67,58,50,14
CONTROL "Progress1",CG_IDC_PROGDLG_PROGRESS,"msctls_progress32",
WS_BORDER,15,34,154,13
LTEXT " 0 %",CG_IDC_PROGDLG_PERCENT,85,23,18,8
LTEXT "",CG_IDC_PROGDLG_STATUS,13,7,158,8
END
IDD_SEARCHDLG DIALOG DISCARDABLE 0, 0, 186, 47
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Search For File"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,26,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,26,50,14
LTEXT "Find File:",IDC_STATIC,9,9,30,9
EDITTEXT IDC_FILENAME,45,6,116,14,ES_AUTOHSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "\0"
VALUE "FileDescription", "Peeper MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "Peeper\0"
VALUE "LegalCopyright", "Copyright (C) 2001\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "Peeper.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "Peeper Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
CG_IDD_PROGRESS, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 72
END
IDD_SEARCHDLG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 6
BOTTOMMARGIN, 40
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "Peeper"
IDR_PEEPERTYPE "\nPeeper\nPeeper\n\n\nPeeper.Document\nPeeper Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "Peeper"
AFX_IDS_IDLEMESSAGE "Ready"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new document\nNew"
ID_FILE_OPEN "Open an existing document\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
ID_FILE_PRINT "Print the active document\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
ID_FILE_MRU_FILE5 "Open this document"
ID_FILE_MRU_FILE6 "Open this document"
ID_FILE_MRU_FILE7 "Open this document"
ID_FILE_MRU_FILE8 "Open this document"
ID_FILE_MRU_FILE9 "Open this document"
ID_FILE_MRU_FILE10 "Open this document"
ID_FILE_MRU_FILE11 "Open this document"
ID_FILE_MRU_FILE12 "Open this document"
ID_FILE_MRU_FILE13 "Open this document"
ID_FILE_MRU_FILE14 "Open this document"
ID_FILE_MRU_FILE15 "Open this document"
ID_FILE_MRU_FILE16 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_NEW "Open another window for the active document\nNew Window"
ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
AFX_IDS_MDICHILD "Activate this window"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
CG_IDS_PROGRESS_CAPTION "Parseing Source Files"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_SPLITTER_RESOURCES
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\Peeper.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,119 @@
// PeeperDoc.cpp : implementation of the CPeeperDoc class
//
#include "stdafx.h"
#include "Peeper.h"
#include "PeeperDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPeeperDoc
IMPLEMENT_DYNCREATE(CPeeperDoc, CDocument)
BEGIN_MESSAGE_MAP(CPeeperDoc, CDocument)
//{{AFX_MSG_MAP(CPeeperDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CPeeperDoc construction/destruction
CPeeperDoc::CPeeperDoc()
{
// TODO: add one-time construction code here
HNode::Initalize();
}
CPeeperDoc::~CPeeperDoc()
{
}
BOOL CPeeperDoc::OnNewDocument()
{
// if (!CDocument::OnNewDocument())
// return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperDoc serialization
void CPeeperDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
}
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperDoc diagnostics
#ifdef _DEBUG
void CPeeperDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CPeeperDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPeeperDoc commands
BOOL CPeeperDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// if (!CDocument::OnOpenDocument(lpszPathName))
// return FALSE;
DspPath=lpszPathName;
Parsed=false;
DoParse();
return TRUE;
}
void CPeeperDoc::DoParse()
{
if(!Parsed)
{
PathMan.ScanProject(DspPath);
FileTree.SetPathManager(&PathMan);
CString dsppath,dspbase;
dsppath=DspPath.Left(DspPath.ReverseFind('\\')+1);
dspbase=DspPath.Mid(DspPath.ReverseFind('\\')+1);
FileTree.ParseDsp(dspbase,dsppath);
Parsed=true;
}
}
BOOL CPeeperDoc::OnSaveDocument(LPCTSTR lpszPathName)
{
// TODO: Add your specialized code here and/or call the base class
return CDocument::OnSaveDocument(lpszPathName);
}
@@ -0,0 +1,69 @@
// PeeperDoc.h : interface of the CPeeperDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PEEPERDOC_H__FE2BE47B_38A3_4754_80C9_4D44A27826B8__INCLUDED_)
#define AFX_PEEPERDOC_H__FE2BE47B_38A3_4754_80C9_4D44A27826B8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include"PathManager.h"
#include"HNode.h"
class CPeeperDoc : public CDocument
{
protected: // create from serialization only
CPeeperDoc();
DECLARE_DYNCREATE(CPeeperDoc)
CString DspPath;
// Attributes
public:
bool Parsed;
void DoParse();
CPathManager PathMan;
HNode FileTree;
CString GetDspPath() {return DspPath;}
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPeeperDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
virtual BOOL OnSaveDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CPeeperDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CPeeperDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PEEPERDOC_H__FE2BE47B_38A3_4754_80C9_4D44A27826B8__INCLUDED_)
@@ -0,0 +1,215 @@
// PeeperView.cpp : implementation of the CPeeperView class
//
#include "stdafx.h"
#include "Peeper.h"
#include "PeeperDoc.h"
#include "PeeperView.h"
#include "SearchDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPeeperView
IMPLEMENT_DYNCREATE(CPeeperView, CTreeView)
BEGIN_MESSAGE_MAP(CPeeperView, CTreeView)
//{{AFX_MSG_MAP(CPeeperView)
ON_WM_CREATE()
ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
ON_COMMAND(ID_EDIT_SEARCH, OnEditSearch)
ON_COMMAND(ID_EDIT_FINDNEXT, OnEditFindnext)
ON_UPDATE_COMMAND_UI(ID_EDIT_FINDNEXT, OnUpdateEditFindnext)
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CTreeView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CTreeView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CTreeView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPeeperView construction/destruction
CPeeperView::CPeeperView()
{
LastFind=NULL;
m_dwDefaultStyle |= TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
}
CPeeperView::~CPeeperView()
{
}
BOOL CPeeperView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CTreeView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperView drawing
void CPeeperView::OnDraw(CDC* pDC)
{
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperView printing
BOOL CPeeperView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CPeeperView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CPeeperView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CPeeperView diagnostics
#ifdef _DEBUG
void CPeeperView::AssertValid() const
{
CTreeView::AssertValid();
}
void CPeeperView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
CPeeperDoc* CPeeperView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPeeperDoc)));
return (CPeeperDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CPeeperView message handlers
int CPeeperView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CTreeView::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
void CPeeperView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
if(pSender!=this)
{
GetTreeCtrl().DeleteAllItems();
HTREEITEM itm=GetTreeCtrl().InsertItem(pDoc->GetDspPath(),TVI_ROOT);
GetTreeCtrl().SetItemData(itm,(DWORD)&(pDoc->FileTree));
pDoc->FileTree.FillTree(&GetTreeCtrl(),itm,0,1);
}
}
void CPeeperView::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
// TODO: Add your control notification handler code here
HTREEITEM itm=pNMTreeView->itemNew.hItem;
HTREEITEM child;
child=GetTreeCtrl().GetChildItem(itm);
do
{
if(!GetTreeCtrl().ItemHasChildren(child))
{
HNode *node=(HNode *)GetTreeCtrl().GetItemData(child);
ASSERT(node!=NULL);
node->FillTree(&GetTreeCtrl(),child,0,1);
}
}
while((child=GetTreeCtrl().GetNextSiblingItem(child))!=NULL);
*pResult = 0;
}
void CPeeperView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
HTREEITEM itm=pNMTreeView->itemNew.hItem;
pDoc->UpdateAllViews(this,GetTreeCtrl().GetItemData(itm));
*pResult = 0;
}
void CPeeperView::OnEditSearch()
{
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
CSearchDlg dlg;
dlg.m_FileName=SearchString;
if(dlg.DoModal()==IDOK)
{
SearchString=dlg.m_FileName;
OnEditFindnext();
}
}
void CPeeperView::OnEditFindnext()
{
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
LastFind=pDoc->FileTree.Find(SearchString,LastFind);
if(LastFind)
{
LastFind->DrillDownTo(&GetTreeCtrl());
GetTreeCtrl().EnsureVisible(LastFind->GetItem());
GetTreeCtrl().SelectItem(LastFind->GetItem());
}
else
{
MessageBox("Not Found","No More Results",MB_OK);
}
}
void CPeeperView::OnUpdateEditFindnext(CCmdUI* pCmdUI)
{
// TODO: Add your command update UI handler code here
pCmdUI->Enable((SearchString!="")?TRUE:FALSE);
}
@@ -0,0 +1,79 @@
// PeeperView.h : interface of the CPeeperView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_PEEPERVIEW_H__47A12E86_1216_4FAC_84E8_0ED6F5E485AD__INCLUDED_)
#define AFX_PEEPERVIEW_H__47A12E86_1216_4FAC_84E8_0ED6F5E485AD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <afxcview.h>
#include "PeeperDoc.h"
class CPeeperView : public CTreeView
{
protected: // create from serialization only
CPeeperView();
DECLARE_DYNCREATE(CPeeperView)
// Attributes
public:
CPeeperDoc* GetDocument();
CString SearchString;
HNode *LastFind;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CPeeperView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CPeeperView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CPeeperView)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEditSearch();
afx_msg void OnEditFindnext();
afx_msg void OnUpdateEditFindnext(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in PeeperView.cpp
inline CPeeperDoc* CPeeperView::GetDocument()
{ return (CPeeperDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PEEPERVIEW_H__47A12E86_1216_4FAC_84E8_0ED6F5E485AD__INCLUDED_)
+220
View File
@@ -0,0 +1,220 @@
// ProgDlg.cpp : implementation file
// CG: This file was added by the Progress Dialog component
#include "stdafx.h"
#include "resource.h"
#include "ProgDlg.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CProgressDlg dialog
CProgressDlg::CProgressDlg(UINT nCaptionID)
{
m_nCaptionID = CG_IDS_PROGRESS_CAPTION;
if (nCaptionID != 0)
m_nCaptionID = nCaptionID;
m_bCancel=FALSE;
m_nLower=0;
m_nUpper=100;
m_nStep=10;
//{{AFX_DATA_INIT(CProgressDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bParentDisabled = FALSE;
}
CProgressDlg::~CProgressDlg()
{
if(m_hWnd!=NULL)
DestroyWindow();
}
BOOL CProgressDlg::DestroyWindow()
{
ReEnableParent();
return CDialog::DestroyWindow();
}
void CProgressDlg::ReEnableParent()
{
if(m_bParentDisabled && (m_pParentWnd!=NULL))
m_pParentWnd->EnableWindow(TRUE);
m_bParentDisabled=FALSE;
}
BOOL CProgressDlg::Create(CWnd *pParent)
{
// Get the true parent of the dialog
m_pParentWnd = CWnd::GetSafeOwner(pParent);
// m_bParentDisabled is used to re-enable the parent window
// when the dialog is destroyed. So we don't want to set
// it to TRUE unless the parent was already enabled.
if((m_pParentWnd!=NULL) && m_pParentWnd->IsWindowEnabled())
{
m_pParentWnd->EnableWindow(FALSE);
m_bParentDisabled = TRUE;
}
if(!CDialog::Create(CProgressDlg::IDD,pParent))
{
ReEnableParent();
return FALSE;
}
return TRUE;
}
void CProgressDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CProgressDlg)
DDX_Control(pDX, CG_IDC_PROGDLG_PROGRESS, m_Progress);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CProgressDlg, CDialog)
//{{AFX_MSG_MAP(CProgressDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
void CProgressDlg::SetStatus(LPCTSTR lpszMessage)
{
ASSERT(m_hWnd); // Don't call this _before_ the dialog has
// been created. Can be called from OnInitDialog
CWnd *pWndStatus = GetDlgItem(CG_IDC_PROGDLG_STATUS);
// Verify that the static text control exists
ASSERT(pWndStatus!=NULL);
pWndStatus->SetWindowText(lpszMessage);
}
void CProgressDlg::OnCancel()
{
m_bCancel=TRUE;
}
void CProgressDlg::SetRange(int nLower,int nUpper)
{
m_nLower = nLower;
m_nUpper = nUpper;
m_Progress.SetRange(nLower,nUpper);
}
int CProgressDlg::SetPos(int nPos)
{
PumpMessages();
int iResult = m_Progress.SetPos(nPos);
UpdatePercent(nPos);
return iResult;
}
int CProgressDlg::SetStep(int nStep)
{
m_nStep = nStep; // Store for later use in calculating percentage
return m_Progress.SetStep(nStep);
}
int CProgressDlg::OffsetPos(int nPos)
{
PumpMessages();
int iResult = m_Progress.OffsetPos(nPos);
UpdatePercent(iResult+nPos);
return iResult;
}
int CProgressDlg::StepIt()
{
PumpMessages();
int iResult = m_Progress.StepIt();
UpdatePercent(iResult+m_nStep);
return iResult;
}
void CProgressDlg::PumpMessages()
{
// Must call Create() before using the dialog
ASSERT(m_hWnd!=NULL);
MSG msg;
// Handle dialog messages
while(PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if(!IsDialogMessage(&msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
}
BOOL CProgressDlg::CheckCancelButton()
{
// Process all pending messages
PumpMessages();
// Reset m_bCancel to FALSE so that
// CheckCancelButton returns FALSE until the user
// clicks Cancel again. This will allow you to call
// CheckCancelButton and still continue the operation.
// If m_bCancel stayed TRUE, then the next call to
// CheckCancelButton would always return TRUE
BOOL bResult = m_bCancel;
m_bCancel = FALSE;
return bResult;
}
void CProgressDlg::UpdatePercent(int nNewPos)
{
CWnd *pWndPercent = GetDlgItem(CG_IDC_PROGDLG_PERCENT);
int nPercent;
int nDivisor = m_nUpper - m_nLower;
ASSERT(nDivisor>0); // m_nLower should be smaller than m_nUpper
int nDividend = (nNewPos - m_nLower);
ASSERT(nDividend>=0); // Current position should be greater than m_nLower
nPercent = nDividend * 100 / nDivisor;
// Since the Progress Control wraps, we will wrap the percentage
// along with it. However, don't reset 100% back to 0%
if(nPercent!=100)
nPercent %= 100;
// Display the percentage
CString strBuf;
strBuf.Format(_T("%d%c"),nPercent,_T('%'));
CString strCur; // get current percentage
pWndPercent->GetWindowText(strCur);
if (strCur != strBuf)
pWndPercent->SetWindowText(strBuf);
}
/////////////////////////////////////////////////////////////////////////////
// CProgressDlg message handlers
BOOL CProgressDlg::OnInitDialog()
{
CDialog::OnInitDialog();
m_Progress.SetRange(m_nLower,m_nUpper);
m_Progress.SetStep(m_nStep);
m_Progress.SetPos(m_nLower);
CString strCaption;
VERIFY(strCaption.LoadString(m_nCaptionID));
SetWindowText(strCaption);
return TRUE;
}
+68
View File
@@ -0,0 +1,68 @@
// ProgDlg.h : header file
// CG: This file was added by the Progress Dialog component
/////////////////////////////////////////////////////////////////////////////
// CProgressDlg dialog
#ifndef __PROGDLG_H__
#define __PROGDLG_H__
class CProgressDlg : public CDialog
{
// Construction / Destruction
public:
CProgressDlg(UINT nCaptionID = 0); // standard constructor
~CProgressDlg();
BOOL Create(CWnd *pParent=NULL);
// Checking for Cancel button
BOOL CheckCancelButton();
// Progress Dialog manipulation
void SetStatus(LPCTSTR lpszMessage);
void SetRange(int nLower,int nUpper);
int SetStep(int nStep);
int SetPos(int nPos);
int OffsetPos(int nPos);
int StepIt();
// Dialog Data
//{{AFX_DATA(CProgressDlg)
enum { IDD = CG_IDD_PROGRESS };
CProgressCtrl m_Progress;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CProgressDlg)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
UINT m_nCaptionID;
int m_nLower;
int m_nUpper;
int m_nStep;
BOOL m_bCancel;
BOOL m_bParentDisabled;
void ReEnableParent();
virtual void OnCancel();
virtual void OnOK() {};
void UpdatePercent(int nCurrent);
void PumpMessages();
// Generated message map functions
//{{AFX_MSG(CProgressDlg)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // __PROGDLG_H__
+117
View File
@@ -0,0 +1,117 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : Peeper
========================================================================
AppWizard has created this Peeper application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your Peeper application.
Peeper.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
Peeper.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CPeeperApp application class.
Peeper.cpp
This is the main application source file that contains the application
class CPeeperApp.
Peeper.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
Peeper.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\Peeper.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file Peeper.rc.
res\Peeper.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
For the main frame window:
MainFrm.h, MainFrm.cpp
These files contain the frame class CMainFrame, which is derived from
CMDIFrameWnd and controls all MDI frame features.
res\Toolbar.bmp
This bitmap file is used to create tiled images for the toolbar.
The initial toolbar and status bar are constructed in the CMainFrame
class. Edit this toolbar bitmap using the resource editor, and
update the IDR_MAINFRAME TOOLBAR array in Peeper.rc to add
toolbar buttons.
/////////////////////////////////////////////////////////////////////////////
For the child frame window:
ChildFrm.h, ChildFrm.cpp
These files define and implement the CChildFrame class, which
supports the child windows in an MDI application.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one document type and one view:
PeeperDoc.h, PeeperDoc.cpp - the document
These files contain your CPeeperDoc class. Edit these files to
add your special document data and to implement file saving and loading
(via CPeeperDoc::Serialize).
PeeperView.h, PeeperView.cpp - the view of the document
These files contain your CPeeperView class.
CPeeperView objects are used to view CPeeperDoc objects.
res\PeeperDoc.ico
This is an icon file, which is used as the icon for MDI child windows
for the CPeeperDoc class. This icon is included by the main
resource file Peeper.rc.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named Peeper.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,99 @@
// RevLookUpView.cpp : implementation file
//
#include "stdafx.h"
#include "Peeper.h"
#include "RevLookUpView.h"
#include "hnode.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRevLookUpView
IMPLEMENT_DYNCREATE(CRevLookUpView, CTreeView)
CRevLookUpView::CRevLookUpView()
{
m_dwDefaultStyle |= TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;
}
CRevLookUpView::~CRevLookUpView()
{
}
BEGIN_MESSAGE_MAP(CRevLookUpView, CTreeView)
//{{AFX_MSG_MAP(CRevLookUpView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRevLookUpView drawing
void CRevLookUpView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CRevLookUpView diagnostics
#ifdef _DEBUG
void CRevLookUpView::AssertValid() const
{
CTreeView::AssertValid();
}
void CRevLookUpView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CRevLookUpView message handlers
CPeeperDoc* CRevLookUpView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CPeeperDoc)));
return (CPeeperDoc*)m_pDocument;
}
void CRevLookUpView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
GetTreeCtrl().DeleteAllItems();
if(pSender==this || lHint==NULL) return;
HNode *node=(HNode *)lHint;
CPeeperDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
node->FillReverseTree(&GetTreeCtrl(),TVI_ROOT);
GetTreeCtrl().Expand(GetTreeCtrl().GetChildItem(TVI_ROOT),TVE_EXPAND);
}
void CRevLookUpView::ExpandAll(HTREEITEM itm)
{
if(itm==NULL) return;
GetTreeCtrl().Expand(itm,TVE_EXPAND);
HTREEITEM nitm=GetTreeCtrl().GetChildItem(itm);
while(nitm!=NULL)
{
ExpandAll(nitm);
nitm=GetTreeCtrl().GetNextSiblingItem(nitm);
}
}
@@ -0,0 +1,57 @@
#if !defined(AFX_REVLOOKUPVIEW_H__73E3D83C_2EF6_4CD3_8713_5D99D5F580AA__INCLUDED_)
#define AFX_REVLOOKUPVIEW_H__73E3D83C_2EF6_4CD3_8713_5D99D5F580AA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RevLookUpView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CRevLookUpView view
#include <afxcview.h>
#include "PeeperDoc.h"
class CRevLookUpView : public CTreeView
{
protected:
CRevLookUpView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CRevLookUpView)
// Attributes
public:
CPeeperDoc* GetDocument();
// Operations
public:
void ExpandAll(HTREEITEM itm=TVI_ROOT);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRevLookUpView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CRevLookUpView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CRevLookUpView)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_REVLOOKUPVIEW_H__73E3D83C_2EF6_4CD3_8713_5D99D5F580AA__INCLUDED_)
@@ -0,0 +1,43 @@
// SearchDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Peeper.h"
#include "SearchDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSearchDlg dialog
CSearchDlg::CSearchDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSearchDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CSearchDlg)
m_FileName = _T("");
//}}AFX_DATA_INIT
}
void CSearchDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSearchDlg)
DDX_Text(pDX, IDC_FILENAME, m_FileName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSearchDlg, CDialog)
//{{AFX_MSG_MAP(CSearchDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSearchDlg message handlers
@@ -0,0 +1,46 @@
#if !defined(AFX_SEARCHDLG_H__B16412EB_23CF_488C_9541_671D22323AE7__INCLUDED_)
#define AFX_SEARCHDLG_H__B16412EB_23CF_488C_9541_671D22323AE7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SearchDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSearchDlg dialog
class CSearchDlg : public CDialog
{
// Construction
public:
CSearchDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CSearchDlg)
enum { IDD = IDD_SEARCHDLG };
CString m_FileName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSearchDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CSearchDlg)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SEARCHDLG_H__B16412EB_23CF_488C_9541_671D22323AE7__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// Peeper.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
+27
View File
@@ -0,0 +1,27 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__4B8C2581_0EB1_491E_A64D_385B0412CF32__INCLUDED_)
#define AFX_STDAFX_H__4B8C2581_0EB1_491E_A64D_385B0412CF32__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__4B8C2581_0EB1_491E_A64D_385B0412CF32__INCLUDED_)
Binary file not shown.
@@ -0,0 +1,13 @@
//
// PEEPER.RC2 - resources Microsoft Visual C++ does not edit directly
//
#ifdef APSTUDIO_INVOKED
#error this file is not editable by Microsoft Visual C++
#endif //APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
// Add manually edited resources here...
/////////////////////////////////////////////////////////////////////////////
Binary file not shown.
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by Peeper.rc
//
#define IDD_ABOUTBOX 100
#define CG_IDD_PROGRESS 102
#define CG_IDS_PROGRESS_CAPTION 103
#define IDR_MAINFRAME 128
#define IDR_PEEPERTYPE 129
#define IDD_SEARCHDLG 130
#define IDC_EDIT1 1000
#define IDC_FILENAME 1000
#define CG_IDC_PROGDLG_PROGRESS 1003
#define CG_IDC_PROGDLG_PERCENT 1004
#define CG_IDC_PROGDLG_STATUS 1005
#define ID_EDIT_SEARCH 32771
#define ID_EDIT_FINDNEXT 32772
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 131
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 104
#endif
#endif