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,686 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "ChildFrm.h"
#include "ContentTrackDoc.h"
#include "ContentTrackView.h"
#include "NodeDataValueFileDoc.h"
#include "nodeobjectreferenceview1.h"
#include "findview.h"
#include "UnusedFilesView.h"
#include "MissingFilesView.h"
#include "DirectoryView.h"
#include "WizCopyMission.h"
#include "WizPageProject.h"
#include "WizPageMission.h"
#include "DlgCreateMap.h"
#include <GameOS\ToolOS.hpp>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CString ReplaceNoCase(CString input,CString strOld,CString strNew,int *pCount = NULL);
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
ON_COMMAND(ID_REFERENCES, OnReferences)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
ON_COMMAND(ID_FIND, OnFind)
ON_COMMAND(ID_MISSINGFILES, OnMissingfiles)
ON_COMMAND(ID_UNUSEDFILES, OnUnusedfiles)
ON_COMMAND(ID_WIZ_COPYMISSION, OnWizCopymission)
ON_COMMAND(ID_DIRECTORY, OnDirectory)
ON_COMMAND(ID_WIZ_CREATEMAP, OnWizCreatemap)
//}}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
void CChildFrame::OnReferences()
{
// Create a new view of this document that contains a tree of the references from the selected node
/* CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetActiveDocument();
CTreeCtrl *pCtrl = &this->GetTreeCtrl();
pDoc->GetNode()->ViewNode(pCtrl,NULL,2);
CView *pView = GetActiveView();
// If the view is a splitter window then */
/*m_wndSplitter.SplitColumn(1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CView),CSize(100,100),NULL);
m_wndSplitter.RecalcLayout();*/
CCreateContext cc;
memset(&cc, sizeof(cc), 0);
cc.m_pNewViewClass = RUNTIME_CLASS(CNodeObjectReferenceView);
cc.m_pCurrentDoc = GetActiveDocument();
cc.m_pNewDocTemplate = cc.m_pCurrentDoc ?
cc.m_pCurrentDoc->GetDocTemplate() : NULL;
cc.m_pCurrentFrame = this;
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CNodeObjectReferenceView),CSize(0,0),&cc);
m_wndSplitter.SetActivePane(0,1);
// initialize the view
CView *pView = (CView *)m_wndSplitter.GetPane(0,1);
if (pView)
pView->OnInitialUpdate();
m_wndSplitter.RecalcLayout(); // recompute layout
//m_wndSplitter.RedrawWindow();
}
BOOL CChildFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
if (m_wndSplitter.CreateStatic(this,1,2))
{
m_wndSplitter.CreateView(0,0,pContext->m_pNewViewClass,CSize(300,100),pContext);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CContentTrackView),CSize(10,10),pContext);
return TRUE;
}
return FALSE;
/* if (m_wndSplitter.Create(this,2,2,CSize(10,10),pContext))
{
m_wndSplitter.SetRowInfo(0,200,10);
m_wndSplitter.SetColumnInfo(0,200,10);
return true;
}
return false;
/* m_wndSplitter.CreateView(0,0,pContext->m_pNewViewClass,CSize(10,10),pContext);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CView),CSize(10,10),pContext);
m_wndSplitter.CreateView(1,0,RUNTIME_CLASS(CView),CSize(10,10),pContext);
m_wndSplitter.CreateView(1,1,RUNTIME_CLASS(CView),CSize(10,10),pContext);
//m_wndSplitter.RecalcLayout();*/
// return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}
void CChildFrame::OnFileNew()
{
CDocTemplate *pDocTemplate = (CDocTemplate *) ((CContentTrackApp *)AfxGetApp())->m_mapTemplates[ID_FILE_OPEN];
pDocTemplate->OpenDocumentFile(NULL);
}
void CChildFrame::OnFind()
{
CCreateContext cc;
memset(&cc, sizeof(cc), 0);
cc.m_pNewViewClass = RUNTIME_CLASS(CFindView);
cc.m_pCurrentDoc = GetActiveDocument();
cc.m_pNewDocTemplate = cc.m_pCurrentDoc ?
cc.m_pCurrentDoc->GetDocTemplate() : NULL;
cc.m_pCurrentFrame = this;
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CFindView),CSize(0,0),&cc);
m_wndSplitter.SetActivePane(0,1);
// initialize the view
CView *pView = (CView *)m_wndSplitter.GetPane(0,1);
if (pView)
pView->OnInitialUpdate();
m_wndSplitter.RecalcLayout(); // recompute layout
}
void CChildFrame::OnMissingfiles()
{
CCreateContext cc;
memset(&cc, sizeof(cc), 0);
cc.m_pNewViewClass = RUNTIME_CLASS(CMissingFilesView);
cc.m_pCurrentDoc = GetActiveDocument();
cc.m_pNewDocTemplate = cc.m_pCurrentDoc ?
cc.m_pCurrentDoc->GetDocTemplate() : NULL;
cc.m_pCurrentFrame = this;
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CMissingFilesView),CSize(0,0),&cc);
m_wndSplitter.SetActivePane(0,1);
// initialize the view
CView *pView = (CView *)m_wndSplitter.GetPane(0,1);
if (pView)
pView->OnInitialUpdate();
m_wndSplitter.RecalcLayout(); // recompute layout
}
void CChildFrame::OnUnusedfiles()
{
CCreateContext cc;
memset(&cc, sizeof(cc), 0);
cc.m_pNewViewClass = RUNTIME_CLASS(CUnusedFilesView);
cc.m_pCurrentDoc = GetActiveDocument();
cc.m_pNewDocTemplate = cc.m_pCurrentDoc ?
cc.m_pCurrentDoc->GetDocTemplate() : NULL;
cc.m_pCurrentFrame = this;
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CUnusedFilesView),CSize(0,0),&cc);
m_wndSplitter.SetActivePane(0,1);
// initialize the view
CView *pView = (CView *)m_wndSplitter.GetPane(0,1);
if (pView)
pView->OnInitialUpdate();
m_wndSplitter.RecalcLayout(); // recompute layout
}
// Add all the other "stuff" to resources.build - buildings, vehicles, etc...
int AddResources(CNodeDisk *pNode,CStringList *pList)
{
int count = 0;
static CStringList staticList;
static int firsttime = 1;
if (firsttime)
{
firsttime = 0;
// This is the first time, so initialize the staticList
staticList.RemoveAll();
staticList.AddHead("players\\");
staticList.AddHead("maps\\");
staticList.AddHead("buildings\\");
staticList.AddHead("weapons\\");
staticList.AddHead("weaponsubsystems\\");
staticList.AddHead("mechs\\");
staticList.AddHead("vehicles\\");
staticList.AddHead("dropzones\\");
}
//if (pNode->IsFile())
{
//CNodeDataValueFile *pFile = (CNodeDataValueFile *)pNode;
CNodeDisk *pDisk = pNode;//->GetNodeDisk();
if (pDisk)
{
CString strPath = pDisk->GetPath();
if (strPath.GetLength())
{
if (strPath[0] == '\\')
strPath.Delete(0,1);
//strPath.MakeLower();
CString ext = strPath.Right(5);
//if (ext == CString(".data"))
if (0 == strnicmp(ext,".data",5))
{
if (strnicmp(strPath,"content\\",8)==0)
strPath.Delete(0,8);
CString path = strPath;
int index = path.Find('\\',0);
if (index>=0)
{
path = path.Left(index+1);
path.MakeLower();
if (staticList.Find(path))
{
if (NULL == pList->Find(strPath))
{
pList->AddHead(strPath);
count++;
}
}
}
}
}
}
}
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
if ((pChild->GetClassID() == CLASS_CNODEDISKFILE) || (pChild->GetClassID() == CLASS_CNODEDISKDIRECTORY))
count += AddResources((CNodeDisk *)pChild,pList);
}
return count;
}
int VisitFiles(CNodeObject *pNode)
{
int count = 0;
if (NULL == pNode)
return 0;
if (pNode->GetClassID() == CLASS_CNODEDISKDIRECTORY)
{
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
count += VisitFiles(pChild);
}
}
if (pNode->GetClassID() == CLASS_CNODEDISKFILE)
{
pNode->SetVisit(VISIT_FLAG1);
count++;
}
return count;
}
void CChildFrame::OnWizCopymission()
{
CWizCopyMission dlg("Copy Mission Wizard",AfxGetMainWnd());
dlg.SetWizardMode();
CWizPageMission page1;
dlg.AddPage(&page1);
CWizPageProject page2;
dlg.AddPage(&page2);
if (ID_WIZFINISH == dlg.DoModal())
{
CNodeObject *pNode = NULL;
// Visit flags are used during cloning and should be cleared before we procede
dlg.m_pSrcDoc->GetRootNode()->ResetVisitAll(); // Cloning flags used to show if we can copy this file
dlg.m_pDstDoc->GetRootNode()->ResetVisitAll(); // Cloning flags used to show if this file has already been processed
static int check1 = 1;
if (check1)
{
// Mark the selected directories as Copy-Able
POSITION pos = dlg.m_listCopyDir.GetHeadPosition();
while (pos)
{
//CObject *pObj = dlg.m_listCopyDir.GetNext(pos);
CNodeObject *pChild = (CNodeObject *)dlg.m_listCopyDir.GetNext(pos);;
VisitFiles(pChild);
}
CString str = "content\\textures\\maps\\"+dlg.m_strName;
CNodeDisk *pTDisk = dlg.m_pSrcDoc->FindDirectoryNode(str);
VisitFiles(pTDisk);
}
// Copy the data
CNodeDataValueFileProject *pSrcProject = dlg.m_pSrcDoc->GetNodeProject();
CNodeDataValueFileProject *pDstProject = dlg.m_pDstDoc->GetNodeProject();
pNode = pSrcProject->CreateChild(pSrcProject,KEYTYPE_NOTE,"content\\"+dlg.m_strMission);
pSrcProject->AddChild(pNode);
// Copy the TCTD.INI specifically
CNodeObject *pNodeTct = pSrcProject->CreateChild(pSrcProject,KEYTYPE_NOTE,"content\\maps\\"+dlg.m_strName+"\\tctd.ini");
pSrcProject->AddChild(pNodeTct);
SetCurrentDirectory(dlg.m_pDstDoc->GetRootDir());
// Find the resource.build file in the destination. It can only be a direct child of the project
CNodeDisk *pDiskResource = dlg.m_pDstDoc->FindDirectoryNode("content\\resources.build");
if (NULL == pDiskResource)
{
// Create destination resources.build
// Content directory is assumed when using the rootnode
pDiskResource = dlg.m_pDstDoc->GetRootNode()->DiskCopyFile("","resources.build");
}
// This should copy/merge the files and add to destination project root
CString strMission = dlg.m_strMission;
CString newName;
CString oldName;
if (dlg.m_bRename)
{
newName = dlg.m_strRename;
oldName = dlg.m_strName;
int rcount;// = strMission.Replace(oldName,newName);
CString output = ReplaceNoCase(strMission,oldName,newName,&rcount);
if (rcount)
{
int x=1;
}
strMission = output;
}
CNodeObject *pCloneTct = dlg.m_pDstDoc->_OnEditPaste(pNodeTct,oldName,newName);
CNodeObject *pClone = dlg.m_pDstDoc->_OnEditPaste(pNode,oldName,newName);
// Update resources.build
// First update the file
static int check2 = 1;
CStringList dataList,resList,addList,editorList;
// dataList are the data members found in copy process
// reslist are the dataList members found in the source resources.build
// - dataList items are removed as they are added to resList
// addList are the resList items that exist in the destination resources.build
// - resList items are removed as they are added to addList
// - the remaining reslist is the stuff to add to the destination resources.build
// and should have 0 items if there is a rename in the same project
int rescount = AddResources(dlg.m_pDstDoc->GetRootNode(),&dataList);
// Copy this list cuz we do the same thing with resources as editor.build (sort of)
editorList.AddHead(&dataList);
// TODO: Remove the items in dataList that do not exist in the source resources.build
{
NotationFile notefile(*pSrcProject->GetRootPath()+"\\content\\resources.build");
Page *page = notefile.SetPage("resources\\main");
if (page)
{
Check_Object(page);
Page::NoteIterator *entries = page->MakeNoteIterator();
Check_Object(entries);
Note *entry;
// Enumerate the entries in the section
while ((entry = entries->ReadAndNext()) != NULL)
{
Check_Object(entry);
CString key(entry->GetName());
//key.MakeLower();
const char *value;
entry->GetEntry(&value);
CString name1(value);
CString name2(strMission);
if (key == "data")
{
POSITION pos = dataList.Find(name1);
if (pos)
{
CString data = dataList.GetAt(pos);
resList.AddHead(data);
dataList.RemoveAt(pos);
}
}
}
delete entries;
}
notefile.IgnoreChanges();
}
// resources.build is not already loaded so we have to scan it manually
if (gos_DoesFileExist("content\\resources.build"))
{
bool bFoundMap = false;
bool bFoundMission =false;
int resaddcount = 0;
NotationFile notefile("content\\resources.build");
Page *page = notefile.SetPage("resources\\main");
if (page)
{
Check_Object(page);
Page::NoteIterator *entries = page->MakeNoteIterator();
Check_Object(entries);
Note *entry;
// Enumerate the entries in the section
while ((entry = entries->ReadAndNext()) != NULL)
{
Check_Object(entry);
CString key(entry->GetName());
//key.MakeLower();
const char *value;
entry->GetEntry(&value);
CString name1(value);
CString name2(strMission);
//name1.MakeLower();
//name2.MakeLower();
if (0 == strnicmp(key,"instance",8))
//if (key == "instance")
{
//if (name1 == name2)
if (0==strnicmp(name1,name2,name1.GetLength()))
{
bFoundMission = true;
}
}
else if (key == "data")
{
// Map should be added automatically
{
POSITION pos = resList.Find(name1);
if (pos)
{
resaddcount++;
CString data = resList.GetAt(pos);
addList.AddHead(data);
resList.RemoveAt(pos);
}
}
}
}
delete entries;
if (!bFoundMission)
{
page->AppendEntry("instance",strMission);
}
// Only add entries to a new resources.build if it exists in the old one
if (dlg.m_pDstDoc != dlg.m_pSrcDoc)
{
POSITION pos = resList.GetHeadPosition();
while (pos)
{
CString str = resList.GetNext(pos);
page->AppendEntry("data",str);
}
}
else
{
Verify(resList.GetCount() == 0);
}
if (!bFoundMap || !bFoundMission || (resaddcount>0))
{
if (IDYES == MessageBox("Overwrite Resources.build?","Copy Mission",MB_YESNO))
{
CString fname("content\\resources.build");
DWORD attrib = ::GetFileAttributes(fname);
if (-1 != attrib)
{
if (attrib & FILE_ATTRIBUTE_READONLY)
{
attrib &= ~FILE_ATTRIBUTE_READONLY;
::SetFileAttributes(fname,attrib);
}
}
notefile.Save();
}
else
notefile.IgnoreChanges();
}
}
else
{
// Error with setpage
Verify(false);
}
}
else
{
// Missing file!!
Verify(false);
}
// Update the contenttracker
if (pDiskResource->IsLoaded())
{
// If we already loaded this file, we need to update the Node with the new data
//Verify(false);
}
//CStringList edList;
// TODO: find or create the destination editor.contents
CNodeDisk *pSrcEditor = dlg.m_pSrcDoc->FindDirectoryNode("content\\editor\\editor.contents");
if (pSrcEditor)
{
// The source has an editor.contents
//Verify(false);
// Any model in the source's editor.content that was touched by the copy, copy it to editor.contents
// Search the copy node for any notation file with a ".data" on the name. Split the path,
// if the fname of the path exists in the editor.contents as a page title, copy that page
NotationFile notefile(pSrcEditor->GetRootPath()+pSrcEditor->GetPath());
NotationFile::PageIterator *pages = notefile.MakePageIterator();
Check_Object(pages);
Page *page;
CNodeDisk *pEditor = dlg.m_pDstDoc->GetRootNode()->DiskCopyFile("","editor\\editor.contents");
NotationFile destfile(dlg.m_pDstDoc->GetRootDir()+pEditor->GetPath());
while (page = pages->ReadAndNext())
{
CString name = page->GetName();
POSITION pos = editorList.Find(name);
if (pos)
{
editorList.RemoveAt(pos);
Page *destpage = destfile.SetPage(name);
destpage->DeleteAllNotes();
Page::NoteIterator *notes = page->MakeNoteIterator();
Check_Object(notes);
Note *note;
notes->Last();
while (note = notes->ReadAndPrevious())
{
const char *entry;
note->GetEntry(&entry);
destpage->AppendEntry(note->GetName(),entry);
}
delete notes;
}
}
delete pages;
notefile.IgnoreChanges();
destfile.Save();
}
CNodeDisk *pDstEditor = dlg.m_pDstDoc->FindDirectoryNode("content\\editor\\editor.contents");
if (pDstEditor)
{
//dlg.m_pDstDoc->_OnEditPaste(pDstEditor,oldName,newName);
}
// ** We may want to remove these children from the project... or not
dlg.m_pSrcDoc->UpdateAllViews(NULL,NULL,NULL);
dlg.m_pDstDoc->UpdateAllViews(NULL,NULL,NULL);
}
}
void CChildFrame::OnDirectory()
{
CCreateContext cc;
memset(&cc, sizeof(cc), 0);
cc.m_pNewViewClass = RUNTIME_CLASS(CDirectoryView);
cc.m_pCurrentDoc = GetActiveDocument();
cc.m_pNewDocTemplate = cc.m_pCurrentDoc ?
cc.m_pCurrentDoc->GetDocTemplate() : NULL;
cc.m_pCurrentFrame = this;
m_wndSplitter.DeleteView(0,1);
m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CDirectoryView),CSize(0,0),&cc);
m_wndSplitter.SetActivePane(0,1);
// initialize the view
CView *pView = (CView *)m_wndSplitter.GetPane(0,1);
if (pView)
pView->OnInitialUpdate();
m_wndSplitter.RecalcLayout(); // recompute layout
}
int VisitTreeFiles(CNodeObject *pNode);
void CChildFrame::OnWizCreatemap()
{
CDlgCreateMap dlg;
if (dlg.DoModal() == IDOK)
{
CString oldName;
oldName.Format("%dkcontentmap",dlg.m_iSize);
CString newName = dlg.m_strName;
CNodeDataValueFileDoc *pDstDoc = (CNodeDataValueFileDoc *)this->GetActiveDocument();
CNodeDataValueFileProject *pDstProject = pDstDoc->GetNodeProject();
CDocTemplate *pDocTemplate = (CDocTemplate *) ((CContentTrackApp *)AfxGetApp())->m_mapTemplates[ID_FILE_OPEN];
CContentTrackApp *pApp = (CContentTrackApp *)AfxGetApp();
CString str = pApp->m_strRunDir+"\\template\\template.contenttrack";
CDocument *pNewDoc = pDocTemplate->OpenDocumentFile(str);
VERIFY(pNewDoc->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)));
CNodeDataValueFileDoc *pSrcDoc = (CNodeDataValueFileDoc *)pNewDoc;
CNodeDataValueFileProject *pSrcProject = pSrcDoc->GetNodeProject();
{
CNodeObject *pSrcNode = pSrcProject->CreateChild(pSrcProject,KEYTYPE_NOTE,"content\\maps\\"+oldName+"\\"+oldName+".instance");
pSrcProject->AddChild(pSrcNode);
VisitTreeFiles(pSrcNode);
CNodeObject *pClone = pDstDoc->_OnEditPaste(pSrcNode,oldName,newName);
}
{
CNodeObject *pSrcNode = pSrcProject->CreateChild(pSrcProject,KEYTYPE_ERF,"content\\skies\\"+oldName+"_sky\\"+oldName+"_sky.erf");
pSrcProject->AddChild(pSrcNode);
VisitTreeFiles(pSrcNode);
CNodeObject *pClone = pDstDoc->_OnEditPaste(pSrcNode,oldName,newName);
}
{
CNodeObject *pSrcNode = pSrcProject->CreateChild(pSrcProject,KEYTYPE_NOTE,"content\\textures\\composttexture\\"+oldName+".index.tcf");
pSrcProject->AddChild(pSrcNode);
VisitTreeFiles(pSrcNode);
CNodeObject *pClone = pDstDoc->_OnEditPaste(pSrcNode,oldName,newName);
}
//pSrcProject->AddChild(pSrcNode);
pSrcDoc->UpdateAllViews(NULL,NULL,NULL);
pDstDoc->UpdateAllViews(NULL,NULL,NULL);
}
}
@@ -0,0 +1,63 @@
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__38050504_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_CHILDFRM_H__38050504_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
public:
CSplitterWnd m_wndSplitter;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
public:
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CChildFrame)
afx_msg void OnReferences();
afx_msg void OnFileNew();
afx_msg void OnFind();
afx_msg void OnMissingfiles();
afx_msg void OnUnusedfiles();
afx_msg void OnWizCopymission();
afx_msg void OnDirectory();
afx_msg void OnWizCreatemap();
//}}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__38050504_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,46 @@
// ChildWndThread.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "ChildWndThread.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildWndThread
IMPLEMENT_DYNCREATE(CChildWndThread, CWinThread)
CChildWndThread::CChildWndThread()
{
}
CChildWndThread::~CChildWndThread()
{
}
BOOL CChildWndThread::InitInstance()
{
return TRUE;
}
int CChildWndThread::ExitInstance()
{
// TODO: perform any per-thread cleanup here
return CWinThread::ExitInstance();
}
BEGIN_MESSAGE_MAP(CChildWndThread, CWinThread)
//{{AFX_MSG_MAP(CChildWndThread)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildWndThread message handlers
@@ -0,0 +1,52 @@
#if !defined(AFX_CHILDWNDTHREAD_H__9C0A6D40_BE16_47FA_A09F_290E7ED2D3D0__INCLUDED_)
#define AFX_CHILDWNDTHREAD_H__9C0A6D40_BE16_47FA_A09F_290E7ED2D3D0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChildWndThread.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CChildWndThread thread
class CChildWndThread : public CWinThread
{
DECLARE_DYNCREATE(CChildWndThread)
protected:
CChildWndThread(); // protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildWndThread)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CChildWndThread();
// Generated message map functions
//{{AFX_MSG(CChildWndThread)
// 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_CHILDWNDTHREAD_H__9C0A6D40_BE16_47FA_A09F_290E7ED2D3D0__INCLUDED_)
@@ -0,0 +1,879 @@
// ContentTrack.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "KeyTypeDlg.h"
#include "NodeDataValueFileDoc.h"
#include "NodeDataValueFileView.h"
#include <GameOS\GameOS.hpp>
#include <DLLPlatform\DLLPlatform.hpp>
#if !defined(MW4ANIMATIONSYSTEM_HPP)
#include <MW4\MW4AnimationSystem.hpp>
#endif
#include "mw4.hpp"
#include "mw4headers.hpp"
#include "gosfx\gosfx.hpp"
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\GroupElement.hpp>
#include <MLR\MLR.hpp>
#include <MLR\GOSImagePool.hpp>
#include <MLR\MLRTexturePool.hpp>
#include <GameOS\ToolOS.hpp>
CStringMap g_StringMap;
DWORD g_stringmem;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void __stdcall GetGameOSEnvironment(char* CommandLine)
{
//
//----------------------------------------------------------
// This is where to set GOS environment settings.
//----------------------------------------------------------
//
Environment.applicationName = "DataWalker";
Environment.screenWidth = 640;
Environment.screenHeight = 480;
Environment.bitDepth = 16;
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackApp
BEGIN_MESSAGE_MAP(CContentTrackApp, CWinApp)
//{{AFX_MSG_MAP(CContentTrackApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
ON_COMMAND(ID_EDIT_KEYTYPE, OnEditKeytype)
ON_COMMAND(ID_FILE_NEW, OnFileNew)
//}}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()
/////////////////////////////////////////////////////////////////////////////
// CContentTrackApp construction
CContentTrackApp::CContentTrackApp()
{
m_pNodeSelected = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CContentTrackApp object
CContentTrackApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CContentTrackApp initialization
BOOL CContentTrackApp::InitInstance()
{
char buf[MAX_PATH];
GetCurrentDirectory(MAX_PATH,buf);
InitGameOS( AfxGetInstanceHandle(), NULL, "\0" );
Stuff::ArmorLevel = 4;
Stuff::InitializeClasses();
MidLevelRenderer::InitializeClasses(NULL, 8192*4, 1024*256);
gosFX::InitializeClasses();
ElementRenderer::InitializeClasses();
//char buf[MAX_PATH];
//GetCurrentDirectory(MAX_PATH,buf);
SetCurrentDirectory(buf);
m_strRunDir = buf;
//
//-------------------
// Make base managers
//-------------------
//
Verify(!ResourceManager::Instance);
ResourceManager::Instance = new ResourceManager;
Check_Object(ResourceManager::Instance);
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
SetRegistryKey(_T("ContentTrack"));
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_CONTENTYPE,
RUNTIME_CLASS(CNodeDataValueFileDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CNodeDataValueFileView));
AddDocTemplate(pDocTemplate);
m_mapTemplates[ID_FILE_OPEN] = pDocTemplate;
/*pDocTemplate = new CMultiDocTemplate(
IDR_CONTENTYPE,
RUNTIME_CLASS(CUnusedFilesDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CUnusedFilesView));
AddDocTemplate(pDocTemplate);
m_mapTemplates[ID_UNUSEDFILES] = pDocTemplate;*/
/*pDocTemplate = new CMultiDocTemplate(
IDR_CONTENTYPE,
RUNTIME_CLASS(CUnusedFilesDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CMissingFilesView));
AddDocTemplate(pDocTemplate);
m_mapTemplates[ID_MISSINGFILES] = 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();
// Load the default key types
{
CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
pFrame->SetMessageText("Loading Data Key Map...");
ReadPropFile();
}
//Create the texture pool
{
gos_PushCurrentHeap(MidLevelRenderer::TexturePoolHeap);
MidLevelRenderer::TGAFilePool *pool = new MidLevelRenderer::TGAFilePool("\\content\\textures");
Check_Object(pool);
MidLevelRenderer::MLRTexturePool::Instance = new MidLevelRenderer::MLRTexturePool(pool);
Check_Object(MidLevelRenderer::MLRTexturePool::Instance);
Check_Object(MidLevelRenderer::MLRTexturePool::Instance);
gos_PopCurrentHeap();
}
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 CContentTrackApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackApp message handlers
int CContentTrackApp::ExitInstance()
{
// Save the Key Types
WritePropFile();
//g_mapKeyType.RemoveAll();
Check_Object(ResourceManager::Instance);
delete ResourceManager::Instance;
ResourceManager::Instance = NULL;
ElementRenderer::TerminateClasses();
gosFX::TerminateClasses();
MidLevelRenderer::TerminateClasses();
Stuff::TerminateClasses();
ExitGameOS();
return CWinApp::ExitInstance();
}
void CContentTrackApp::OnFileOpen()
{
CString newName;
if (!DoPromptFileName(newName, AFX_IDS_OPENFILE,OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, NULL))
return; // open cancelled
CDocTemplate *pDocTemplate = (CDocTemplate *)m_mapTemplates[ID_FILE_OPEN];
pDocTemplate->OpenDocumentFile(newName);
}
void CContentTrackApp::OnFileNew()
{
// New project is handled from mainfrm because this OnFileNew gets called during app initialization
}
void CContentTrackApp::OnEditKeytype()
{
CKeyTypeDlg dlg;
CMapPtrToWord map;
dlg.SetMap(&map);
if (IDOK == dlg.DoModal())
{
// dlg.GetMap(g_mapKeyType);
if (dlg.m_bDirty)
{
UpdateKeys();
WritePropFile();
}
}
}
int CContentTrackApp::UpdateKeys()
{
POSITION TempPos = this->GetFirstDocTemplatePosition();
while (TempPos)
{
CDocTemplate *pTemplate = this->GetNextDocTemplate(TempPos);
if (pTemplate)
{
POSITION DocPos = pTemplate->GetFirstDocPosition();
while (DocPos)
{
CDocument *pDoc = pTemplate->GetNextDoc(DocPos);
pDoc->OnOpenDocument(pDoc->GetPathName());
}
}
}
return 0;
}
int CContentTrackApp::WritePropFile()
{
CStringList list;
g_StringMap.MakeList(list);
FILE *f = fopen(m_strRunDir+"\\keymap.ini","w");
fprintf(f,"[KeyTypes]\n");
POSITION lpos = list.GetHeadPosition();
while (lpos)
{
CString str = list.GetNext(lpos);
fprintf(f,"%s\n",str);
}
fclose(f);
return 0;
}
int CContentTrackApp::ReadPropFile()
{
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//
CString ini_file = m_strRunDir+"\\"+"keymap.ini";
/*Check_Pointer(Stuff::FileStreamManager::Instance);
Stuff::FileStream *file_stream = Stuff::FileStream::MakeFileStream();
Check_Object(file_stream);
file_stream->Open(ini_file);
if (!file_stream->IsFileOpened())
{
return -1;
}
*/
NotationFile notefile(ini_file);
if (notefile.IsEmpty())
{
// file does not exist
//assert(false);
return -1;
}
NotationFile::PageIterator *pages = notefile.MakePageIterator();
Check_Object(pages);
Page *page = notefile.FindPage("KeyTypes");
if (page)
{
Check_Object(page);
Page::NoteIterator *entries = page->MakeNoteIterator();
Check_Object(entries);
Note *entry;
// Enumerate the entries in the section
while ((entry = entries->ReadAndNext()) != NULL)
{
Check_Object(entry);
const char *pKeyName = (char *)entry->GetName();
const char *pValueName;
entry->GetEntry(&pValueName);
//g_mapKeyType[pKeyName] = (void *)atoi(pValueName);
POSITION p = g_StringMap.Find(pKeyName);
g_StringMap.SetValue(p,atoi(pValueName));
}
Check_Object(entries);
delete entries;
}
Check_Object(pages);
delete pages;
/* CStringList list;
g_StringMap.MakeList(list);
FILE *f = fopen("c:\\listout.txt","w");
POSITION lpos = list.GetHeadPosition();
while (lpos)
{
CString str = list.GetNext(lpos);
fprintf(f,"%s\n",str);
}
fclose(f);*/
g_stringmem = 0;
DWORD memcount = g_StringMap.CountMem();
//DWORD memcount1 = sizeof(g_mapKeyType);
return 0;
}
int IdentifyFileType(CString path)
{
int iKeyType = KEYTYPE_UNKNOWN;
// Is this a database file?
{
DWORD tag = 0;
FileStream::IsRedirected = false;
HGOSFILE file;
gos_OpenFile(&file,path,READONLY);
if (file)
{
gos_ReadFile(file,&tag,sizeof(tag));
gos_CloseFile(file);
}
switch (tag)
{
case 'DBV#':
{
iKeyType = KEYTYPE_RESOURCE;
break;
}
case 'ERF#':
{
iKeyType = KEYTYPE_ERF;
break;
}
case 'GFX#':
{
//TODO: Note this is a .effects file
break;
}
case 'OBB#':
{
iKeyType = KEYTYPE_OBB;
break;
}
default:
{
switch (char(tag))
{
case '!':
case '[':
case '/':
{
iKeyType = KEYTYPE_NOTE;
break;
}
default:
{
// Still don't know what kind, get it from the extension of the filename
char dir[MAX_PATH],drive[MAX_PATH],fname[MAX_PATH],ext[MAX_PATH];
_splitpath(path,dir,drive,fname,ext);
if (strnicmp(ext,".bsp",4)==0)
{
iKeyType = KEYTYPE_BSP;
}
else
if (strnicmp(ext,".fgd",4)==0)
{
iKeyType = KEYTYPE_FGD;
}
else
if (strnicmp(ext,".lights",7)==0)
{
iKeyType = KEYTYPE_NOTE;
}
else
{
// I REALLY can't tell what kind of file this is
int x=1;
}
}
}
}
}
}
return iKeyType;
}
CStringMap::MAPNODE::MAPNODE()
{
szName = NULL;
pParent = pLeft = pRight = NULL;
parentshare = 0;
value = 0;
}
CStringMap::MAPNODE::~MAPNODE()
{
if (szName)
delete szName;
if (pLeft)
delete pLeft;
if (pRight)
delete pRight;
}
CString CStringMap::MAPNODE::GetName()
{
CString name(szName);
MAPNODE *pNode = this;
while (pNode)
{
MAPNODE *pParentNode = pNode->pParent;
if (pNode->parentshare && pParentNode)
{
CString parentname = pParentNode->szName;
parentname = parentname.Left(pNode->parentshare);
name = parentname+name;
}
pNode = pParentNode;
}
return name;
}
CStringMap::CStringMap()
{
m_pMisc = NULL;
for (int x=0;x<26;x++)
m_arrRoots[x] = NULL;
}
CStringMap::~CStringMap()
{
for (int x=0;x<26;x++)
{
if (m_arrRoots[x])
delete m_arrRoots[x];
m_arrRoots[x] = NULL;
}
if (m_pMisc)
delete m_pMisc;
m_pMisc = NULL;
}
// NOTE: 0x5f mask makes the ascii character uppercase
POSITION CStringMap::Find(const char *szInput)
{
// make the string uppercase
char *sz = (char *)szInput;
while (*sz)
{
char c = *sz;
if ((c>='a')&&(c<='z'))
*sz &= 0x5f;
++sz;
}
BYTE index = (*szInput)-'A';
if (index<26)
{
// szInput++;
MAPNODE *pNode = m_arrRoots[index];
if (pNode)
{
POSITION pos = (POSITION)_Find(szInput,pNode,NULL,0);
return pos;
}
else
{
m_arrRoots[index] = pNode = new MAPNODE;
pNode->szName = strdup(szInput);
return (POSITION)pNode;
}
}
if (m_pMisc)
{
POSITION pos = (POSITION)_Find(szInput,m_pMisc,m_pMisc,0);
return pos;
}
else
{
m_pMisc = new MAPNODE;
m_pMisc->szName = strdup(szInput);
return (POSITION)m_pMisc;
}
return NULL;
}
CStringMap::MAPNODE *CStringMap::_Find(const char *szInput,CStringMap::MAPNODE *pNode,CStringMap::MAPNODE *pParent,int parentdist)
{
char *name = pNode->szName;
Check_Pointer(name);
int share = 0;
if ((pNode->pParent == pParent)&&(pNode->parentshare == parentdist))
{
// The search node has the same parent as the new node, so we can share text
while (*szInput || *name)
{
if (*szInput == *name)
{
++share;
pParent = pNode;
++name;
++szInput;
}
else
{
break;
}
}
}
if (*szInput || *name || (0 == share))
{
//We're not sharing any of the current pNode so just pass the new node down the tree, with old parent
if (0 == share)
share = parentdist;
MAPNODE *pFind = NULL;
if (*szInput < *name)
{
if (pNode->pLeft)
{
pFind = _Find(szInput,pNode->pLeft,pParent,share);
}
else
{
pFind = pNode->pLeft = new MAPNODE;
pFind->szName = strdup(szInput);
pFind->pParent = pParent;
pFind->parentshare = share;
}
}
else
{
if (pNode->pRight)
{
pFind = _Find(szInput,pNode->pRight,pParent,share);
}
else
{
pFind = pNode->pRight = new MAPNODE;
pFind->szName = strdup(szInput);
pFind->pParent = pParent;
pFind->parentshare = share;
}
}
return pFind;
}
// What if there are more character in name?
if (*name)
{
Verify(false);
}
return pNode;
}
POSITION CStringMap::Exists(const char *szInput)
{
// make the string uppercase
char *sz = (char *)szInput;
while (*sz)
{
char c = *sz;
if ((c>='a')&&(c<='z'))
*sz &= 0x5f;
++sz;
}
MAPNODE *pNode = NULL;
MAPNODE *pParent = NULL;
BYTE share = 0;
BYTE index = (*szInput)-'A';
if (index<26)
{
pNode = m_arrRoots[index];
// szInput++;
}
else
{
pNode = m_pMisc;
}
char *name = (char *)szInput;
bool bFound = false;
while (!bFound)
{
if (NULL == pNode)
return NULL;
char *szNode = pNode->szName;
Check_Pointer(szNode);
BYTE newshare = 0;
MAPNODE *pNewParent = NULL;
if ((pNode->pParent == pParent)&&(pNode->parentshare == share))
{
while (*name || *szNode)
{
if (*name == *szNode)
{
++newshare;
pNewParent = pNode;
++name;
++szNode;
}
else
{
break;
}
}
}
// if (NULL == pParent)
// pParent = pNode;
if (newshare)
share = newshare;
if (0 == *name)
{
if (0 == *szNode)
{
if (0==share)
return (POSITION)pNode;
else
{
if (pNode->pParent == pParent)
return (POSITION)pNode;
else
{
int x=1;
}
}
}
}
if (!bFound&&(*name || *szNode || (0 == newshare)))
{
if (*name < *szNode)
{
pNode = pNode->pLeft;
}
else
{
pNode = pNode->pRight;
}
}
if (pNewParent)
pParent = pNewParent;
}
return (POSITION)pNode;
}
void CStringMap::SetValue(POSITION pos,BYTE value)
{
MAPNODE *pNode = (MAPNODE *)pos;
if (pNode)
{
pNode->value = value;
}
}
int CStringMap::MakeList(CStringList &list)
{
int count = 0;
for (int x=0;x<26;x++)
{
MAPNODE *pNode = m_arrRoots[x];
count += _MakeList(list,pNode);
}
count += _MakeList(list,m_pMisc);
return count;
}
int CStringMap::MakeList(CPtrList &list)
{
int count = 0;
for (int x=0;x<26;x++)
{
MAPNODE *pNode = m_arrRoots[x];
count += _MakeList(list,pNode);
}
count += _MakeList(list,m_pMisc);
return count;
}
int CStringMap::_MakeList(CStringList &list,CStringMap::MAPNODE *pNode)
{
int count = 0;
if (pNode)
{
count++;
CString name = pNode->GetName();
CString name1;
name1.Format("%s=%d",name,pNode->value);
list.AddTail(name1);
count += _MakeList(list,pNode->pLeft);
count += _MakeList(list,pNode->pRight);
}
return count;
}
int CStringMap::_MakeList(CPtrList &list,CStringMap::MAPNODE *pNode)
{
int count = 0;
if (pNode)
{
count++;
list.AddTail((LPVOID)pNode);
count += _MakeList(list,pNode->pLeft);
count += _MakeList(list,pNode->pRight);
}
return count;
}
DWORD CStringMap::NodeMem(CStringMap::MAPNODE *pNode)
{
DWORD count = 0;
if (pNode)
{
count += sizeof(*pNode);
DWORD strmem = strlen(pNode->szName);
count += strmem;
g_stringmem += strmem;
count += NodeMem(pNode->pLeft);
count += NodeMem(pNode->pRight);
}
return count;
}
DWORD CStringMap::CountMem()
{
DWORD count = 0;
count += sizeof(*this);
for (int x=0;x<26;x++)
{
count += NodeMem(m_arrRoots[x]);
}
count += NodeMem(m_pMisc);
return count;
}
BYTE CStringMap::GetValue(POSITION pos)
{
if (pos)
return ((MAPNODE *)pos)->value;
return 0;
}
CString CStringMap::GetName(POSITION pos)
{
MAPNODE *pNode = (MAPNODE *)pos;
Check_Pointer(pNode);
MAPNODE *pParent = pNode;
while (pParent->pParent)
pParent = pParent->pParent;
CString str1="";
/* for (int x=0;x<26;x++)
{
if (pParent == m_arrRoots[x])
str1.Format("%c",x+'A');
}*/
CString str2 = str1+pNode->GetName();
return str2;
}
@@ -0,0 +1,366 @@
# Microsoft Developer Studio Project File - Name="ContentTrack" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=ContentTrack - Win32 Profile
!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 "ContentTrack.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 "ContentTrack.mak" CFG="ContentTrack - Win32 Profile"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "ContentTrack - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "ContentTrack - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE "ContentTrack - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "ContentTrack - 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 "Release"
# 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 /I "..\..\Libraries\stlport" /I "..\..\Libraries" /I "..\..\Code\Mw4" /I "..\..\Code" /I "..\..\..\CoreTech\Libraries" /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 Ws2_32.lib /nologo /subsystem:windows /machine:I386
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=attrib -r ..\..\Binaries\Tools\Release\ContentTrack.exe copy Release\ContentTrack.exe ..\..\Binaries\Tools\Release\ContentTrack.exe attrib -r ..\..\Binaries\Tools\Release\keymap.ini copy keymap.ini ..\..\Binaries\Tools\Release\keymap.ini
# End Special Build Tool
!ELSEIF "$(CFG)" == "ContentTrack - 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 "Debug"
# 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 /G6 /Zp4 /MDd /W4 /Gm /GR /Zi /Od /I "..\..\Libraries\stlport" /I "..\..\Libraries" /I "..\..\Code\Mw4" /I "..\..\Code" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "MULTI_PLAYER" /D "USE_PROTOTYPES" /D "STRICT" /D TEST_CLASS=50 /D "_ARMOR" /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 Ws2_32.lib /nologo /subsystem:windows /profile /debug /machine:I386
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=attrib -r ..\..\Binaries\Tools\Debug\ContentTrack.exe copy Debug\ContentTrack.exe ..\..\Binaries\Tools\Debug\ContentTrack.exe attrib -r ..\..\Binaries\Tools\Debug\keymap.ini copy keymap.ini ..\..\Binaries\Tools\Debug\keymap.ini
# End Special Build Tool
!ELSEIF "$(CFG)" == "ContentTrack - Win32 Profile"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "ContentTrack___Win32_Profile"
# PROP BASE Intermediate_Dir "ContentTrack___Win32_Profile"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Profile"
# PROP Intermediate_Dir "Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /Zp4 /MDd /W4 /Gm /GR /Zi /Od /I "..\..\Libraries\stlport" /I "..\..\Libraries" /I "..\..\Code\Mw4" /I "..\..\Code" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_AFXDLL" /D "MULTI_PLAYER" /D "USE_PROTOTYPES" /D "STRICT" /D TEST_CLASS=50 /D "_ARMOR" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /G6 /Zp4 /MD /W3 /GR /Zi /Od /I "..\..\Libraries\stlport" /I "..\..\Libraries" /I "..\..\Code\Mw4" /I "..\..\Code" /I "..\..\..\CoreTech\Libraries" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /D "MFC" /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 Ws2_32.lib /nologo /subsystem:windows /profile /debug /machine:I386
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Cmds=attrib -r ..\..\Binaries\Tools\Profile\ContentTrack.exe copy Profile\ContentTrack.exe ..\..\Binaries\Tools\Profile\ContentTrack.exe attrib -r ..\..\Binaries\Tools\Profile\keymap.ini copy keymap.ini ..\..\Binaries\Tools\Profile\keymap.ini
# End Special Build Tool
!ENDIF
# Begin Target
# Name "ContentTrack - Win32 Release"
# Name "ContentTrack - Win32 Debug"
# Name "ContentTrack - Win32 Profile"
# 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=.\ChildWndThread.cpp
# End Source File
# Begin Source File
SOURCE=.\ContentTrack.cpp
# End Source File
# Begin Source File
SOURCE=.\ContentTrack.rc
# End Source File
# Begin Source File
SOURCE=.\ContentTrackDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\ContentTrackView.cpp
# End Source File
# Begin Source File
SOURCE=.\DialogPasteRename.cpp
# End Source File
# Begin Source File
SOURCE=.\DirectoryView.cpp
# End Source File
# Begin Source File
SOURCE=.\DlgCreateMap.cpp
# End Source File
# Begin Source File
SOURCE=.\EditKeyType.cpp
# End Source File
# Begin Source File
SOURCE=.\FindDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\FindView.cpp
# End Source File
# Begin Source File
SOURCE=.\KeyTypeDlg.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\MissingFilesView.cpp
# End Source File
# Begin Source File
SOURCE=.\NodeDataValueFileDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\NodeDataValueFileView.cpp
# End Source File
# Begin Source File
SOURCE=.\NodeObject.cpp
# End Source File
# Begin Source File
SOURCE=.\NodeObjectReferenceView1.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\UnusedFilesDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\UnusedFilesView.cpp
# End Source File
# Begin Source File
SOURCE=.\WizCopyMission.cpp
# End Source File
# Begin Source File
SOURCE=.\WizPageMission.cpp
# End Source File
# Begin Source File
SOURCE=.\WizPageProject.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=..\..\Code\Buildnum\buildnum.h
# End Source File
# Begin Source File
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
SOURCE=.\ChildWndThread.h
# End Source File
# Begin Source File
SOURCE=.\ContentTrack.h
# End Source File
# Begin Source File
SOURCE=.\ContentTrackDoc.h
# End Source File
# Begin Source File
SOURCE=.\ContentTrackView.h
# End Source File
# Begin Source File
SOURCE=.\DialogPasteRename.h
# End Source File
# Begin Source File
SOURCE=.\DirectoryView.h
# End Source File
# Begin Source File
SOURCE=.\DlgCreateMap.h
# End Source File
# Begin Source File
SOURCE=.\EditKeyType.h
# End Source File
# Begin Source File
SOURCE=.\FindDlg.h
# End Source File
# Begin Source File
SOURCE=.\FindView.h
# End Source File
# Begin Source File
SOURCE=.\KeyTypeDlg.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\MissingFilesView.h
# End Source File
# Begin Source File
SOURCE=.\NodeDataValueFileDoc.h
# End Source File
# Begin Source File
SOURCE=.\NodeDataValueFileView.h
# End Source File
# Begin Source File
SOURCE=.\NodeObject.h
# End Source File
# Begin Source File
SOURCE=.\NodeObjectReferenceView1.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\UnusedFilesDoc.h
# End Source File
# Begin Source File
SOURCE=.\UnusedFilesView.h
# End Source File
# Begin Source File
SOURCE=.\WizCopyMission.h
# End Source File
# Begin Source File
SOURCE=.\WizPageMission.h
# End Source File
# Begin Source File
SOURCE=.\WizPageProject.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\ContentTrack.ico
# End Source File
# Begin Source File
SOURCE=.\res\ContentTrack.rc2
# End Source File
# Begin Source File
SOURCE=.\res\ContentTrackDoc.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
@@ -0,0 +1,188 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Adept"=..\..\Libraries\Adept\Adept.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Compost"=..\..\Libraries\Compost\Compost.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ContentTrack"=.\ContentTrack.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Compost
End Project Dependency
Begin Project Dependency
Project_Dep_Name DLLPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name ElementRenderer
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name gosFX
End Project Dependency
Begin Project Dependency
Project_Dep_Name MLR
End Project Dependency
Begin Project Dependency
Project_Dep_Name Stuff
End Project Dependency
Begin Project Dependency
Project_Dep_Name Adept
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "DLLPlatform"=..\..\..\CoreTech\Libraries\DLLPlatform\DLLPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ElementProxies"=..\..\Libraries\ElementProxies\ElementProxies.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "ElementRenderer"=..\..\Libraries\ElementRenderer\ElementRenderer.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GOSScript"=..\..\..\CoreTech\Libraries\GOSScript\GOSScript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GameOS"=..\..\..\CoreTech\Libraries\GameOS\GameOS.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MLR"=..\..\Libraries\MLR\MLR.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Proxies"=..\..\Libraries\Proxies\Proxies.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Stuff"=..\..\Libraries\Stuff\Stuff.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "gosFX"=..\..\Libraries\gosFX\gosFX.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,93 @@
// ContentTrack.h : main header file for the CONTENTTRACK application
//
#if !defined(AFX_CONTENTTRACK_H__380504FE_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_CONTENTTRACK_H__380504FE_782B_11D3_9C1F_00609712FBEF__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
#include "nodeobject.h"
/////////////////////////////////////////////////////////////////////////////
// CContentTrackApp:
// See ContentTrack.cpp for the implementation of this class
//
class CStringMap// : public CObject
{
private:
struct MAPNODE
{
MAPNODE();
~MAPNODE();
CString GetName();
char *szName;
MAPNODE *pParent,*pLeft,*pRight;
BYTE parentshare;
BYTE value;
};
MAPNODE *m_arrRoots[26];
MAPNODE *m_pMisc;
MAPNODE *_Find(const char *,MAPNODE *,MAPNODE *,int);
int _MakeList(CStringList &,MAPNODE *);
int _MakeList(CPtrList &,MAPNODE *);
DWORD NodeMem(MAPNODE *);
protected:
public:
CStringMap();
~CStringMap();
POSITION Find(const char *);
POSITION Exists(const char *);
void SetValue(POSITION,BYTE);
BYTE GetValue(POSITION);
int MakeList(CStringList &);
int MakeList(CPtrList &);
CString GetName(POSITION);
DWORD CountMem();
};
class CContentTrackApp : public CWinApp
{
protected:
public:
CContentTrackApp();
int UpdateKeys();
int WritePropFile();
int ReadPropFile();
CMapWordToOb m_mapTemplates;
CNodeObject *m_pNodeSelected;
CString m_strRunDir;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CContentTrackApp)
public:
virtual BOOL InitInstance();
virtual int ExitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CContentTrackApp)
afx_msg void OnAppAbout();
afx_msg void OnFileOpen();
afx_msg void OnEditKeytype();
afx_msg void OnFileNew();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CONTENTTRACK_H__380504FE_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,638 @@
//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\\ContentTrack.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\\ContentTrack.ico"
IDR_CONTENTYPE ICON DISCARDABLE "res\\ContentTrackDoc.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 "&New\tCtrl+N", ID_FILE_NEW
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 "Edit Key Types", ID_EDIT_KEYTYPE
MENUITEM SEPARATOR
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "Unused Files", ID_UNUSEDFILES
MENUITEM "Missing Files", ID_MISSINGFILES
END
POPUP "&Help"
BEGIN
MENUITEM "&About ContentTrack...", ID_APP_ABOUT
END
END
IDR_CONTENTYPE MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Close", ID_FILE_CLOSE
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &As...", ID_FILE_SAVE_AS
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 "Paste-Rename...", ID_EDIT_PASTE_RENAME
MENUITEM SEPARATOR
MENUITEM "Edit Key Types...", ID_EDIT_KEYTYPE
MENUITEM SEPARATOR
MENUITEM "Expand All", ID_EXPANDALL
END
POPUP "Project"
BEGIN
MENUITEM "Add Root File...", ID_ADDROOT
END
POPUP "&View"
BEGIN
MENUITEM "&Find...", ID_FIND
MENUITEM "Edit Selected Key...", ID_VIEW_EDITKEY
MENUITEM SEPARATOR
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
MENUITEM "Unused Files", ID_UNUSEDFILES
MENUITEM "Missing Files", ID_MISSINGFILES
MENUITEM "View References", ID_REFERENCES
MENUITEM "View Directory", ID_DIRECTORY
END
POPUP "Wizards"
BEGIN
MENUITEM "Copy Mission...", ID_WIZ_COPYMISSION
MENUITEM "Copy Mech...", ID_WIZ_COPYMECH
MENUITEM "Create Map...", ID_WIZ_CREATEMAP
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 ContentTrack...", 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 ContentTrack"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "ContentTrack Version 1.0",IDC_STATIC,40,10,119,8,
SS_NOPREFIX
LTEXT "Copyright (C) 1999",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_DIALOG_KEYTYPE DIALOG DISCARDABLE 0, 0, 350, 197
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Key Types"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Close",IDOK,293,176,50,14
PUSHBUTTON "Cancel",IDCANCEL,293,139,50,14,NOT WS_VISIBLE |
WS_DISABLED
PUSHBUTTON "Modify",IDC_MODIFY,293,7,50,14
PUSHBUTTON "Add",IDC_ADD,293,26,50,14
PUSHBUTTON "Remove",IDC_REMOVE,293,42,50,14
CONTROL "List1",IDC_LIST_TYPES,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_SORTASCENDING | WS_BORDER |
WS_TABSTOP,7,7,275,183
END
IDD_DIALOG_EDITKEYTYPE DIALOG DISCARDABLE 0, 0, 250, 125
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Edit Key Type"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,193,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,193,24,50,14
EDITTEXT IDC_EDIT_KEYTYPE,7,7,175,14,ES_AUTOHSCROLL | ES_READONLY
COMBOBOX IDC_COMBO_KEYTYPE,7,25,175,93,CBS_DROPDOWNLIST |
WS_VSCROLL | WS_TABSTOP
END
IDD_FIND DIALOG DISCARDABLE 0, 0, 219, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Find"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "Search",IDOK,160,47,50,14
PUSHBUTTON "Cancel",IDCANCEL,160,74,50,14
EDITTEXT IDC_EDIT1,7,18,135,14,ES_AUTOHSCROLL
LTEXT "Text to find:",IDC_STATIC,7,7,38,8
CONTROL "Keys",IDC_CHECK_KEYS,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,160,18,31,10
CONTROL "Values",IDC_CHECK_VALUE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,160,28,37,10
LISTBOX IDC_LIST_KEYTYPE,7,48,135,40,LBS_NOINTEGRALHEIGHT |
LBS_EXTENDEDSEL | WS_VSCROLL | WS_TABSTOP
LTEXT "Key types to search:",IDC_STATIC,7,35,65,8
LTEXT "Fields to search:",IDC_STATIC,160,7,52,8
END
IDD_WIZ_SELECTPROJECT DIALOG DISCARDABLE 0, 0, 274, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Destination"
FONT 8, "MS Sans Serif"
BEGIN
LISTBOX IDC_LISTPROJECT,7,18,100,70,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "New Project...",IDC_NEWPROJECT,115,20,50,14
PUSHBUTTON "Open Project...",IDC_OPENPROJECT,115,40,50,14
LISTBOX IDC_LIST_COPYDIR,180,20,87,68,LBS_SORT |
LBS_NOINTEGRALHEIGHT | LBS_EXTENDEDSEL | WS_VSCROLL |
WS_TABSTOP
LTEXT "Select Directories to copy:",IDC_STATIC,180,7,84,8
END
IDD_WIZ_SELECTMISSION DIALOG DISCARDABLE 0, 0, 224, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Source: Select a mission"
FONT 8, "MS Sans Serif"
BEGIN
LISTBOX IDC_LISTMISSION,7,7,118,81,LBS_SORT |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
CONTROL "Rename Mission",IDC_CHECK_RENAME,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,130,7,68,10
EDITTEXT IDC_EDIT_NAME,130,20,80,14,ES_AUTOHSCROLL
END
IDD_PASTE_RENAME DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Paste and Rename"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,74,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14
EDITTEXT IDC_EDIT_OLD,60,7,100,14,ES_AUTOHSCROLL
LTEXT "Find What:",IDC_STATIC,7,7,36,8
LTEXT "Replace With:",IDC_STATIC,7,30,46,8
EDITTEXT IDC_EDIT_NEW,60,30,100,14,ES_AUTOHSCROLL
END
IDD_WIZ_CREATEMAP DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Create Map Properties"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14
EDITTEXT IDC_EDIT1,7,15,100,14,ES_AUTOHSCROLL
LTEXT "New Map Name:",IDC_STATIC,7,7,54,8
LTEXT "Map Size:",IDC_STATIC,7,35,32,8
CONTROL "1x1",IDC_RADIO1,"Button",BS_AUTORADIOBUTTON,7,45,27,10
CONTROL "2x2",IDC_RADIO2,"Button",BS_AUTORADIOBUTTON,7,55,27,10
CONTROL "4x4",IDC_RADIO3,"Button",BS_AUTORADIOBUTTON,7,65,27,10
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 "CompanyName", "\0"
VALUE "FileDescription", "ContentTrack MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "ContentTrack\0"
VALUE "LegalCopyright", "Copyright (C) 1999\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "ContentTrack.EXE\0"
VALUE "ProductName", "ContentTrack Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\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
IDD_DIALOG_KEYTYPE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 343
TOPMARGIN, 7
BOTTOMMARGIN, 190
END
IDD_DIALOG_EDITKEYTYPE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 243
TOPMARGIN, 7
BOTTOMMARGIN, 118
END
IDD_FIND, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 212
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_WIZ_SELECTPROJECT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 267
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_WIZ_SELECTMISSION, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 217
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_PASTE_RENAME, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_WIZ_CREATEMAP, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "ContentTrack"
IDR_CONTENTYPE "\nConten\nConten\n\n\nContentTrack.Document\nConten Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "ContentTrack"
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
ID_EDIT_KEYTYPE "Edit Key Types"
ID_UNUSEDFILES "View Unused Files"
ID_EXPANDALL "Expand All Children"
ID_MISSINGFILES "View the missing files"
ID_FIND "Find Keys and values"
ID_REFERENCES "View References to selected item"
ID_ADDROOT "Add a data file root to the project workspace..."
ID_WIZ_COPYMAP "Copies a Map accross projects"
ID_WIZ_COPYMISSION "Copies a mission and it's map, and updates resources.build and editor.contents."
ID_WIZ_COPYMECH "Copies a mech and updates resources.build and editor.contents."
ID_EDIT_PASTE_RENAME "Paste and rename a tree."
ID_VIEW_EDITKEY "Edit the Key Type of the selected node..."
END
STRINGTABLE DISCARDABLE
BEGIN
ID_DIRECTORY "View Contents Directory Tree"
ID_CREATEMAP "Create A New Map..."
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\ContentTrack.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,92 @@
// ContentTrackDoc.cpp : implementation of the CContentTrackDoc class
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "ContentTrackDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CContentTrackDoc
IMPLEMENT_DYNCREATE(CContentTrackDoc, CDocument)
BEGIN_MESSAGE_MAP(CContentTrackDoc, CDocument)
//{{AFX_MSG_MAP(CContentTrackDoc)
// 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()
/////////////////////////////////////////////////////////////////////////////
// CContentTrackDoc construction/destruction
CContentTrackDoc::CContentTrackDoc()
{
// TODO: add one-time construction code here
}
CContentTrackDoc::~CContentTrackDoc()
{
}
BOOL CContentTrackDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackDoc serialization
void CContentTrackDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackDoc diagnostics
#ifdef _DEBUG
void CContentTrackDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CContentTrackDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CContentTrackDoc commands
BOOL CContentTrackDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
return TRUE;
}
@@ -0,0 +1,58 @@
// ContentTrackDoc.h : interface of the CContentTrackDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CONTENTTRACKDOC_H__38050506_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_CONTENTTRACKDOC_H__38050506_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CContentTrackDoc : public CDocument
{
protected: // create from serialization only
CContentTrackDoc();
DECLARE_DYNCREATE(CContentTrackDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CContentTrackDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CContentTrackDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CContentTrackDoc)
// 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_CONTENTTRACKDOC_H__38050506_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,104 @@
// ContentTrackView.cpp : implementation of the CContentTrackView class
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "ContentTrackDoc.h"
#include "ContentTrackView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView
IMPLEMENT_DYNCREATE(CContentTrackView, CView)
BEGIN_MESSAGE_MAP(CContentTrackView, CView)
//{{AFX_MSG_MAP(CContentTrackView)
// 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 printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView construction/destruction
CContentTrackView::CContentTrackView()
{
// TODO: add construction code here
}
CContentTrackView::~CContentTrackView()
{
}
BOOL CContentTrackView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView drawing
void CContentTrackView::OnDraw(CDC* pDC)
{
// CContentTrackDoc* pDoc = GetDocument();
// ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView printing
BOOL CContentTrackView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CContentTrackView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CContentTrackView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView diagnostics
#ifdef _DEBUG
void CContentTrackView::AssertValid() const
{
CView::AssertValid();
}
void CContentTrackView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CContentTrackDoc* CContentTrackView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CContentTrackDoc)));
return (CContentTrackDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CContentTrackView message handlers
@@ -0,0 +1,67 @@
// ContentTrackView.h : interface of the CContentTrackView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CONTENTTRACKVIEW_H__38050508_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_CONTENTTRACKVIEW_H__38050508_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CContentTrackView : public CView
{
protected: // create from serialization only
CContentTrackView();
DECLARE_DYNCREATE(CContentTrackView)
// Attributes
public:
CContentTrackDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CContentTrackView)
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);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CContentTrackView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CContentTrackView)
// 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()
};
#ifndef _DEBUG // debug version in ContentTrackView.cpp
inline CContentTrackDoc* CContentTrackView::GetDocument()
{ return (CContentTrackDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CONTENTTRACKVIEW_H__38050508_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,50 @@
// DialogPasteRename.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "DialogPasteRename.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogPasteRename dialog
CDialogPasteRename::CDialogPasteRename(CWnd* pParent /*=NULL*/)
: CDialog(CDialogPasteRename::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogPasteRename)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDialogPasteRename::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogPasteRename)
DDX_Control(pDX, IDC_EDIT_NEW, m_ctrlNew);
DDX_Control(pDX, IDC_EDIT_OLD, m_ctrlOld);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogPasteRename, CDialog)
//{{AFX_MSG_MAP(CDialogPasteRename)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogPasteRename message handlers
void CDialogPasteRename::OnOK()
{
this->m_ctrlOld.GetWindowText(m_strOld);
this->m_ctrlNew.GetWindowText(m_strNew);
CDialog::OnOK();
}
@@ -0,0 +1,49 @@
#if !defined(AFX_DIALOGPASTERENAME_H__E431AB32_9F7C_4ECA_8DB5_1F326FFE9C0A__INCLUDED_)
#define AFX_DIALOGPASTERENAME_H__E431AB32_9F7C_4ECA_8DB5_1F326FFE9C0A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DialogPasteRename.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDialogPasteRename dialog
class CDialogPasteRename : public CDialog
{
// Construction
public:
CString m_strNew;
CString m_strOld;
CDialogPasteRename(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDialogPasteRename)
enum { IDD = IDD_PASTE_RENAME };
CEdit m_ctrlNew;
CEdit m_ctrlOld;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogPasteRename)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDialogPasteRename)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOGPASTERENAME_H__E431AB32_9F7C_4ECA_8DB5_1F326FFE9C0A__INCLUDED_)
@@ -0,0 +1,271 @@
// DirectoryView.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "DirectoryView.h"
#include "NodeDataValueFileDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDirectoryView
IMPLEMENT_DYNCREATE(CDirectoryView, CTreeView)
CDirectoryView::CDirectoryView()
{
}
CDirectoryView::~CDirectoryView()
{
}
BEGIN_MESSAGE_MAP(CDirectoryView, CTreeView)
//{{AFX_MSG_MAP(CDirectoryView)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDirectoryView drawing
void CDirectoryView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CDirectoryView diagnostics
#ifdef _DEBUG
void CDirectoryView::AssertValid() const
{
CTreeView::AssertValid();
}
void CDirectoryView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CDirectoryView message handlers
void CDirectoryView::OnInitialUpdate()
{
//CTreeCtrl *pCtrl = &GetTreeCtrl();
CTreeView::OnInitialUpdate();
//CTreeView::OnInitialUpdate();
}
void CDirectoryView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
if (pSender)
{
// This was sent from the other view - select the item
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
if (pDoc->m_pActiveChild)
{
CNodeObject *pNode = pDoc->m_pActiveChild;
while (pNode && !pNode->IsFile())
{
pNode = pNode->GetParentNode();
}
if (pNode)
{
CTreeCtrl *pCtrl = &GetTreeCtrl();
CNodeDisk *pDisk = ((CNodeDataValueFile *)pNode)->GetNodeDisk();
HTREEITEM hItem;
if (pDisk->m_mapViewHandles.Lookup((LPVOID)pCtrl,(VOID *&)hItem))
{
pCtrl->EnsureVisible(hItem);
pCtrl->SelectItem(hItem);
}
}
}
}
}
else
{
// Update the tree - see that Files are bolded, file references are added, etc
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
CNodeDisk *pNode = pDoc->GetRootNode();
InsertNode(pNode,NULL);
}
}
}
int CDirectoryView::InsertNode(CNodeObject *pNode,HTREEITEM hParent)
{
int count = 0;
if (pNode)
{
if ((pNode->GetClassID() == CLASS_CNODEDISKDIRECTORY) || (pNode->GetClassID() == CLASS_CNODEDISKFILE))
{
count++;
char buf[MAX_PATH];
pNode->GetName(buf,MAX_PATH);
CTreeCtrl *pCtrl = &GetTreeCtrl();
CNodeDisk *pDisk = (CNodeDisk *)pNode;
HTREEITEM hChild;
if (pDisk->m_mapViewHandles.Lookup(pCtrl,(VOID *&)hChild))
{
// Update
// - Remove the children of hChild
if (pNode->GetClassID() == CLASS_CNODEDISKFILE)
{
CNodeObject *pObj = (CNodeObject *)pCtrl->GetItemData(hChild);
VERIFY(pObj == pNode);
HTREEITEM hItem = pCtrl->GetChildItem(hChild);
while (hItem)
{
HTREEITEM hNext = pCtrl->GetNextItem(hItem,TVGN_NEXT);
pCtrl->DeleteItem(hItem);
hItem = hNext;
}
}
}
else
{
// Insert
hChild = pCtrl->InsertItem(buf,hParent);
pCtrl->SetItemData(hChild,(DWORD)pNode);
pNode->m_mapViewHandles[pCtrl] = hChild;
if (pNode->GetClassID() == CLASS_CNODEDISKFILE)
{
pCtrl->SetItemState(hChild,TVIS_BOLD,TVIS_BOLD);
}
}
// Add the file's references as children
if (pNode->GetClassID() == CLASS_CNODEDISKFILE)
{
POSITION pos = pNode->GetFirstReference();
while (pos)
{
CNodeObject *pChild = pNode->GetNextReference(pos);
while (pChild && (!pChild->IsFile() ||(pChild->GetClassID() == CLASS_CNODEDATAVALUEFILEPROJECT)))
pChild = pChild->GetParentNode();
// Find the name of the node that loaded this file
CNodeObject *pChild1 = pChild;
if (pChild1)
{
do
{
pChild1 = pChild1->GetParentNode();
} while (pChild1 && !pChild1->IsFile());
}
if (pChild)
{
CNodeDisk *pRefDisk;
if (pChild1)
pRefDisk = ((CNodeDataValueFile *)pChild1)->GetNodeDisk();
else
pRefDisk = ((CNodeDataValueFile *)pChild)->GetNodeDisk();
HTREEITEM hRefChild = pCtrl->InsertItem(pRefDisk->GetPath(),hChild);
pCtrl->SetItemData(hRefChild,(DWORD)pChild);
count++;
}
}
}
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
count += InsertNode(pChild,hChild);
}
}
else
{
// This item is one of the file's references
}
}
return count;
}
void CDirectoryView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
if (pNMTreeView->itemNew.state & TVIS_SELECTED)
{
CNodeObject *pNode = (CNodeObject *)pNMTreeView->itemNew.lParam;
if (pNode)
{
if ((pNode->GetClassID() == CLASS_CNODEDISKDIRECTORY) || (pNode->GetClassID() == CLASS_CNODEDISKFILE))
{
}
else
{
GetDocument()->UpdateAllViews(this,(DWORD)pNode,NULL);
}
}
}
*pResult = 0;
}
BOOL CDirectoryView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | TVS_HASBUTTONS | TVS_LINESATROOT;
return CTreeView::PreCreateWindow(cs);
}
void CDirectoryView::OnDestroy()
{
CTreeView::OnDestroy();
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
CNodeDisk *pNode = pDoc->GetRootNode();
int count = DestroyNode(pNode);
}
}
int CDirectoryView::DestroyNode(CNodeObject *pNode)
{
int count = 0;
if (pNode)
{
if ((pNode->GetClassID() == CLASS_CNODEDISKDIRECTORY) || (pNode->GetClassID() == CLASS_CNODEDISKFILE))
{
count++;
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hChild;
if (pNode->m_mapViewHandles.Lookup(pCtrl,(VOID *&)hChild))
{
pNode->m_mapViewHandles.RemoveKey(pCtrl);
}
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
count += DestroyNode(pChild);
}
}
}
return count;
}
@@ -0,0 +1,60 @@
#if !defined(AFX_DIRECTORYVIEW_H__541F53B9_2989_4ABA_935A_68B11BD63AC8__INCLUDED_)
#define AFX_DIRECTORYVIEW_H__541F53B9_2989_4ABA_935A_68B11BD63AC8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DirectoryView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDirectoryView view
class CDirectoryView : public CTreeView
{
protected:
CDirectoryView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CDirectoryView)
// Attributes
public:
// Operations
public:
int InsertNode(CNodeObject *,HTREEITEM);
int DestroyNode(CNodeObject *);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDirectoryView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CDirectoryView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CDirectoryView)
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIRECTORYVIEW_H__541F53B9_2989_4ABA_935A_68B11BD63AC8__INCLUDED_)
@@ -0,0 +1,76 @@
// DlgCreateMap.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "DlgCreateMap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgCreateMap dialog
CDlgCreateMap::CDlgCreateMap(CWnd* pParent /*=NULL*/)
: CDialog(CDlgCreateMap::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCreateMap)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_iSize = 1;
}
void CDlgCreateMap::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCreateMap)
DDX_Control(pDX, IDC_EDIT1, m_ctrlEdit);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCreateMap, CDialog)
//{{AFX_MSG_MAP(CDlgCreateMap)
ON_BN_CLICKED(IDC_RADIO1, OnRadio1)
ON_BN_CLICKED(IDC_RADIO2, OnRadio2)
ON_BN_CLICKED(IDC_RADIO3, OnRadio3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgCreateMap message handlers
void CDlgCreateMap::OnOK()
{
CDialog::OnOK();
this->m_ctrlEdit.GetWindowText(m_strName);
}
void CDlgCreateMap::OnRadio1()
{
m_iSize = 1;
}
void CDlgCreateMap::OnRadio2()
{
m_iSize = 2;
}
void CDlgCreateMap::OnRadio3()
{
m_iSize = 4;
}
BOOL CDlgCreateMap::OnInitDialog()
{
CDialog::OnInitDialog();
CButton *bt = (CButton *)GetDlgItem(IDC_RADIO1);
bt->SetCheck(1);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -0,0 +1,52 @@
#if !defined(AFX_DLGCREATEMAP_H__6F4D8B5E_5294_47A2_80CF_6D16E6C2D4A1__INCLUDED_)
#define AFX_DLGCREATEMAP_H__6F4D8B5E_5294_47A2_80CF_6D16E6C2D4A1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgCreateMap.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgCreateMap dialog
class CDlgCreateMap : public CDialog
{
// Construction
public:
CDlgCreateMap(CWnd* pParent = NULL); // standard constructor
CString m_strName;
int m_iSize;
// Dialog Data
//{{AFX_DATA(CDlgCreateMap)
enum { IDD = IDD_WIZ_CREATEMAP };
CEdit m_ctrlEdit;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgCreateMap)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgCreateMap)
virtual void OnOK();
afx_msg void OnRadio1();
afx_msg void OnRadio2();
afx_msg void OnRadio3();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCREATEMAP_H__6F4D8B5E_5294_47A2_80CF_6D16E6C2D4A1__INCLUDED_)
@@ -0,0 +1,61 @@
// EditKeyType.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "EditKeyType.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CEditKeyType dialog
CEditKeyType::CEditKeyType(CWnd* pParent /*=NULL*/)
: CDialog(CEditKeyType::IDD, pParent)
{
//{{AFX_DATA_INIT(CEditKeyType)
m_editName = _T("");
//}}AFX_DATA_INIT
}
void CEditKeyType::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CEditKeyType)
DDX_Control(pDX, IDC_EDIT_KEYTYPE, m_editKeyType);
DDX_Control(pDX, IDC_COMBO_KEYTYPE, m_comboKeyType);
DDX_Text(pDX, IDC_EDIT_KEYTYPE, m_editName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CEditKeyType, CDialog)
//{{AFX_MSG_MAP(CEditKeyType)
ON_CBN_SELENDOK(IDC_COMBO_KEYTYPE, OnSelendokComboKeytype)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CEditKeyType message handlers
BOOL CEditKeyType::OnInitDialog()
{
CDialog::OnInitDialog();
for (int x=0;x<MAX_KEYTYPE;x++)
m_comboKeyType.AddString(NAME_KEYTYPE[x]);
m_comboKeyType.SetCurSel(this->m_iCurSel);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CEditKeyType::OnSelendokComboKeytype()
{
m_iCurSel = m_comboKeyType.GetCurSel();
}
@@ -0,0 +1,50 @@
#if !defined(AFX_EDITKEYTYPE_H__CB2C6068_790E_11D3_9C20_00609712FBEF__INCLUDED_)
#define AFX_EDITKEYTYPE_H__CB2C6068_790E_11D3_9C20_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// EditKeyType.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CEditKeyType dialog
class CEditKeyType : public CDialog
{
// Construction
public:
int m_iCurSel;
CEditKeyType(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CEditKeyType)
enum { IDD = IDD_DIALOG_EDITKEYTYPE };
CEdit m_editKeyType;
CComboBox m_comboKeyType;
CString m_editName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CEditKeyType)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CEditKeyType)
virtual BOOL OnInitDialog();
afx_msg void OnSelendokComboKeytype();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EDITKEYTYPE_H__CB2C6068_790E_11D3_9C20_00609712FBEF__INCLUDED_)
@@ -0,0 +1,70 @@
// FindDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "FindDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFindDlg dialog
CFindDlg::CFindDlg(CWnd* pParent /*=NULL*/)
: CDialog(CFindDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CFindDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CFindDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CFindDlg)
DDX_Control(pDX, IDC_LIST_KEYTYPE, m_listCtrlKeyType);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CFindDlg, CDialog)
//{{AFX_MSG_MAP(CFindDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFindDlg message handlers
BOOL CFindDlg::OnInitDialog()
{
CDialog::OnInitDialog();
for (int x=0;x<MAX_KEYTYPE;x++)
{
int index = this->m_listCtrlKeyType.InsertString(x,NAME_KEYTYPE[x]);
this->m_listCtrlKeyType.SetItemData(index,x);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CFindDlg::OnOK()
{
int count = this->m_listCtrlKeyType.GetSelCount();
int *items = new int(count);
this->m_listCtrlKeyType.GetSelItems(count,items);
for (int x=0;x<count;x++)
{
int index = this->m_listCtrlKeyType.GetItemData(items[x]);
m_listKeyType.AddTail((void *)index);
}
delete items;
CDialog::OnOK();
}
@@ -0,0 +1,48 @@
#if !defined(AFX_FINDDLG_H__4678B7C2_EFD6_4584_ABD0_0E8DCCD57448__INCLUDED_)
#define AFX_FINDDLG_H__4678B7C2_EFD6_4584_ABD0_0E8DCCD57448__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FindDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CFindDlg dialog
class CFindDlg : public CDialog
{
// Construction
public:
CFindDlg(CWnd* pParent = NULL); // standard constructor
CPtrList m_listKeyType;
// Dialog Data
//{{AFX_DATA(CFindDlg)
enum { IDD = IDD_FIND };
CListBox m_listCtrlKeyType;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFindDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CFindDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FINDDLG_H__4678B7C2_EFD6_4584_ABD0_0E8DCCD57448__INCLUDED_)
@@ -0,0 +1,153 @@
// FindView.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "mainfrm.h"
#include "FindView.h"
#include "finddlg.h"
#include "NodeDataValueFileDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CFindView
IMPLEMENT_DYNCREATE(CFindView, CListView)
CFindView::CFindView()
{
}
CFindView::~CFindView()
{
}
BEGIN_MESSAGE_MAP(CFindView, CListView)
//{{AFX_MSG_MAP(CFindView)
ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemchanged)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CFindView drawing
void CFindView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CFindView diagnostics
#ifdef _DEBUG
void CFindView::AssertValid() const
{
CListView::AssertValid();
}
void CFindView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CFindView message handlers
void CFindView::OnInitialUpdate()
{
CFindDlg dlg;
if (IDOK == dlg.DoModal())
{
m_listKeyType.AddHead(&dlg.m_listKeyType);
}
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->InsertColumn(0,"Find Items...",LVCFMT_LEFT,300);
CListView::OnInitialUpdate();
}
BOOL CFindView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL;
return CListView::PreCreateWindow(cs);
}
void CFindView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if (pHint)
// For now... something was wrong, and this is updating itself
return;
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->DeleteAllItems();
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
if (pDoc->m_pActiveChild)
{
CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
pFrame->SetMessageText("Searching...");
CNodeObject *pNode = pDoc->m_pActiveChild;
FindNodes(pNode);
}
}
}
int CFindView::FindNodes(CNodeObject *pNode)
{
int count = 0;
if (pNode->IsDataValue())
{
// Check if it matches the search
CNodeDataValue *pData = (CNodeDataValue *)pNode;
int value = pData->GetKeyType();
bool bMatchClass = this->m_listKeyType.Find((void *)value,NULL);
if (bMatchClass)
{
CListCtrl *pCtrl = &GetListCtrl();
CString str;
CNodeObject *pChild = pNode;
pChild->GetName(str);
//str = pChild->GetName();
/* while (pChild)
{
str = pChild->GetName()+":"+str;
pChild = pChild->GetParentNode();
}*/
int index = pCtrl->InsertItem(pCtrl->GetItemCount(),str);
pCtrl->SetItemData(index,(DWORD)pNode);
}
}
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
count += FindNodes(pChild);
}
return 0;
}
void CFindView::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if (pNMListView->uNewState & LVIS_SELECTED)
{
CListCtrl *pCtrl = &GetListCtrl();
CNodeObject *pNode = (CNodeObject *)pCtrl->GetItemData(pNMListView->iItem);
if (pNode)
GetDocument()->UpdateAllViews(this,(DWORD)pNode,NULL);
}
*pResult = 0;
}
@@ -0,0 +1,59 @@
#if !defined(AFX_FINDVIEW_H__05706028_1CEC_45B3_8406_E01C2630C343__INCLUDED_)
#define AFX_FINDVIEW_H__05706028_1CEC_45B3_8406_E01C2630C343__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FindView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CFindView view
class CFindView : public CListView
{
protected:
CFindView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CFindView)
// Attributes
public:
// Operations
public:
CPtrList m_listKeyType;
int FindNodes(CNodeObject *);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFindView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CFindView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CFindView)
afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FINDVIEW_H__05706028_1CEC_45B3_8406_E01C2630C343__INCLUDED_)
@@ -0,0 +1,163 @@
// KeyTypeDlg.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "KeyTypeDlg.h"
#include "EditKeyType.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CKeyTypeDlg dialog
CKeyTypeDlg::CKeyTypeDlg(CWnd* pParent /*=NULL*/)
: CDialog(CKeyTypeDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CKeyTypeDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bDirty = false;
}
void CKeyTypeDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CKeyTypeDlg)
DDX_Control(pDX, IDC_MODIFY, m_btModify);
DDX_Control(pDX, IDC_LIST_TYPES, m_listTypes);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CKeyTypeDlg, CDialog)
//{{AFX_MSG_MAP(CKeyTypeDlg)
ON_NOTIFY(NM_CLICK, IDC_LIST_TYPES, OnClickListTypes)
ON_BN_CLICKED(IDC_MODIFY, OnModify)
ON_BN_CLICKED(IDC_REMOVE, OnRemove)
ON_BN_CLICKED(IDC_ADD, OnAdd)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CKeyTypeDlg message handlers
extern CStringMap g_StringMap;
BOOL CKeyTypeDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CDialog::OnInitDialog();
m_listTypes.InsertColumn(0,"Key Name",LVCFMT_LEFT,300);
m_listTypes.InsertColumn(1,"Key Type",LVCFMT_LEFT,100);
CPtrList list;
g_StringMap.MakeList(list);
POSITION pos = list.GetHeadPosition();
while (pos)
{
POSITION lpos = (POSITION)list.GetNext(pos);
CString key = g_StringMap.GetName(lpos);
BYTE val = g_StringMap.GetValue(lpos);
int index = m_listTypes.InsertItem(0,key);
CString szValue = NAME_KEYTYPE[0] + CString("(NULL)");
szValue = NAME_KEYTYPE[(int)val];
m_listTypes.SetItemText(index,1,szValue);
m_listTypes.SetItemData(index,(DWORD)lpos);
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CKeyTypeDlg::OnClickListTypes(NMHDR* pNMHDR, LRESULT* pResult)
{
POSITION pos = this->m_listTypes.GetFirstSelectedItemPosition();
if (pos)
this->m_btModify.EnableWindow(true);
else
this->m_btModify.EnableWindow(false);
*pResult = 0;
}
void CKeyTypeDlg::OnModify()
{
CEditKeyType dlg;
int count = this->m_listTypes.GetSelectedCount();
POSITION pos = this->m_listTypes.GetFirstSelectedItemPosition();
while (pos)
{
int index = m_listTypes.GetNextSelectedItem(pos);
POSITION lpos = (POSITION)m_listTypes.GetItemData(index);
CString str = m_listTypes.GetItemText(index,0);
dlg.m_editName = str;
dlg.m_iCurSel = g_StringMap.GetValue(lpos);
if (IDOK == dlg.DoModal())
{
m_bDirty = true;
CString str = dlg.m_editName;
//this->m_map[str] = (void *)dlg.m_iCurSel;
g_StringMap.SetValue(lpos,dlg.m_iCurSel);
m_listTypes.SetItemText(index,0,str);
m_listTypes.SetItemText(index,1,NAME_KEYTYPE[dlg.m_iCurSel]);
//m_listTypes.SetItemData(index,dlg.m_iCurSel);
}
}
}
void CKeyTypeDlg::OnRemove()
{
// TODO: Add your control notification handler code here
}
void CKeyTypeDlg::OnAdd()
{
// TODO: Add your control notification handler code here
}
void CKeyTypeDlg::SetMap(CMapPtrToWord *map)
{
m_pmap = map;
/* POSITION pos = map.GetStartPosition();
while (pos)
{
CString key;
void *value;
map.GetNextAssoc(pos,key,value);
this->m_map[key] = value;
} */
}
/*
void CKeyTypeDlg::GetMap(CMapStringToPtr &map)
{
map.RemoveAll();
POSITION pos = m_map.GetStartPosition();
while (pos)
{
CString key;
void *value;
m_map.GetNextAssoc(pos,key,value);
map[key] = value;
}
}
*/
@@ -0,0 +1,56 @@
#if !defined(AFX_KEYTYPEDLG_H__CB2C6067_790E_11D3_9C20_00609712FBEF__INCLUDED_)
#define AFX_KEYTYPEDLG_H__CB2C6067_790E_11D3_9C20_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// KeyTypeDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CKeyTypeDlg dialog
class CKeyTypeDlg : public CDialog
{
// Construction
public:
CMapPtrToWord *m_pmap;
bool m_bDirty;
CKeyTypeDlg(CWnd* pParent = NULL); // standard constructor
void SetMap(CMapPtrToWord *);
//void GetMap(CMapPtrToWord &);
// Dialog Data
//{{AFX_DATA(CKeyTypeDlg)
enum { IDD = IDD_DIALOG_KEYTYPE };
CButton m_btModify;
CListCtrl m_listTypes;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CKeyTypeDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CKeyTypeDlg)
virtual BOOL OnInitDialog();
afx_msg void OnClickListTypes(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnModify();
afx_msg void OnRemove();
afx_msg void OnAdd();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_KEYTYPEDLG_H__CB2C6067_790E_11D3_9C20_00609712FBEF__INCLUDED_)
@@ -0,0 +1,120 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "MainFrm.h"
#include "childwndthread.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)
ON_WM_CREATE()
ON_COMMAND(ID_FILE_NEW, OnFileNew)
//}}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
void CMainFrame::OnFileNew()
{
// Should I create a new thread here and pass it the pDocTeplate object?
CDocTemplate *pDocTemplate = (CDocTemplate *) ((CContentTrackApp *)AfxGetApp())->m_mapTemplates[ID_FILE_OPEN];
/* CWinThread *pThread = AfxBeginThread(RUNTIME_CLASS(CChildWndThread),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED);
((CChildWndThread *)pThread)->m_pDocTemplate = pDocTemplate;
pThread->m_pMainWnd = AfxGetMainWnd();
pThread->ResumeThread();
*/
pDocTemplate->OpenDocumentFile(NULL);
}
@@ -0,0 +1,56 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__38050502_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_MAINFRM_H__38050502_782B_11D3_9C1F_00609712FBEF__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);
afx_msg void OnFileNew();
//}}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__38050502_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,118 @@
// MissingFilesView.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "MissingFilesView.h"
#include "NodeDataValueFileDoc.h"
#include "mainfrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMissingFilesView
IMPLEMENT_DYNCREATE(CMissingFilesView, CListView)
CMissingFilesView::CMissingFilesView()
{
}
CMissingFilesView::~CMissingFilesView()
{
}
BEGIN_MESSAGE_MAP(CMissingFilesView, CListView)
//{{AFX_MSG_MAP(CMissingFilesView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMissingFilesView drawing
void CMissingFilesView::OnDraw(CDC* pDC)
{
// CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CMissingFilesView diagnostics
#ifdef _DEBUG
void CMissingFilesView::AssertValid() const
{
CListView::AssertValid();
}
void CMissingFilesView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMissingFilesView message handlers
void CMissingFilesView::OnInitialUpdate()
{
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->InsertColumn(0,"Missing Files",LVCFMT_LEFT,500);
CListView::OnInitialUpdate();
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
CNodeDisk *pNode = pDoc->GetRootNode();
InsertNode(pNode);
}
}
BOOL CMissingFilesView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
cs.style |= LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS;
return CListView::PreCreateWindow(cs);
}
int CMissingFilesView::InsertNode(CNodeObject *pNode)
{
int x=0;
if (pNode->IsFile())
{
CNodeDataValueFile *pN = (CNodeDataValueFile *)pNode;
if (!pN->GetNodeDisk())
{
CMainFrame *pFrame = (CMainFrame*)AfxGetMainWnd();
CString str;
pN->GetName(str);
pFrame->SetMessageText(str);
x++;
CListCtrl *pCtrl = &GetListCtrl();
CString name1;
CNodeObject *pParent = pNode->GetParentNode();
while (pParent && !pParent->IsFile())
pParent = pParent->GetParentNode();
if (pParent)
{
CNodeDisk *pDisk = ((CNodeDataValueFile *)pParent)->GetNodeDisk();
name1 = pDisk->GetPath()+"->";
}
pCtrl->InsertItem(pCtrl->GetItemCount(),name1+str);
}
}
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeDisk *pChild = (CNodeDisk *)pNode->GetNextChild(pos);
x+= InsertNode(pChild);
}
return x;
}
@@ -0,0 +1,56 @@
#if !defined(AFX_MISSINGFILESVIEW_H__58A6A6AE_CB46_4BA1_B03B_CD5F30523832__INCLUDED_)
#define AFX_MISSINGFILESVIEW_H__58A6A6AE_CB46_4BA1_B03B_CD5F30523832__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MissingFilesView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CMissingFilesView view
class CMissingFilesView : public CListView
{
protected:
CMissingFilesView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CMissingFilesView)
// Attributes
public:
// Operations
public:
int InsertNode(CNodeObject *pNode);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMissingFilesView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CMissingFilesView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CMissingFilesView)
// 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_MISSINGFILESVIEW_H__58A6A6AE_CB46_4BA1_B03B_CD5F30523832__INCLUDED_)
@@ -0,0 +1,496 @@
// NodeDataValueFileDoc.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "NodeDataValueFileDoc.h"
#include "DialogPasteRename.h"
#include <stuff\database.hpp>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
CString g_szbrowsepath;
int CALLBACK BrowseCallbackProc(HWND hWnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
{
RECT rect;
//
//Center the browse dialog on the screen...
//
switch (uMsg)
{
case BFFM_INITIALIZED:
{
SendMessage(hWnd,BFFM_SETSELECTION,TRUE,(LPARAM)(LPCTSTR)g_szbrowsepath);
if (GetWindowRect(hWnd, &rect))
{
SetWindowPos(hWnd,
HWND_TOP,
(GetSystemMetrics(SM_CXSCREEN) - (rect.right - rect.left)) >> 1,
(GetSystemMetrics(SM_CYSCREEN) - (rect.bottom - rect.top)) >> 1,
0,
0,
SWP_NOSIZE);
}
}
}
return 0;
}
CString BrowseDirectory(const char *strCurrent,CWnd *pWnd)
{
CString str;
TCHAR szBuffer[MAX_PATH];
LPITEMIDLIST pidlBrowse,pidlRoot;
BROWSEINFO bi;
LPMALLOC lpMalloc;
SHGetMalloc(&lpMalloc);
ASSERT(lpMalloc);
bi.hwndOwner = pWnd->GetSafeHwnd();
// Get the ID for the "My Computer" root folder
SHGetSpecialFolderLocation(pWnd->GetSafeHwnd(),CSIDL_DRIVES,&pidlRoot);
bi.pidlRoot = pidlRoot;
bi.pszDisplayName = szBuffer;
// Localize the descriptive text
bi.lpszTitle = "Select a MW4 Game Root folder. This folder should should have a Contents subdirectory.";
// BIF_EDITBOX and BIF_VALIDATE are for versions 4.71 and later, they
// might be ignored by older versions
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;// | BIF_EDITBOX;// | BIF_USENEWUI;// | BIF_VALIDATE;
bi.lParam = (LPARAM)pWnd;
bi.iImage = NULL;
bi.lpfn = BrowseCallbackProc;
bi.lParam = (LPARAM)strCurrent;
g_szbrowsepath = strCurrent;
//
//Call the Windows shell folder browsing routine...
//
pidlBrowse = SHBrowseForFolder(&bi);
if (NULL != pidlBrowse)
{
if (SHGetPathFromIDList(pidlBrowse, szBuffer))
{
if ('\\' == szBuffer[lstrlen(szBuffer)-1])
szBuffer[lstrlen(szBuffer)-1] = '\0';
str = CString(szBuffer);
}
else
str = "";
//
//Free up shell memory used...
//
lpMalloc->Free(pidlBrowse);
}
else
str = "";
lpMalloc->Free(pidlRoot);
lpMalloc->Release();
return str;
}
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileDoc
IMPLEMENT_DYNCREATE(CNodeDataValueFileDoc, CContentTrackDoc)
CNodeDataValueFileDoc::CNodeDataValueFileDoc()
{
m_pNodeDataValueFileProject = NULL;
m_pNodeDirectory = NULL;
m_pActiveChild = NULL;
m_iReplaceAll = -1;
}
BOOL CNodeDataValueFileDoc::OnNewDocument()
{
if (!CContentTrackDoc::OnNewDocument())
return FALSE;
/* CFileDialog dlg(false,"*.project",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,"*.project",NULL);
if (IDOK == dlg.DoModal())
{
m_pNodeDataValueFileProject = new CNodeDataValueFileProject(NULL,dlg.GetPathName());
return TRUE;
}*/
char buf[MAX_PATH];
GetCurrentDirectory(MAX_PATH,buf);
CString path = BrowseDirectory(buf,NULL);
if (path.GetLength())
{
CString contentpath = path+"\\content";
DWORD attrib = ::GetFileAttributes(contentpath);
if (-1 == attrib)
{
// File does not exist
CString str = "Game root folder "+path+" does not have a Contents directory. Do you want to continue? A Contents directory will be created.";
if (IDNO == MessageBox(NULL,str,"Create New Workspace",MB_YESNO))
return false;
}
// Scan the content directory
SetCurrentDirectory(path);
m_strRoot = path;
// Scan the content directory
CreateDirectory(contentpath,NULL);
CFrameWnd *pFrame = (CFrameWnd *)AfxGetMainWnd();
pFrame->SetMessageText("Scanning Content directory...");
this->m_pNodeDirectory = new CNodeDiskDirectory(NULL,/*path+"\\*/"content");
m_pNodeDataValueFileProject = new CNodeDataValueFileProject(this,path);
m_pNodeDirectory->SetParentNode(m_pNodeDataValueFileProject);
return TRUE;
}
return FALSE;
}
CNodeDataValueFileDoc::~CNodeDataValueFileDoc()
{
if (m_pNodeDataValueFileProject)
delete m_pNodeDataValueFileProject;
m_pNodeDataValueFileProject = NULL;
if (m_pNodeDirectory)
delete m_pNodeDirectory;
m_pNodeDirectory = NULL;
}
BEGIN_MESSAGE_MAP(CNodeDataValueFileDoc, CContentTrackDoc)
//{{AFX_MSG_MAP(CNodeDataValueFileDoc)
ON_COMMAND(ID_ADDROOT, OnAddroot)
ON_COMMAND(ID_FILE_SAVE, OnFileSave)
ON_COMMAND(ID_FILE_SAVE_AS, OnFileSaveAs)
ON_COMMAND(ID_EDIT_COPY, OnEditCopy)
ON_COMMAND(ID_EDIT_PASTE, OnEditPaste)
ON_COMMAND(ID_EDIT_PASTE_RENAME, OnEditPasteRename)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileDoc diagnostics
#ifdef _DEBUG
void CNodeDataValueFileDoc::AssertValid() const
{
CContentTrackDoc::AssertValid();
}
void CNodeDataValueFileDoc::Dump(CDumpContext& dc) const
{
CContentTrackDoc::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileDoc serialization
void CNodeDataValueFileDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileDoc commands
extern int IdentifyFileType(CString path);
BOOL CNodeDataValueFileDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
// if (!CContentTrackDoc::OnOpenDocument(lpszPathName))
// return FALSE;
CFrameWnd *pFrame = (CFrameWnd *)AfxGetMainWnd();
if (this->m_pNodeDataValueFileProject)
{
this->m_pActiveChild = NULL;
pFrame->SetMessageText("Updating...");
m_pNodeDataValueFileProject->Update();
m_pNodeDataValueFileProject->ResetVisitAll();
this->UpdateAllViews(NULL,NULL,NULL);
pFrame->SetMessageText("Ready.");
//TODO: Clear the dirty bits
return TRUE;
}
NotationFile notefile(lpszPathName);
Page *page = notefile.GetPage("Project");
if (NULL == page)
return FALSE;
Check_Object(page);
const char *path;
if (!page->GetEntry("Path",&path))
return FALSE;
SetCurrentDirectory(path);
m_strRoot = path;
// Scan the content directory
CreateDirectory(CString(path)+"\\content",NULL);
pFrame->SetMessageText("Scanning Content directory...");
this->m_pNodeDirectory = new CNodeDiskDirectory(NULL,/*CString(path)+"\\*/"content");
m_pNodeDataValueFileProject = new CNodeDataValueFileProject(this,path);
m_pNodeDirectory->SetParentNode(m_pNodeDataValueFileProject);
page = notefile.GetPage("Roots");
if (page)
{
Check_Object(page);
Page::NoteIterator *entries = page->MakeNoteIterator();
Check_Object(entries);
Note *entry;
// Enumerate the entries in the section
while ((entry = entries->ReadAndNext()) != NULL)
{
Check_Object(entry);
if (0 == (strnicmp(entry->GetName(),"Path",4)))
{
const char *newpath;
entry->GetEntry(&newpath);
CString fullpath = CString(path)+"\\"+newpath;
CNodeObject *pNode = CNodeData::CreateChild(m_pNodeDataValueFileProject,IdentifyFileType(fullpath),newpath);
m_pNodeDataValueFileProject->AddChild(pNode);
}
}
Check_Object(entries);
delete entries;
}
return TRUE;
}
CNodeDisk *CNodeDataValueFileDoc::FindDirectoryNode(CString strName)
{
return FindDirectoryNode(strName,GetRootNode());
}
CNodeDisk *CNodeDataValueFileDoc::FindDirectoryNode(CString strName,CNodeDisk *pNode)
{
#if 0
if (strName.GetLength() ==0)
return NULL;
if (strName[0] == '\\')
strName.Delete(0,1);
CString strDir = pNode->GetName();
int iLen = strDir.GetLength();
if (strnicmp(strDir,strName,iLen)==0)
{
strName.Delete(0,iLen);
if (strName.IsEmpty())
// we found it
return pNode;
strName.Delete(0,1);
POSITION pos = pNode->GetFirstChild();
while (pos)
{
if (out_pos)
*out_pos = pos;
CNodeDisk *pChild = (CNodeDisk *)pNode->GetNextChild(pos);
CNodeDisk *pRet = FindDirectoryNode(strName,pChild,out_pos);
if (pRet)
return pRet;
}
}
return NULL;
#endif
char *src_name = (char *)(LPCTSTR)strName;
// int src_size = strName.GetLength();
char dir_name[MAX_PATH];
//char *dir_name = (char *)(LPCTSTR)pNode->GetName();
pNode->GetName(dir_name,MAX_PATH);
// int dir_size = pNode->GetName().GetLength();
// this isn't really necessary since the last character in src_name is '\0'
// and the loop below will exit there too
// if (src_size < dir_size)
// return NULL;
//for (int x=0;x<dir_size;x++)
for (char *dn = dir_name;*dn;++dn,++src_name)
{
// 0x5f mask makes the ascii character uppercase
if ( (*src_name&0x5f) != (*dn&0x5f))
return NULL;
//src_name++;
}
if (src_name[0])
{
if ('\\' == src_name[0])
{
src_name++;
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeDisk *pChild = (CNodeDisk *)pNode->GetNextChild(pos);
CNodeDisk *pRet = FindDirectoryNode(src_name,pChild);
if (pRet)
return pRet;
}
}
// We found some other characters in the name, so it doesn't match.
return NULL;
}
// Means the names match and we found the right node
return pNode;
}
void CNodeDataValueFileDoc::OnAddroot()
{
CFileDialog dlg(true);
CString str;
this->m_pNodeDataValueFileProject->GetName(str);
dlg.m_ofn.lpstrInitialDir = str;
if (IDOK == dlg.DoModal())
{
//m_pNodeDataValueFileProject = new CNodeDataValueFileProject(NULL,dlg.GetPathName());
CString path = dlg.GetPathName();
CString dir;
m_pNodeDataValueFileProject->GetName(dir);
if (strnicmp(dir,path,dir.GetLength()))
{
// Error - the new root file must be in a subdir of the project path
MessageBox(NULL,"Error: The new root file must be in a subdir of the project path!","Error",MB_OK);
return;
}
CString newpath = path.Right(path.GetLength()-dir.GetLength()-1);
SetCurrentDirectory(dir);
CNodeObject *pNode = CNodeData::CreateChild(m_pNodeDataValueFileProject,IdentifyFileType(path),newpath);
m_pNodeDataValueFileProject->AddChild(pNode);
// m_pNodeDataValueFileProject->Update();
this->UpdateAllViews(NULL,NULL,NULL);
}
}
void CNodeDataValueFileDoc::OnFileSave()
{
CString fname = GetPathName();
if (0 == fname.GetLength())
{
OnFileSaveAs();
return;
}
NotationFile notefile;
Page *page = notefile.AddPage("Project");
CString str;
m_pNodeDataValueFileProject->GetName(str);
page->AppendEntry("Path",str);
page = notefile.AddPage("Roots");
POSITION pos = m_pNodeDataValueFileProject->GetFirstChild();
while (pos)
{
CNodeObject *pnode = m_pNodeDataValueFileProject->GetNextChild(pos);
CString str;
pnode->GetName(str);
page->AppendEntry("Path",str);
}
notefile.SaveAs(GetPathName());
}
void CNodeDataValueFileDoc::OnFileSaveAs()
{
CFileDialog dlg(false);
if (IDOK == dlg.DoModal())
{
this->SetPathName(dlg.GetPathName());
OnFileSave();
}
}
void CNodeDataValueFileDoc::OnEditCopy()
{
((CContentTrackApp *)AfxGetApp())->m_pNodeSelected = m_pActiveChild;
}
void CNodeDataValueFileDoc::OnEditPaste()
{
CNodeObject *pSelected = ((CContentTrackApp *)AfxGetApp())->m_pNodeSelected;
CNodeObject *pClone = _OnEditPaste(pSelected);
if (pClone)
this->UpdateAllViews(NULL,NULL,NULL);
}
CNodeObject *CNodeDataValueFileDoc::_OnEditPaste(CNodeObject *pSelected,CString oldName,CString newName)
{
this->m_iReplaceAll = -1;
// Paste the copied node as a child of the selected node
CNodeObject *pChild = m_pActiveChild?m_pActiveChild:this->GetNodeProject();
CNodeObject *pClone = NULL;
if (pSelected&&pChild)
{
pClone = pSelected->Clone(pChild,oldName,newName);
pChild->AddChild(pClone);
this->GetRootNode()->ResetVisitAll();
}
return pClone;
}
int VisitTreeFiles(CNodeObject *pNode)
{
int count = 0;
if (NULL == pNode)
return 0;
bool bvisited = false;
if (pNode->IsFile())
{
CNodeDisk *pDisk= ((CNodeDataValueFile*)pNode)->GetNodeDisk();
bvisited = pDisk->GetVisit(VISIT_FLAG1);
if (!bvisited)
{
pDisk->SetVisit(VISIT_FLAG1);
count++;
}
}
if (!bvisited)
{
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pNode->GetNextChild(pos);
count += VisitTreeFiles(pChild);
}
}
return count;
}
void CNodeDataValueFileDoc::OnEditPasteRename()
{
CNodeObject *pSelected = ((CContentTrackApp *)AfxGetApp())->m_pNodeSelected;
CDialogPasteRename dlg;
if (pSelected&&(IDOK == dlg.DoModal()))
{
CString newName = dlg.m_strNew;
CString oldName = dlg.m_strOld;
CNodeObject *pNode = pSelected;
while (pNode && (!pNode->IsFile()))
pNode = pNode->GetParentNode();
VisitTreeFiles(pNode);
CNodeObject *pClone = _OnEditPaste(pSelected,oldName,newName);
this->UpdateAllViews(NULL,NULL,NULL);
}
}
@@ -0,0 +1,75 @@
#if !defined(AFX_NODEDATAVALUEFILEDOC_H__38050514_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_NODEDATAVALUEFILEDOC_H__38050514_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NodeDataValueFileDoc.h : header file
//
#include "ContentTrackDoc.h"
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileDoc document
#include "NodeObject.h"
class CNodeDataValueFileDoc : public CContentTrackDoc
{
protected:
CNodeDataValueFileDoc(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CNodeDataValueFileDoc)
// Attributes
public:
CNodeObject *m_pActiveChild;
int m_iReplaceAll;
protected:
CString m_strRoot;
// Operations
public:
CNodeDataValueFileProject *GetNodeProject() {return m_pNodeDataValueFileProject;}
CNodeDisk *FindDirectoryNode(CString);
CString GetRootDir() {return m_strRoot;}
CNodeDiskDirectory *GetRootNode() {return m_pNodeDirectory;}
afx_msg void OnEditCopy();
afx_msg void OnEditPaste();
CNodeObject *_OnEditPaste(CNodeObject *,CString = "",CString = "");
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNodeDataValueFileDoc)
public:
virtual void Serialize(CArchive& ar); // overridden for document i/o
virtual BOOL OnOpenDocument(LPCTSTR lpszPathName);
protected:
virtual BOOL OnNewDocument();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CNodeDataValueFileDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
CNodeDiskDirectory *m_pNodeDirectory;
CNodeDisk *FindDirectoryNode(CString,CNodeDisk *);
CNodeDataValueFileProject * m_pNodeDataValueFileProject;
//{{AFX_MSG(CNodeDataValueFileDoc)
afx_msg void OnAddroot();
afx_msg void OnFileSave();
afx_msg void OnFileSaveAs();
afx_msg void OnEditPasteRename();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NODEDATAVALUEFILEDOC_H__38050514_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,244 @@
// NodeDataValueFileView.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "NodeDataValueFileView.h"
#include "NodeDataValueFileDoc.h"
#include "EditKeyType.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileView
IMPLEMENT_DYNCREATE(CNodeDataValueFileView, CTreeView)
CNodeDataValueFileView::CNodeDataValueFileView()
{
m_hBoldItem = NULL;
}
CNodeDataValueFileView::~CNodeDataValueFileView()
{
}
BEGIN_MESSAGE_MAP(CNodeDataValueFileView, CTreeView)
//{{AFX_MSG_MAP(CNodeDataValueFileView)
ON_COMMAND(ID_EXPANDALL, OnExpandall)
ON_NOTIFY_REFLECT(TVN_ITEMEXPANDING, OnItemexpanding)
ON_NOTIFY_REFLECT(TVN_SELCHANGED, OnSelchanged)
ON_NOTIFY_REFLECT(TVN_ITEMEXPANDED, OnItemexpanded)
ON_WM_CONTEXTMENU()
ON_NOTIFY_REFLECT(NM_RCLICK, OnRclick)
ON_COMMAND(ID_VIEW_EDITKEY, OnViewEditkey)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileView drawing
void CNodeDataValueFileView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileView diagnostics
#ifdef _DEBUG
void CNodeDataValueFileView::AssertValid() const
{
CTreeView::AssertValid();
}
void CNodeDataValueFileView::Dump(CDumpContext& dc) const
{
CTreeView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileView message handlers
void CNodeDataValueFileView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CTreeCtrl *pCtrl = &this->GetTreeCtrl();
if (lHint)
{
pCtrl->SetItemState(m_hBoldItem,0,TVIS_BOLD);
CNodeObject *pNode = (CNodeObject *)lHint;
HANDLE handle = pNode->ViewNode(pCtrl,NULL,2);
HTREEITEM hItem = (HTREEITEM)handle;
pCtrl->SetItemState(hItem,TVIS_BOLD,TVIS_BOLD);
m_hBoldItem = hItem;
pCtrl->EnsureVisible(hItem);
}
else
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
HTREEITEM hItem = (HTREEITEM)pDoc->GetNodeProject()->ViewNode(pCtrl,NULL,2);
// Expand the root item
pCtrl->Expand(hItem,TVE_EXPAND);
}
}
BOOL CNodeDataValueFileView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= TVS_HASLINES | TVS_SHOWSELALWAYS | TVS_DISABLEDRAGDROP | TVS_FULLROWSELECT | TVS_HASBUTTONS; // TVS_LINESATROOT |;
return CTreeView::PreCreateWindow(cs);
}
void CNodeDataValueFileView::OnExpandall()
{
ExpandAll(GetTreeCtrl().GetSelectedItem());
}
int CNodeDataValueFileView::ExpandAll(HTREEITEM hParent)
{
CTreeCtrl *pCtrl = &this->GetTreeCtrl();
if (pCtrl->ItemHasChildren(hParent))
{
HTREEITEM hChildItem = pCtrl->GetChildItem(hParent);
while (hChildItem != NULL)
{
ExpandAll(hChildItem);
hChildItem = pCtrl->GetNextItem(hChildItem, TVGN_NEXT);
}
}
pCtrl->Expand(hParent,TVE_EXPAND);
return 0;
}
void CNodeDataValueFileView::OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult)
{
/* NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CNodeObject *pNode = (CNodeObject *)pCtrl->GetItemData(hItem);
CNodeObject *pParent = pNode->GetParentNode();
pNode->ViewNode(pCtrl,pParent?pCtrl->GetParentItem(hItem):NULL,3);
*pResult = 0;*/
}
void CNodeDataValueFileView::OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CNodeObject *pNode = (CNodeObject *)pCtrl->GetItemData(hItem);
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
pDoc->m_pActiveChild = pNode;
pDoc->UpdateAllViews(this);
*pResult = 0;
}
void CNodeDataValueFileView::OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hItem = pNMTreeView->itemNew.hItem;
CNodeObject *pNode = (CNodeObject *)pCtrl->GetItemData(hItem);
CNodeObject *pParent = pNode->GetParentNode();
pNode->ViewNode(pCtrl,pParent?pCtrl->GetParentItem(hItem):NULL,3);
*pResult = 0;
}
/*
void CNodeDataValueFileView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CMenu menu;
//VERIFY(menu.CreateMenu());
VERIFY(menu.LoadMenu(IDR_CONTENTYPE));
CMenu *pPopup = menu.GetSubMenu(3);
VERIFY(pPopup);
POINT pt = pNMTreeView->ptDrag;
static int x=1;
//if (x)
// ClientToScreen(&pt);
//else
ScreenToClient(&pt);
// ClientToDoc(pt);
RECT rc;
//this->GetTreeCtrl().GetItemRect(pNMTreeView->itemNew.hItem,&rc,true);
*pResult = 0;
}
*/
void CNodeDataValueFileView::OnContextMenu(CWnd* pWnd, CPoint point)
{
ScreenToClient(&point);
HTREEITEM hItem = GetTreeCtrl().HitTest(point);
// CNodeObject *pNode = (CNodeObject *)GetTreeCtrl().GetItemData(hItem);
CMenu menu;
VERIFY(menu.LoadMenu(IDR_CONTENTYPE));
CMenu *pPopup = menu.GetSubMenu(3);
VERIFY(pPopup);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,point.x,point.y,AfxGetMainWnd());
}
void CNodeDataValueFileView::OnRclick(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
CMenu menu;
//VERIFY(menu.CreateMenu());
VERIFY(menu.LoadMenu(IDR_CONTENTYPE));
CMenu *pPopup = menu.GetSubMenu(3);
VERIFY(pPopup);
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hItem = pCtrl->GetSelectedItem();
pCtrl->EnsureVisible(hItem);
RECT rc;
pCtrl->GetItemRect(hItem,&rc,true);
ClientToScreen(&rc);
//pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,rc.right,rc.top,AfxGetMainWnd());
*pResult = 0;
}
extern CStringMap g_StringMap;
void CNodeDataValueFileView::OnViewEditkey()
{
CTreeCtrl *pCtrl = &GetTreeCtrl();
HTREEITEM hItem = pCtrl->GetSelectedItem();
if (hItem)
{
CNodeObject *pNode = (CNodeObject *)pCtrl->GetItemData(hItem);
if (pNode->GetClassID() == CLASS_CNODEDATAENTRY)
{
CNodeDataEntry *pEntry = (CNodeDataEntry *)pNode;
CEditKeyType dlg;
CString str;
pNode->GetName(str);
dlg.m_editName = str;
dlg.m_iCurSel = pEntry->GetKeyValue();
POSITION lpos = pEntry->GetKeyPos();
if (IDOK == dlg.DoModal())
{
g_StringMap.SetValue(lpos,dlg.m_iCurSel);
CContentTrackApp *pApp = (CContentTrackApp *)AfxGetApp();
pApp->UpdateKeys();
pApp->WritePropFile();
}
}
}
}
@@ -0,0 +1,63 @@
#if !defined(AFX_NODEDATAVALUEFILEVIEW_H__38050515_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_NODEDATAVALUEFILEVIEW_H__38050515_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NodeDataValueFileView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CNodeDataValueFileView view
class CNodeDataValueFileView : public CTreeView
{
protected:
CNodeDataValueFileView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CNodeDataValueFileView)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNodeDataValueFileView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
HTREEITEM m_hBoldItem;
int ExpandAll(HTREEITEM);
virtual ~CNodeDataValueFileView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CNodeDataValueFileView)
afx_msg void OnExpandall();
afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnItemexpanded(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnViewEditkey();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NODEDATAVALUEFILEVIEW_H__38050515_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,507 @@
// NodeObject.h: interface for the CNodeObject class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_NODEOBJECT_H__38050511_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_NODEOBJECT_H__38050511_782B_11D3_9C1F_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
//////////////////////////////////////////////////////////////////////
// CObject Derivatives
//////////////////////////////////////////////////////////////////////
#include "mw4headers.hpp"
#include "Vehicle.hpp"
#include "stuff\NotationFile.hpp"
#include <ElementRenderer\ElementRenderer.hpp>
#include <ElementRenderer\GroupElement.hpp>
#include <ElementRenderer\ShapeElement.hpp>
#include <ElementRenderer\ListElement.hpp>
#include <ElementRenderer\GridElement.hpp>
#include <ElementRenderer\SwitchElement.hpp>
#include <ElementRenderer\LODElement.hpp>
#include <ElementRenderer\MultiLODElement.hpp>
#include <ElementRenderer\ShapeLODElement.hpp>
#include <MLR\MLR.hpp>
#include <MLR\MLRPrimitiveBase.hpp>
//extern CMapStringToPtr g_mapKeyType;
// These names map to the types in enum_keytype
static char NAME_KEYTYPE[][30] = {"Unknown","Content Data File","MW4ANIM Animation File","Erf File","Wav File","Float Value","Point3 Value","Targe TGA file","BSP file","OBB file","ABL Script","Boolean Value","Resource file","FGD file","ContentTrack Project","MATERIAL file","String Value","Integer Value","RAW file","BID file","Compost Texture","PNG file"};
enum ENUM_KEYTYPE {KEYTYPE_UNKNOWN,KEYTYPE_NOTE,KEYTYPE_MW4ANIM,KEYTYPE_ERF,KEYTYPE_WAV,KEYTYPE_FLOAT,KEYTYPE_POINT3,KEYTYPE_TGA,KEYTYPE_BSP,KEYTYPE_OBB,KEYTYPE_ABL,KEYTYPE_BOOL,KEYTYPE_RESOURCE,KEYTYPE_FGD,KEYTYPE_PROJECT,KEYTYPE_MATERIAL,KEYTYPE_STRING,KEYTYPE_INT,KEYTYPE_RAW,KEYTYPE_BID,KEYTYPE_COMPOSTTEXTURE,KEYTYPE_PNG,MAX_KEYTYPE};
// TODO: class ids are incomplete
enum {CLASS_CNODEOBJECT,
CLASS_CNODEDISK,
CLASS_CNODEDISKDIRECTORY,
CLASS_CNODEDISKFILE,
CLASS_CNODEDATA,
CLASS_CNODEDATAPAGE,
CLASS_CNODEDATAENTRY,
CLASS_CNODEDATAVALUE,
CLASS_CNODEDATAVALUEFLOAT,
CLASS_CNODEDATAVALUEPOINT3,
CLASS_CNODEDATAVALUEBOOL,
CLASS_CNODEDATAVALUESTRING,
CLASS_CNODEDATAVALUEINT,
CLASS_CNODEDATAVALUECOMPOSTTEXTURE,
CLASS_CNODEDATAVALUEFILE,
CLASS_CNODEDATAVALUEFILEPROJECT,
CLASS_CNODEDATAVALUEFILEERF,
CLASS_CNODEDATAVALUEFILEWAV,
CLASS_CNODEDATAVALUEFILEMW4ANIM,
CLASS_CNODEDATAVALUEFILETGA,
CLASS_CNODEDATAVALUEFILEPNG,
CLASS_CNODEDATAVALUEFILENOTE,
CLASS_CNODEDATAVALUEFILEBSP,
CLASS_CNODEDATAVALUEFILEOBB,
CLASS_CNODEDATAVALUEFILEABL,
CLASS_CNODEDATAVALUEFILEFGD,
CLASS_CNODEDATAVALUEFILEMATERIAL,
CLASS_CNODEDATAVALUEFILERAW,
CLASS_CNODEDATAVALUEFILEBID,
CLASS_CNODEDATAVALUEFILERESOURCE,
CLASS_CNODEDATAVALUEERF,
CLASS_CNODEDATAVALUEERFGROUPELEMENT,
CLASS_CNODEDATAVALUEERFLISTELEMENT,
CLASS_CNODEDATAVALUEERFGRIDELEMENT,
CLASS_CNODEDATAVALUEERFLODELEMENT,
CLASS_CNODEDATAVALUEERFSHAPELODELEMENT,
CLASS_CNODEDATAVALUEERFSHAPEELEMENT,
CLASS_CNODEDATAVALUEERFSWITCHELEMENT,
CLASS_CNODEDATAVALUEMLRELEMENT};
// define the Visit flags
#define VISIT_FLAGALL 0xFFFF
#define VISIT_FLAG1 1
#define VISIT_FLAG2 2
#define VISIT_FLAG3 4
// Be careful with variables placment. Struct members are 4 byte aligned
class CNodeObject// : public CObject
{
private:
struct NODELIST
{
CNodeObject *pData;
NODELIST *pNext;
}*m_pListChildren,*m_pListReferences;
//CObList m_listChildren;
//CObList m_listReferences;
DWORD m_dwVisited;
protected:
char *m_szName;
CNodeObject *m_pNodeParent;
BYTE m_iClassID;
private:
WORD m_iRefCount;
public:
bool m_bDirty;
CMapPtrToPtr m_mapViewHandles;
CNodeObject(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeObject();
POSITION GetFirstChild();
virtual CNodeObject *GetNextChild(POSITION &);
POSITION AddChild(CNodeObject *);
CNodeObject *RemoveChild(POSITION pos);
CNodeObject *GetAt(POSITION);
virtual int GetName(CString &);
virtual int GetName(char *,int);
CString GetNameStr();
virtual void SetName(const char *);
virtual HANDLE ViewNode(CTreeCtrl *,HTREEITEM,int);
CNodeObject *GetParentNode() {return m_pNodeParent;}
virtual void Update();
virtual int Paste(CNodeObject *); // Paste this node and it's children into the dest node
virtual CNodeObject *Clone(CNodeObject *,CString,CString);
virtual bool IsFile();
virtual bool IsDataValue();
CString GetRootPath();
//virtual int Rename(CString, CString,bool); //Rename a structure: New_Name,Old_Name, substring replace
BYTE GetClassID() {return m_iClassID;}
CNodeObject *FindChild(CString,bool = false);
POSITION GetFirstReference();
CNodeObject *GetNextReference(POSITION &);
void AddRef(CNodeObject *);
CNodeObject *RemoveRef(CNodeObject *);
WORD GetRefCount() {return m_iRefCount;}
bool SetVisit(DWORD); //Get a visited flag, returns old value
bool GetVisit(DWORD); //Set a visited flag
void ResetVisit(); //Resets the visited flag
void ResetVisitAll(); //Recursively reset all visited
};
//////////////////////////////////////////////////////////////////////
// CNodeObject Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDiskFile;
class CNodeDiskDirectory;
class CNodeDisk : public CNodeObject
{
protected:
// CString m_strParentPath;
bool m_bFound;
bool m_bLoaded;
public:
CNodeDisk(CNodeObject *,CString,bool = false);
virtual ~CNodeDisk();
CString GetDirectory();
CString GetPath();
//CString GetParentPath() {return m_strParentPath;}
BOOL IsFound() {return m_bFound;}
BOOL IsLoaded() {return m_bLoaded;}
void SetLoaded() {m_bLoaded = true;}
CNodeDiskFile *DiskCopyFile(CString,CString);
CNodeDiskFile *DiskCopyFile(LPVOID,DWORD,CString);
CNodeDisk *DiskCreateDirectory(CString);
//virtual int Rename(CString, CString,bool); // Move the directory
};
class CNodeDataValue;
class CNodeData : public CNodeObject
{
public:
CNodeData(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeData();
static CNodeDataValue *CreateChild(CNodeObject *,int,CString);
};
//////////////////////////////////////////////////////////////////////
// CNodeDisk Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDiskDirectory : public CNodeDisk
{
protected:
public:
CNodeDiskDirectory(CNodeObject *,CString); // Must have path, it then scans that path and completes the Directory tree
virtual ~CNodeDiskDirectory();
void SetParentNode(CNodeObject *pNode) {m_pNodeParent = pNode;} // Only for the root directory node - add to project
};
class CNodeDiskFile : public CNodeDisk
{
public:
CNodeDiskFile(CNodeObject *,CString);
virtual ~CNodeDiskFile();
};
//////////////////////////////////////////////////////////////////////
// CNodeData Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDataPage: public CNodeData
{
public:
CNodeDataPage(CNodeObject *,Page *,CString,CString,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataPage();
};
class CNodeDataEntry: public CNodeData
{
public:
CNodeDataEntry(CNodeObject *,Note *,CString,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataEntry();
virtual void Update();
virtual int GetName(char *,int);
BYTE GetKeyValue();
POSITION GetKeyPos();
};
class CNodeDataValue: public CNodeData
{
protected:
int m_iKeyType;
public:
CNodeDataValue(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValue();
int GetKeyType() {return m_iKeyType;}
virtual HANDLE ViewNode(CTreeCtrl *,HTREEITEM,int);
virtual int Paste(CNodeObject *);
};
//////////////////////////////////////////////////////////////////////
// CNodeDataValue Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDataValueFile: public CNodeDataValue
{
private:
// TODO: Maybe store the NodeDisk pointers in an array and make m_pNodeDisk a WORD index into that array
// to make the structure 4 bytes instead of 8 with 3 wasted bytes for alignment
CNodeDisk *m_pNodeDisk;
BYTE m_iParentDirs;
public:
CNodeDataValueFile(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFile();
CNodeDisk *GetNodeDisk() {return m_pNodeDisk;}
CNodeDisk *SetNodeDisk(CNodeDisk *);
virtual int UpdateSelf(CNodeObject *);
virtual int GetName(char *,int);
virtual int GetName(CString &);
};
class CNodeDataValueFloat: public CNodeDataValue
{
public:
CNodeDataValueFloat(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFloat();
};
class CNodeDataValuePoint3: public CNodeDataValue
{
public:
CNodeDataValuePoint3(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValuePoint3();
};
class CNodeDataValueBool: public CNodeDataValue
{
public:
CNodeDataValueBool(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueBool();
};
class CNodeDataValueString: public CNodeDataValue
{
public:
CNodeDataValueString(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueString();
};
class CNodeDataValueInt: public CNodeDataValue
{
public:
CNodeDataValueInt(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueInt();
};
class CNodeDataValueCompostTexture: public CNodeDataValue
{
public:
CNodeDataValueCompostTexture(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueCompostTexture();
};
class CNodeDataValueERF: public CNodeDataValue
{
protected:
ElementRenderer::Element *m_pElement;
public:
static CNodeDataValueERF *CreateChild(CNodeObject *,ElementRenderer::Element *,CString,CString );
CNodeDataValueERF(CNodeObject *,ElementRenderer::Element *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERF();
ElementRenderer::Element *GetElement() {return m_pElement;}
};
class CNodeDataValueMLRElement: public CNodeDataValue
{
protected:
MidLevelRenderer::MLRPrimitiveBase *m_pPrimitave;
public:
CNodeDataValueMLRElement(CNodeObject *,MidLevelRenderer::MLRPrimitiveBase *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueMLRElement();
MidLevelRenderer::MLRPrimitiveBase *GetPrimitave() {return m_pPrimitave;}
};
//////////////////////////////////////////////////////////////////////
// CNodeDataValueFile Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDataValueFileDoc;
class CNodeDataValueFileProject : public CNodeDataValueFile
{
protected:
CNodeDataValueFileDoc *m_pDoc;
public:
CNodeDataValueFileProject(CNodeDataValueFileDoc *,CString);
virtual ~CNodeDataValueFileProject();
CNodeDataValueFileDoc *GetDocument() {return m_pDoc;}
virtual int UpdateSelf(CNodeObject *);
};
class CNodeDataValueFileERF: public CNodeDataValueFile
{
public:
CNodeDataValueFileERF(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileERF();
virtual int UpdateSelf(CNodeObject *);
};
class CNodeDataValueFileWAV: public CNodeDataValueFile
{
public:
CNodeDataValueFileWAV(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileWAV();
};
class CNodeDataValueFileMW4ANIM: public CNodeDataValueFile
{
public:
CNodeDataValueFileMW4ANIM(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileMW4ANIM();
};
class CNodeDataValueFileTGA: public CNodeDataValueFile
{
public:
static CString GetTexturePath();
static CString FixName(CString,CNodeObject *);
CNodeDataValueFileTGA(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileTGA();
};
class CNodeDataValueFilePNG: public CNodeDataValueFile
{
public:
static CString GetTexturePath();
static CString FixName(CString,CNodeObject *);
CNodeDataValueFilePNG(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFilePNG();
};
class CNodeDataValueFileNote: public CNodeDataValueFile
{
public:
CNodeDataValueFileNote(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileNote();
virtual int UpdateSelf(CNodeObject *);
};
class CNodeDataValueFileBSP: public CNodeDataValueFile
{
public:
CNodeDataValueFileBSP(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileBSP();
};
class CNodeDataValueFileOBB: public CNodeDataValueFile
{
public:
CNodeDataValueFileOBB(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileOBB();
};
class CNodeDataValueFileABL: public CNodeDataValueFile
{
public:
CNodeDataValueFileABL(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileABL();
};
class CNodeDataValueFileResource: public CNodeDataValueFile
{
public:
CNodeDataValueFileResource(CNodeObject *,CString);
virtual ~CNodeDataValueFileResource();
};
class CNodeDataValueFileFGD: public CNodeDataValueFile
{
public:
CString FixName(CString);
CNodeDataValueFileFGD(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileFGD();
};
class CNodeDataValueFileMATERIAL: public CNodeDataValueFile
{
public:
CNodeDataValueFileMATERIAL(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileMATERIAL();
};
class CNodeDataValueFileRAW: public CNodeDataValueFile
{
public:
CNodeDataValueFileRAW(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileRAW();
};
class CNodeDataValueFileBID: public CNodeDataValueFile
{
public:
CNodeDataValueFileBID(CNodeObject *,CString,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueFileBID();
};
//////////////////////////////////////////////////////////////////////
// CNodeDataValueERF Derivatives
//////////////////////////////////////////////////////////////////////
class CNodeDataValueERFGroupElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFGroupElement(CNodeObject *,ElementRenderer::GroupElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFGroupElement();
};
class CNodeDataValueERFListElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFListElement(CNodeObject *,ElementRenderer::ListElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFListElement();
};
class CNodeDataValueERFGridElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFGridElement(CNodeObject *,ElementRenderer::GridElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFGridElement();
};
class CNodeDataValueERFLODElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFLODElement(CNodeObject *,ElementRenderer::ListElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFLODElement();
};
class CNodeDataValueERFShapeLODElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFShapeLODElement(CNodeObject *,ElementRenderer::ShapeLODElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFShapeLODElement();
};
class CNodeDataValueERFShapeElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFShapeElement(CNodeObject *,ElementRenderer::ShapeElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFShapeElement();
};
class CNodeDataValueERFSwitchElement: public CNodeDataValueERF
{
public:
CNodeDataValueERFSwitchElement(CNodeObject *,ElementRenderer::ListElement *,CNodeObject * = NULL,CString = "",CString = "");
virtual ~CNodeDataValueERFSwitchElement();
};
#endif // !defined(AFX_NODEOBJECT_H__38050511_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,126 @@
// NodeObjectReferenceView1.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "NodeObjectReferenceView1.h"
#include "NodeDataValueFileDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CNodeObjectReferenceView
IMPLEMENT_DYNCREATE(CNodeObjectReferenceView, CListView)
CNodeObjectReferenceView::CNodeObjectReferenceView()
{
}
CNodeObjectReferenceView::~CNodeObjectReferenceView()
{
}
BEGIN_MESSAGE_MAP(CNodeObjectReferenceView, CListView)
//{{AFX_MSG_MAP(CNodeObjectReferenceView)
ON_NOTIFY_REFLECT(LVN_ITEMCHANGED, OnItemchanged)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CNodeObjectReferenceView drawing
void CNodeObjectReferenceView::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CNodeObjectReferenceView diagnostics
#ifdef _DEBUG
void CNodeObjectReferenceView::AssertValid() const
{
CListView::AssertValid();
}
void CNodeObjectReferenceView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CNodeObjectReferenceView message handlers
BOOL CNodeObjectReferenceView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= LVS_REPORT | LVS_SHOWSELALWAYS | LVS_SINGLESEL;
return CListView::PreCreateWindow(cs);
}
void CNodeObjectReferenceView::OnInitialUpdate()
{
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->InsertColumn(0,"Object references",LVCFMT_LEFT,300);
CListView::OnInitialUpdate();
}
void CNodeObjectReferenceView::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->DeleteAllItems();
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
if (pDoc->m_pActiveChild)
{
CNodeObject *pNode = pDoc->m_pActiveChild;
while (pNode && !pNode->IsFile())
pNode = pNode->GetParentNode();
if (pNode)
{
CNodeDisk *pDisk = ((CNodeDataValueFile *)pNode)->GetNodeDisk();
int i=0;
POSITION pos = pDisk->GetFirstReference();
while (pos)
{
CNodeObject *pChild = pDisk->GetNextReference(pos);
// Find the file node to the disk
while (pChild && (!pChild->IsFile() ||(pChild->GetClassID() == CLASS_CNODEDATAVALUEFILEPROJECT)))
pChild = pChild->GetParentNode();
// Find the node that loaded this file
while (pChild && !pChild->IsFile())
pChild = pChild->GetParentNode();
if (pChild)
{
CNodeDisk *pDisk = ((CNodeDataValueFile *)pChild)->GetNodeDisk();
int index = pCtrl->InsertItem(i,pDisk->GetPath());
pCtrl->SetItemData(index,(DWORD)pChild);
i++;
}
}
}
}
}
}
void CNodeObjectReferenceView::OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;
if (pNMListView->uNewState & LVIS_SELECTED)
{
CNodeObject *pNode = (CNodeObject *)pNMListView->lParam;
if (pNode)
GetDocument()->UpdateAllViews(this,(DWORD)pNode,NULL);
}
*pResult = 0;
}
@@ -0,0 +1,57 @@
#if !defined(AFX_NODEOBJECTREFERENCEVIEW1_H__1B2F6D7C_C231_46BC_9A07_4BE4C583780C__INCLUDED_)
#define AFX_NODEOBJECTREFERENCEVIEW1_H__1B2F6D7C_C231_46BC_9A07_4BE4C583780C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NodeObjectReferenceView1.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CNodeObjectReferenceView view
class CNodeObjectReferenceView : public CListView
{
protected:
CNodeObjectReferenceView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CNodeObjectReferenceView)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNodeObjectReferenceView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CNodeObjectReferenceView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CNodeObjectReferenceView)
afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_NODEOBJECTREFERENCEVIEW1_H__1B2F6D7C_C231_46BC_9A07_4BE4C583780C__INCLUDED_)
@@ -0,0 +1,117 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : ContentTrack
========================================================================
AppWizard has created this ContentTrack 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 ContentTrack application.
ContentTrack.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.
ContentTrack.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CContentTrackApp application class.
ContentTrack.cpp
This is the main application source file that contains the application
class CContentTrackApp.
ContentTrack.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++.
ContentTrack.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\ContentTrack.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file ContentTrack.rc.
res\ContentTrack.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 ContentTrack.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:
ContentTrackDoc.h, ContentTrackDoc.cpp - the document
These files contain your CContentTrackDoc class. Edit these files to
add your special document data and to implement file saving and loading
(via CContentTrackDoc::Serialize).
ContentTrackView.h, ContentTrackView.cpp - the view of the document
These files contain your CContentTrackView class.
CContentTrackView objects are used to view CContentTrackDoc objects.
res\ContentTrackDoc.ico
This is an icon file, which is used as the icon for MDI child windows
for the CContentTrackDoc class. This icon is included by the main
resource file ContentTrack.rc.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named ContentTrack.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,8 @@
// stdafx.cpp : source file that includes just the standard includes
// ContentTrack.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,29 @@
// 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__38050500_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
#define AFX_STDAFX_H__38050500_782B_11D3_9C1F_00609712FBEF__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
#include <afxcview.h>
#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__38050500_782B_11D3_9C1F_00609712FBEF__INCLUDED_)
@@ -0,0 +1,72 @@
// UnusedFilesDoc.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "UnusedFilesDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesDoc
IMPLEMENT_DYNCREATE(CUnusedFilesDoc, CDocument)
CUnusedFilesDoc::CUnusedFilesDoc()
{
}
BOOL CUnusedFilesDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
return TRUE;
}
CUnusedFilesDoc::~CUnusedFilesDoc()
{
}
BEGIN_MESSAGE_MAP(CUnusedFilesDoc, CDocument)
//{{AFX_MSG_MAP(CUnusedFilesDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesDoc diagnostics
#ifdef _DEBUG
void CUnusedFilesDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CUnusedFilesDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesDoc serialization
void CUnusedFilesDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
// TODO: add storing code here
}
else
{
// TODO: add loading code here
}
}
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesDoc commands
@@ -0,0 +1,53 @@
#if !defined(AFX_UNUSEDFILESDOC_H__CB2C6069_790E_11D3_9C20_00609712FBEF__INCLUDED_)
#define AFX_UNUSEDFILESDOC_H__CB2C6069_790E_11D3_9C20_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UnusedFilesDoc.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesDoc document
class CUnusedFilesDoc : public CDocument
{
protected:
CUnusedFilesDoc(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CUnusedFilesDoc)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUnusedFilesDoc)
public:
virtual void Serialize(CArchive& ar); // overridden for document i/o
protected:
virtual BOOL OnNewDocument();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CUnusedFilesDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CUnusedFilesDoc)
// 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_UNUSEDFILESDOC_H__CB2C6069_790E_11D3_9C20_00609712FBEF__INCLUDED_)
@@ -0,0 +1,114 @@
// UnusedFilesView.cpp : implementation file
//
#include "stdafx.h"
#include "ContentTrack.h"
#include "UnusedFilesView.h"
#include "NodeDataValueFileDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesView
IMPLEMENT_DYNCREATE(CUnusedFilesView, CListView)
CUnusedFilesView::CUnusedFilesView()
{
}
CUnusedFilesView::~CUnusedFilesView()
{
}
BEGIN_MESSAGE_MAP(CUnusedFilesView, CListView)
//{{AFX_MSG_MAP(CUnusedFilesView)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesView drawing
void CUnusedFilesView::OnDraw(CDC* pDC)
{
// CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesView diagnostics
#ifdef _DEBUG
void CUnusedFilesView::AssertValid() const
{
CListView::AssertValid();
}
void CUnusedFilesView::Dump(CDumpContext& dc) const
{
CListView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesView message handlers
void CUnusedFilesView::OnInitialUpdate()
{
CListCtrl *pCtrl = &GetListCtrl();
pCtrl->InsertColumn(0,"Unused Files",LVCFMT_LEFT,500);
CListView::OnInitialUpdate();
if (GetDocument()->IsKindOf(RUNTIME_CLASS(CNodeDataValueFileDoc)))
{
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)GetDocument();
CNodeDisk *pNode = pDoc->GetRootNode();
InsertNode(pNode);
}
}
int CUnusedFilesView::InsertNode(CNodeDisk *pNode)
{
if (CLASS_CNODEDISKFILE == pNode->GetClassID())
{
int i = pNode->GetRefCount();
if (i == 1)
{
CListCtrl *pCtrl = &GetListCtrl();
CString name1;
pNode->GetName(name1);
name1.MakeUpper();
CString name2 = "VSSVER.SCC";
if (name1 != name2)
{
pCtrl->InsertItem(pCtrl->GetItemCount(),pNode->GetPath());
return 1;
}
}
return 0;
}
else if (CLASS_CNODEDISKDIRECTORY == pNode->GetClassID())
{
int x=0;
POSITION pos = pNode->GetFirstChild();
while (pos)
{
CNodeDisk *pChild = (CNodeDisk *)pNode->GetNextChild(pos);
x+= InsertNode(pChild);
}
return x;
}
return 0;
}
BOOL CUnusedFilesView::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style |= LVS_REPORT | LVS_SINGLESEL | LVS_SHOWSELALWAYS;
return CListView::PreCreateWindow(cs);
}
@@ -0,0 +1,57 @@
#if !defined(AFX_UNUSEDFILESVIEW_H__CB2C606A_790E_11D3_9C20_00609712FBEF__INCLUDED_)
#define AFX_UNUSEDFILESVIEW_H__CB2C606A_790E_11D3_9C20_00609712FBEF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// UnusedFilesView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CUnusedFilesView view
class CUnusedFilesView : public CListView
{
protected:
CUnusedFilesView(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CUnusedFilesView)
// Attributes
public:
// Operations
public:
int InsertNode(CNodeDisk *);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CUnusedFilesView)
public:
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CUnusedFilesView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CUnusedFilesView)
// 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_UNUSEDFILESVIEW_H__CB2C606A_790E_11D3_9C20_00609712FBEF__INCLUDED_)
@@ -0,0 +1,57 @@
// WizCopyMission.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "mainfrm.h"
#include "WizCopyMission.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWizCopyMission
IMPLEMENT_DYNAMIC(CWizCopyMission, CPropertySheet)
CWizCopyMission::CWizCopyMission(UINT nIDCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(nIDCaption, pParentWnd, iSelectPage)
{
}
CWizCopyMission::CWizCopyMission(LPCTSTR pszCaption, CWnd* pParentWnd, UINT iSelectPage)
:CPropertySheet(pszCaption, pParentWnd, iSelectPage)
{
}
CWizCopyMission::~CWizCopyMission()
{
}
BEGIN_MESSAGE_MAP(CWizCopyMission, CPropertySheet)
//{{AFX_MSG_MAP(CWizCopyMission)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWizCopyMission message handlers
BOOL CWizCopyMission::OnInitDialog()
{
BOOL bResult = CPropertySheet::OnInitDialog();
CFrameWnd *pFrame = GetParentFrame();
CMainFrame *pMainFrame = (CMainFrame *)pFrame;
CDocument *pDoc = pMainFrame->MDIGetActive()->GetActiveDocument();
m_pSrcDoc = (CNodeDataValueFileDoc *)pDoc;
m_pDstDoc = NULL;
m_bRename = false;
return bResult;
}
@@ -0,0 +1,59 @@
#if !defined(AFX_WIZCOPYMISSION_H__D28E2CD1_8F47_4BCA_85CA_A4C04091ED41__INCLUDED_)
#define AFX_WIZCOPYMISSION_H__D28E2CD1_8F47_4BCA_85CA_A4C04091ED41__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WizCopyMission.h : header file
//
#include "NodeDataValueFileDoc.h"
/////////////////////////////////////////////////////////////////////////////
// CWizCopyMission
class CWizCopyMission : public CPropertySheet
{
DECLARE_DYNAMIC(CWizCopyMission)
// Construction
public:
CWizCopyMission(UINT nIDCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
CWizCopyMission(LPCTSTR pszCaption, CWnd* pParentWnd = NULL, UINT iSelectPage = 0);
// Attributes
public:
CNodeDataValueFileDoc *m_pSrcDoc,*m_pDstDoc;
CString m_strMission;
BOOL m_bRename;
CString m_strRename;
CString m_strName;
CPtrList m_listCopyDir;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CWizCopyMission)
public:
virtual BOOL OnInitDialog();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CWizCopyMission();
// Generated message map functions
protected:
//{{AFX_MSG(CWizCopyMission)
// 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_WIZCOPYMISSION_H__D28E2CD1_8F47_4BCA_85CA_A4C04091ED41__INCLUDED_)
@@ -0,0 +1,250 @@
// WizPageMission.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "WizPageMission.h"
#include "WizCopyMission.h"
#include "mainfrm.h"
#include <GameOS\ToolOS.hpp>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWizPageMission property page
IMPLEMENT_DYNCREATE(CWizPageMission, CPropertyPage)
CWizPageMission::CWizPageMission() : CPropertyPage(CWizPageMission::IDD)
{
//{{AFX_DATA_INIT(CWizPageMission)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CWizPageMission::~CWizPageMission()
{
}
void CWizPageMission::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWizPageMission)
DDX_Control(pDX, IDC_EDIT_NAME, m_ctrlName);
DDX_Control(pDX, IDC_CHECK_RENAME, m_checkRename);
DDX_Control(pDX, IDC_LISTMISSION, m_ctrlList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWizPageMission, CPropertyPage)
//{{AFX_MSG_MAP(CWizPageMission)
ON_WM_DESTROY()
ON_LBN_SELCHANGE(IDC_LISTMISSION, OnSelchangeListmission)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWizPageMission message handlers
BOOL CWizPageMission::OnSetActive()
{
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->SetWizardButtons(NULL);
return CPropertyPage::OnSetActive();
}
BOOL CWizPageMission::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// Open the Resources.build to determine which missions are available
CFrameWnd *pFrame = GetParentFrame();
CMainFrame *pMainFrame = (CMainFrame *)pFrame;
CDocument *pDoc = pMainFrame->MDIGetActive()->GetActiveDocument();
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->m_pSrcDoc = (CNodeDataValueFileDoc *)pDoc;
// Open Resources.build
static int check1 = 1;
CNodeDisk *pDisk = pParent->m_pSrcDoc->FindDirectoryNode("content\\resources.build");
if (pDisk&& pDisk->IsLoaded())
{
POSITION pos = pDisk->GetFirstChild();
CNodeObject *pNodeMain = NULL;
while (pos &&(NULL == pNodeMain))
{
CNodeObject *pNode = pDisk->GetNextChild(pos);
CString name;
pNode->GetName(name);
// name.MakeLower();
// if (name == CString("resources\\main"))
if (0 == stricmp(name,"resources\\main"))
{
pNodeMain = pNode;
}
}
if (NULL != pNodeMain)
{
// Look for each instance node, and find each one that points to the mission directory
pos = pNodeMain->GetFirstChild();
while (pos)
{
CNodeObject *pNode = pNodeMain->GetNextChild(pos);
CString name;
pNode->GetName(name);
// name.MakeLower();
// if (name == CString("instance"))
if (0 == stricmp(name,"instance"))
{
POSITION pos1 = pNode->GetFirstChild();
while (pos)
{
CNodeObject *pNode1 = pNode->GetNextChild(pos1);
CString name1;
pNode1->GetName(name1);
if (stricmp(name1,"missions")==0)
{
// We have a mission here
char drive[MAX_PATH],dir[MAX_PATH],fname[MAX_PATH],ext[MAX_PATH];
_splitpath(name1,drive,dir,fname,ext);
int index = m_ctrlList.AddString(fname);
// VERY IMPORTANT: be sure to delete these string during destruction
CString *pString = new CString(name1);
Register_Pointer(pString);
m_ctrlList.SetItemData(index,(DWORD)pString);
}
}
}
}
}
else
{
// Invalid resources.build file
int x=1;
}
}
else
{
// resources.build is not already loaded so we have to scan it manually
SetCurrentDirectory(pParent->m_pSrcDoc->GetRootDir());
if (gos_DoesFileExist("content\\resources.build"))
{
NotationFile notefile("content\\resources.build");
Page *page = notefile.FindPage("resources\\main");
if (page)
{
Check_Object(page);
Page::NoteIterator *entries = page->MakeNoteIterator();
Check_Object(entries);
Note *entry;
// Enumerate the entries in the section
while ((entry = entries->ReadAndNext()) != NULL)
{
Check_Object(entry);
CString key(entry->GetName());
//key.MakeLower();
//if (key == "instance")
if (0 == stricmp(key,"instance"))
{
const char *value;
entry->GetEntry(&value);
if (strnicmp(value,"missions",8)==0)
{
// We have a mission here
char drive[MAX_PATH],dir[MAX_PATH],fname[MAX_PATH],ext[MAX_PATH];
_splitpath(value,drive,dir,fname,ext);
int index = m_ctrlList.AddString(fname);
// VERY IMPORTANT: be sure to delete these string during destruction
CString *pString = new CString(value);
Register_Pointer(pString);
m_ctrlList.SetItemData(index,(DWORD)pString);
}
}
}
Check_Object(entries);
delete entries;
}
else
{
// Invalid resoures.build file
int x=1;
}
}
else
{
// We have no resources.build file
int x=1;
}
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CWizPageMission::OnDestroy()
{
CPropertyPage::OnDestroy();
while (m_ctrlList.GetCount())
{
CString *pString = (CString *)m_ctrlList.GetItemData(0);
Unregister_Pointer(pString);
delete pString;
m_ctrlList.DeleteString(0);
}
}
void CWizPageMission::OnSelchangeListmission()
{
if (LB_ERR != m_ctrlList.GetCurSel())
{
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->SetWizardButtons(PSWIZB_NEXT);
}
}
BOOL CWizPageMission::OnWizardFinish()
{
// This shouldn't be called
int index = m_ctrlList.GetCurSel();
CString *pString = (CString *)m_ctrlList.GetItemData(index);
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->m_strMission= *pString;
if (this->m_checkRename.GetCheck())
{
pParent->m_bRename = true;
this->m_ctrlName.GetWindowText(pParent->m_strRename);
}
return CPropertyPage::OnWizardFinish();
}
LRESULT CWizPageMission::OnWizardNext()
{
int index = m_ctrlList.GetCurSel();
CString strName;
m_ctrlList.GetText(index,strName);
CString *pString = (CString *)m_ctrlList.GetItemData(index);
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->m_strName = strName;
pParent->m_strMission= *pString;
if (this->m_checkRename.GetCheck())
{
pParent->m_bRename = true;
this->m_ctrlName.GetWindowText(pParent->m_strRename);
}
return CPropertyPage::OnWizardNext();
}
@@ -0,0 +1,57 @@
#if !defined(AFX_WIZPAGEMISSION_H__EB0ADDDC_4E45_4D1C_9D4E_ADBBBDF6D446__INCLUDED_)
#define AFX_WIZPAGEMISSION_H__EB0ADDDC_4E45_4D1C_9D4E_ADBBBDF6D446__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WizPageMission.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CWizPageMission dialog
class CWizPageMission : public CPropertyPage
{
DECLARE_DYNCREATE(CWizPageMission)
// Construction
public:
CWizPageMission();
~CWizPageMission();
// Dialog Data
//{{AFX_DATA(CWizPageMission)
enum { IDD = IDD_WIZ_SELECTMISSION };
CEdit m_ctrlName;
CButton m_checkRename;
CListBox m_ctrlList;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CWizPageMission)
public:
virtual BOOL OnSetActive();
virtual BOOL OnWizardFinish();
virtual LRESULT OnWizardNext();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CWizPageMission)
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
afx_msg void OnSelchangeListmission();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WIZPAGEMISSION_H__EB0ADDDC_4E45_4D1C_9D4E_ADBBBDF6D446__INCLUDED_)
@@ -0,0 +1,164 @@
// WizPageProject.cpp : implementation file
//
#include "stdafx.h"
#include "contenttrack.h"
#include "WizPageProject.h"
#include "mainfrm.h"
#include "WizCopyMission.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CWizPageProject property page
IMPLEMENT_DYNCREATE(CWizPageProject, CPropertyPage)
CWizPageProject::CWizPageProject() : CPropertyPage(CWizPageProject::IDD)
{
//{{AFX_DATA_INIT(CWizPageProject)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CWizPageProject::~CWizPageProject()
{
}
void CWizPageProject::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CWizPageProject)
DDX_Control(pDX, IDC_LIST_COPYDIR, m_ctrlListCopy);
DDX_Control(pDX, IDC_LISTPROJECT, m_ctrlList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CWizPageProject, CPropertyPage)
//{{AFX_MSG_MAP(CWizPageProject)
ON_LBN_SELCHANGE(IDC_LISTPROJECT, OnSelchangeListproject)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CWizPageProject message handlers
BOOL CWizPageProject::OnSetActive()
{
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_DISABLEDFINISH);
// Remove all items
while (m_ctrlList.GetCount())
m_ctrlList.DeleteString(0);
// Add all open projects except for this one
CFrameWnd *pFrame = GetParentFrame();
CMainFrame *pMainFrame = (CMainFrame *)pFrame;
CDocument *pDoc = pMainFrame->MDIGetActive()->GetActiveDocument();
CWinApp *pApp = AfxGetApp();
POSITION pos = pApp->GetFirstDocTemplatePosition();
while (pos)
{
CDocTemplate *pTemplate = pApp->GetNextDocTemplate(pos);
POSITION posT = pTemplate->GetFirstDocPosition();
while (posT)
{
CDocument *pDocT = pTemplate->GetNextDoc(posT);
if (pParent->m_bRename || (pDocT != pDoc))
{
int index = m_ctrlList.AddString(pDocT->GetTitle());
m_ctrlList.SetItemData(index,(DWORD)pDocT);
}
}
}
while (this->m_ctrlListCopy.GetCount())
m_ctrlListCopy.DeleteString(0);
CNodeDisk *pDisk = pParent->m_pSrcDoc->GetRootNode();
pos = pDisk->GetFirstChild();
while (pos)
{
CNodeObject *pChild = pDisk->GetNextChild(pos);
if (pChild->GetClassID() == CLASS_CNODEDISKDIRECTORY)
{
CString strName;
pChild->GetName(strName);
int index = m_ctrlListCopy.AddString(strName);
m_ctrlListCopy.SetItemData(index,(DWORD)pChild);
// By default, select these two directories
if ((0 == strnicmp(strName,"maps",4)) || (0 == strnicmp(strName,"missions",8)))
{
m_ctrlListCopy.SetSel(index);
}
}
}
return CPropertyPage::OnSetActive();
}
LRESULT CWizPageProject::OnWizardNext()
{
int index = m_ctrlList.GetCurSel();
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)m_ctrlList.GetItemData(index);
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->m_pDstDoc = pDoc;
pParent->m_listCopyDir.RemoveAll();
int count = m_ctrlListCopy.GetSelCount();
int *items = new int(count);
m_ctrlListCopy.GetSelItems(count,items);
for (int x=0;x<count;x++)
{
CNodeObject *pObj = (CNodeObject *)m_ctrlListCopy.GetItemData(items[x]);
pParent->m_listCopyDir.AddHead(pObj);
}
delete items;
return CPropertyPage::OnWizardNext();
}
BOOL CWizPageProject::OnInitDialog()
{
CPropertyPage::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CWizPageProject::OnSelchangeListproject()
{
if (LB_ERR != m_ctrlList.GetCurSel())
{
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->SetWizardButtons(PSWIZB_BACK | PSWIZB_FINISH);
}
}
BOOL CWizPageProject::OnWizardFinish()
{
int index = m_ctrlList.GetCurSel();
CNodeDataValueFileDoc *pDoc = (CNodeDataValueFileDoc *)m_ctrlList.GetItemData(index);
CWizCopyMission *pParent = (CWizCopyMission *)GetParent();
pParent->m_pDstDoc = pDoc;
pParent->m_listCopyDir.RemoveAll();
int count = m_ctrlListCopy.GetSelCount();
// BUGBUG**
// Dont think we'll have more than 100 items, but the delete operator crashes here
int items[100];
m_ctrlListCopy.GetSelItems(100,items);
for (int x=0;x<count;x++)
{
CNodeObject *pObj = (CNodeObject *)m_ctrlListCopy.GetItemData(items[x]);
pParent->m_listCopyDir.AddHead(pObj);
}
return CPropertyPage::OnWizardFinish();
}
@@ -0,0 +1,55 @@
#if !defined(AFX_WIZPAGEPROJECT_H__7EE18333_D4AB_4643_9DDC_1C46F1E5DB55__INCLUDED_)
#define AFX_WIZPAGEPROJECT_H__7EE18333_D4AB_4643_9DDC_1C46F1E5DB55__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// WizPageProject.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CWizPageProject dialog
class CWizPageProject : public CPropertyPage
{
DECLARE_DYNCREATE(CWizPageProject)
// Construction
public:
CWizPageProject();
~CWizPageProject();
// Dialog Data
//{{AFX_DATA(CWizPageProject)
enum { IDD = IDD_WIZ_SELECTPROJECT };
CListBox m_ctrlListCopy;
CListBox m_ctrlList;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CWizPageProject)
public:
virtual BOOL OnSetActive();
virtual LRESULT OnWizardNext();
virtual BOOL OnWizardFinish();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CWizPageProject)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeListproject();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_WIZPAGEPROJECT_H__7EE18333_D4AB_4643_9DDC_1C46F1E5DB55__INCLUDED_)
File diff suppressed because it is too large Load Diff
Binary file not shown.
@@ -0,0 +1,13 @@
//
// CONTENTTRACK.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.
@@ -0,0 +1,250 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by ContentTrack.rc
//
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_CONTENTYPE 129
#define IDD_DIALOG_KEYTYPE 130
#define IDD_DIALOG_EDITKEYTYPE 131
#define IDD_FIND 132
#define IDD_WIZ_SELECTPROJECT 133
#define IDD_WIZ_SELECTMISSION 134
#define IDD_PASTE_RENAME 135
#define IDD_WIZ_CREATEMAP 136
#define IDC_MODIFY 1000
#define IDC_ADD 1001
#define IDC_REMOVE 1002
#define IDC_LIST_TYPES 1003
#define IDC_EDIT_KEYTYPE 1004
#define IDC_COMBO_KEYTYPE 1005
#define IDC_EDIT1 1006
#define IDC_CHECK_KEYS 1007
#define IDC_CHECK_VALUE 1008
#define IDC_LIST_KEYTYPE 1009
#define IDC_LISTPROJECT 1010
#define IDC_NEWPROJECT 1011
#define IDC_OPENPROJECT 1012
#define IDC_LISTMISSION 1013
#define IDC_CHECK_RENAME 1014
#define IDC_EDIT_NAME 1015
#define IDC_EDIT_NEW 1016
#define IDC_EDIT_OLD 1017
#define IDC_LIST_COPYDIR 1018
#define IDC_RADIO1 1019
#define IDC_RADIO2 1020
#define IDC_RADIO3 1021
#define ID_EDIT_KEYTYPE 32771
#define ID_UNUSEDFILES 32772
#define ID_EXPANDALL 32773
#define ID_MISSINGFILES 32774
#define ID_FIND 32775
#define ID_REFERENCES 32777
#define ID_ADDROOT 32778
#define ID_WIZ_COPYMAP 32779
#define ID_WIZ_COPYMISSION 32780
#define ID_WIZ_COPYMECH 32781
#define ID_EDIT_PASTE_RENAME 32782
#define ID_VIEW_EDITKEY 32783
#define ID_DIRECTORY 32784
#define ID_CREATEMAP 32785
#define ID_WIZ_CREATEMAP 32786
#define IDR_MAPS_MAPDATA_1K_FIRSTTEMPLATE 10001
#define IDR_MAPS_MAPDATA_1K_1kmap_data 10001
#define IDR_MAPS_MAPDATA_1K_1kmap_instance 10002
#define IDR_MAPS_MAPDATA_1K_DropZone_data 10003
#define IDR_MAPS_MAPDATA_1K_1kmap_erf 10004
#define IDR_MAPS_MAPDATA_1K_1kmap_fgd 10005
#define IDR_MAPS_MAPDATA_1K_AA_bsp 10006
#define IDR_MAPS_MAPDATA_1K_AA_erf 10007
#define IDR_MAPS_MAPDATA_1K_LASTTEMPLATE 10007
#define IDR_MAPS_MAPDATA_2K_FIRSTTEMPLATE 10201
#define IDR_MAPS_MAPDATA_2K_2kmap_data 10201
#define IDR_MAPS_MAPDATA_2K_2kmap_instance 10202
#define IDR_MAPS_MAPDATA_2K_DropZone_data 10203
#define IDR_MAPS_MAPDATA_2K_2kmap_erf 10204
#define IDR_MAPS_MAPDATA_2K_2kmap_fgd 10205
#define IDR_MAPS_MAPDATA_2K_AA_bsp 10206
#define IDR_MAPS_MAPDATA_2K_AA_erf 10207
#define IDR_MAPS_MAPDATA_2K_AB_bsp 10208
#define IDR_MAPS_MAPDATA_2K_AB_erf 10209
#define IDR_MAPS_MAPDATA_2K_BA_bsp 10210
#define IDR_MAPS_MAPDATA_2K_BA_erf 10211
#define IDR_MAPS_MAPDATA_2K_BB_bsp 10212
#define IDR_MAPS_MAPDATA_2K_BB_erf 10213
#define IDR_MAPS_MAPDATA_2K_LASTTEMPLATE 10213
#define IDR_MAPS_MAPDATA_4K_FIRSTTEMPLATE 10401
#define IDR_MAPS_MAPDATA_4K_4kmap_data 10401
#define IDR_MAPS_MAPDATA_4K_4kmap_instance 10402
#define IDR_MAPS_MAPDATA_4K_DropZone_data 10403
#define IDR_MAPS_MAPDATA_4K_4kmap_erf 10404
#define IDR_MAPS_MAPDATA_4K_4kmap_fgd 10405
#define IDR_MAPS_MAPDATA_4K_AA_bsp 10406
#define IDR_MAPS_MAPDATA_4K_AA_erf 10407
#define IDR_MAPS_MAPDATA_4K_AB_bsp 10408
#define IDR_MAPS_MAPDATA_4K_AB_erf 10409
#define IDR_MAPS_MAPDATA_4K_AC_bsp 10410
#define IDR_MAPS_MAPDATA_4K_AC_erf 10411
#define IDR_MAPS_MAPDATA_4K_AD_bsp 10412
#define IDR_MAPS_MAPDATA_4K_AD_erf 10413
#define IDR_MAPS_MAPDATA_4K_BA_bsp 10414
#define IDR_MAPS_MAPDATA_4K_BA_erf 10415
#define IDR_MAPS_MAPDATA_4K_BB_bsp 10416
#define IDR_MAPS_MAPDATA_4K_BB_erf 10417
#define IDR_MAPS_MAPDATA_4K_BC_bsp 10418
#define IDR_MAPS_MAPDATA_4K_BC_erf 10419
#define IDR_MAPS_MAPDATA_4K_BD_bsp 10420
#define IDR_MAPS_MAPDATA_4K_BD_erf 10421
#define IDR_MAPS_MAPDATA_4K_CA_bsp 10422
#define IDR_MAPS_MAPDATA_4K_CA_erf 10423
#define IDR_MAPS_MAPDATA_4K_CB_bsp 10424
#define IDR_MAPS_MAPDATA_4K_CB_erf 10425
#define IDR_MAPS_MAPDATA_4K_CC_bsp 10426
#define IDR_MAPS_MAPDATA_4K_CC_erf 10427
#define IDR_MAPS_MAPDATA_4K_CD_bsp 10428
#define IDR_MAPS_MAPDATA_4K_CD_erf 10429
#define IDR_MAPS_MAPDATA_4K_DA_bsp 10430
#define IDR_MAPS_MAPDATA_4K_DA_erf 10431
#define IDR_MAPS_MAPDATA_4K_DB_bsp 10432
#define IDR_MAPS_MAPDATA_4K_DB_erf 10433
#define IDR_MAPS_MAPDATA_4K_DC_bsp 10434
#define IDR_MAPS_MAPDATA_4K_DC_erf 10435
#define IDR_MAPS_MAPDATA_4K_DD_bsp 10436
#define IDR_MAPS_MAPDATA_4K_DD_erf 10437
#define IDR_MAPS_MAPDATA_4K_LASTTEMPLATE 10437
#define IDR_MAPS_TEXTURES_1K_START 20000
#define IDR_MAPS_TEXTURES_1K_Highland_Detail_tga 20000
#define IDR_MAPS_TEXTURES_1K_AA_1kmap_AA_0_0000_Tga 20001
#define IDR_MAPS_TEXTURES_1K_AA_1kmap_AA_1_0000_Tga 20002
#define IDR_MAPS_TEXTURES_1K_AA_1kmap_AA_1_0001_Tga 20003
#define IDR_MAPS_TEXTURES_1K_AA_1kmap_AA_1_0100_Tga 20004
#define IDR_MAPS_TEXTURES_1K_AA_1kmap_AA_1_0101_Tga 20005
#define IDR_MAPS_TEXTURES_1K_END 20005
#define IDR_MAPS_TEXTURES_2K_START 20100
#define IDR_MAPS_TEXTURES_2K_Highland_Detail_tga 20100
#define IDR_MAPS_TEXTURES_2K_AA_2kmap_AA_0_0000_Tga 20101
#define IDR_MAPS_TEXTURES_2K_AA_2kmap_AA_1_0000_Tga 20102
#define IDR_MAPS_TEXTURES_2K_AA_2kmap_AA_1_0001_Tga 20103
#define IDR_MAPS_TEXTURES_2K_AA_2kmap_AA_1_0100_Tga 20104
#define IDR_MAPS_TEXTURES_2K_AA_2kmap_AA_1_0101_Tga 20105
#define IDR_MAPS_TEXTURES_2K_AB_2kmap_AB_0_0000_Tga 20106
#define IDR_MAPS_TEXTURES_2K_AB_2kmap_AB_1_0000_Tga 20107
#define IDR_MAPS_TEXTURES_2K_AB_2kmap_AB_1_0001_Tga 20108
#define IDR_MAPS_TEXTURES_2K_AB_2kmap_AB_1_0100_Tga 20109
#define IDR_MAPS_TEXTURES_2K_AB_2kmap_AB_1_0101_Tga 20110
#define IDR_MAPS_TEXTURES_2K_BA_2kmap_BA_0_0000_Tga 20111
#define IDR_MAPS_TEXTURES_2K_BA_2kmap_BA_1_0000_Tga 20112
#define IDR_MAPS_TEXTURES_2K_BA_2kmap_BA_1_0001_Tga 20113
#define IDR_MAPS_TEXTURES_2K_BA_2kmap_BA_1_0100_Tga 20114
#define IDR_MAPS_TEXTURES_2K_BA_2kmap_BA_1_0101_Tga 20115
#define IDR_MAPS_TEXTURES_2K_BB_2kmap_BB_0_0000_Tga 20116
#define IDR_MAPS_TEXTURES_2K_BB_2kmap_BB_1_0000_Tga 20117
#define IDR_MAPS_TEXTURES_2K_BB_2kmap_BB_1_0001_Tga 20118
#define IDR_MAPS_TEXTURES_2K_BB_2kmap_BB_1_0100_Tga 20119
#define IDR_MAPS_TEXTURES_2K_BB_2kmap_BB_1_0101_Tga 20120
#define IDR_MAPS_TEXTURES_2K_END 20120
#define IDR_MAPS_TEXTURES_4K_START 20200
#define IDR_MAPS_TEXTURES_4K_Highland_Detail_tga 20200
#define IDR_MAPS_TEXTURES_4K_AA_4kmap_AA_0_0000_Tga 20201
#define IDR_MAPS_TEXTURES_4K_AA_4kmap_AA_1_0000_Tga 20202
#define IDR_MAPS_TEXTURES_4K_AA_4kmap_AA_1_0001_Tga 20203
#define IDR_MAPS_TEXTURES_4K_AA_4kmap_AA_1_0100_Tga 20204
#define IDR_MAPS_TEXTURES_4K_AA_4kmap_AA_1_0101_Tga 20205
#define IDR_MAPS_TEXTURES_4K_AB_4kmap_AB_0_0000_Tga 20206
#define IDR_MAPS_TEXTURES_4K_AB_4kmap_AB_1_0000_Tga 20207
#define IDR_MAPS_TEXTURES_4K_AB_4kmap_AB_1_0001_Tga 20208
#define IDR_MAPS_TEXTURES_4K_AB_4kmap_AB_1_0100_Tga 20209
#define IDR_MAPS_TEXTURES_4K_AB_4kmap_AB_1_0101_Tga 20210
#define IDR_MAPS_TEXTURES_4K_AC_4kmap_AC_0_0000_Tga 20211
#define IDR_MAPS_TEXTURES_4K_AC_4kmap_AC_1_0000_Tga 20212
#define IDR_MAPS_TEXTURES_4K_AC_4kmap_AC_1_0001_Tga 20213
#define IDR_MAPS_TEXTURES_4K_AC_4kmap_AC_1_0100_Tga 20214
#define IDR_MAPS_TEXTURES_4K_AC_4kmap_AC_1_0101_Tga 20215
#define IDR_MAPS_TEXTURES_4K_AD_4kmap_AD_0_0000_Tga 20216
#define IDR_MAPS_TEXTURES_4K_AD_4kmap_AD_1_0000_Tga 20217
#define IDR_MAPS_TEXTURES_4K_AD_4kmap_AD_1_0001_Tga 20218
#define IDR_MAPS_TEXTURES_4K_AD_4kmap_AD_1_0100_Tga 20219
#define IDR_MAPS_TEXTURES_4K_AD_4kmap_AD_1_0101_Tga 20220
#define IDR_MAPS_TEXTURES_4K_BA_4kmap_BA_0_0000_Tga 20221
#define IDR_MAPS_TEXTURES_4K_BA_4kmap_BA_1_0000_Tga 20222
#define IDR_MAPS_TEXTURES_4K_BA_4kmap_BA_1_0001_Tga 20223
#define IDR_MAPS_TEXTURES_4K_BA_4kmap_BA_1_0100_Tga 20224
#define IDR_MAPS_TEXTURES_4K_BA_4kmap_BA_1_0101_Tga 20225
#define IDR_MAPS_TEXTURES_4K_BB_4kmap_BB_0_0000_Tga 20226
#define IDR_MAPS_TEXTURES_4K_BB_4kmap_BB_1_0000_Tga 20227
#define IDR_MAPS_TEXTURES_4K_BB_4kmap_BB_1_0001_Tga 20228
#define IDR_MAPS_TEXTURES_4K_BB_4kmap_BB_1_0100_Tga 20229
#define IDR_MAPS_TEXTURES_4K_BB_4kmap_BB_1_0101_Tga 20230
#define IDR_MAPS_TEXTURES_4K_BC_4kmap_BC_0_0000_Tga 20231
#define IDR_MAPS_TEXTURES_4K_BC_4kmap_BC_1_0000_Tga 20232
#define IDR_MAPS_TEXTURES_4K_BC_4kmap_BC_1_0001_Tga 20233
#define IDR_MAPS_TEXTURES_4K_BC_4kmap_BC_1_0100_Tga 20234
#define IDR_MAPS_TEXTURES_4K_BC_4kmap_BC_1_0101_Tga 20235
#define IDR_MAPS_TEXTURES_4K_BD_4kmap_BD_0_0000_Tga 20236
#define IDR_MAPS_TEXTURES_4K_BD_4kmap_BD_1_0000_Tga 20237
#define IDR_MAPS_TEXTURES_4K_BD_4kmap_BD_1_0001_Tga 20238
#define IDR_MAPS_TEXTURES_4K_BD_4kmap_BD_1_0100_Tga 20239
#define IDR_MAPS_TEXTURES_4K_BD_4kmap_BD_1_0101_Tga 20240
#define IDR_MAPS_TEXTURES_4K_CA_4kmap_CA_0_0000_Tga 20241
#define IDR_MAPS_TEXTURES_4K_CA_4kmap_CA_1_0000_Tga 20242
#define IDR_MAPS_TEXTURES_4K_CA_4kmap_CA_1_0001_Tga 20243
#define IDR_MAPS_TEXTURES_4K_CA_4kmap_CA_1_0100_Tga 20244
#define IDR_MAPS_TEXTURES_4K_CA_4kmap_CA_1_0101_Tga 20245
#define IDR_MAPS_TEXTURES_4K_CB_4kmap_CB_0_0000_Tga 20246
#define IDR_MAPS_TEXTURES_4K_CB_4kmap_CB_1_0000_Tga 20247
#define IDR_MAPS_TEXTURES_4K_CB_4kmap_CB_1_0001_Tga 20248
#define IDR_MAPS_TEXTURES_4K_CB_4kmap_CB_1_0100_Tga 20249
#define IDR_MAPS_TEXTURES_4K_CB_4kmap_CB_1_0101_Tga 20250
#define IDR_MAPS_TEXTURES_4K_CC_4kmap_CC_0_0000_Tga 20251
#define IDR_MAPS_TEXTURES_4K_CC_4kmap_CC_1_0000_Tga 20252
#define IDR_MAPS_TEXTURES_4K_CC_4kmap_CC_1_0001_Tga 20253
#define IDR_MAPS_TEXTURES_4K_CC_4kmap_CC_1_0100_Tga 20254
#define IDR_MAPS_TEXTURES_4K_CC_4kmap_CC_1_0101_Tga 20255
#define IDR_MAPS_TEXTURES_4K_CD_4kmap_CD_0_0000_Tga 20256
#define IDR_MAPS_TEXTURES_4K_CD_4kmap_CD_1_0000_Tga 20257
#define IDR_MAPS_TEXTURES_4K_CD_4kmap_CD_1_0001_Tga 20258
#define IDR_MAPS_TEXTURES_4K_CD_4kmap_CD_1_0100_Tga 20259
#define IDR_MAPS_TEXTURES_4K_CD_4kmap_CD_1_0101_Tga 20260
#define IDR_MAPS_TEXTURES_4K_DA_4kmap_DA_0_0000_Tga 20261
#define IDR_MAPS_TEXTURES_4K_DA_4kmap_DA_1_0000_Tga 20262
#define IDR_MAPS_TEXTURES_4K_DA_4kmap_DA_1_0001_Tga 20263
#define IDR_MAPS_TEXTURES_4K_DA_4kmap_DA_1_0100_Tga 20264
#define IDR_MAPS_TEXTURES_4K_DA_4kmap_DA_1_0101_Tga 20265
#define IDR_MAPS_TEXTURES_4K_DB_4kmap_DB_0_0000_Tga 20266
#define IDR_MAPS_TEXTURES_4K_DB_4kmap_DB_1_0000_Tga 20267
#define IDR_MAPS_TEXTURES_4K_DB_4kmap_DB_1_0001_Tga 20268
#define IDR_MAPS_TEXTURES_4K_DB_4kmap_DB_1_0100_Tga 20269
#define IDR_MAPS_TEXTURES_4K_DB_4kmap_DB_1_0101_Tga 20270
#define IDR_MAPS_TEXTURES_4K_DC_4kmap_DC_0_0000_Tga 20271
#define IDR_MAPS_TEXTURES_4K_DC_4kmap_DC_1_0000_Tga 20272
#define IDR_MAPS_TEXTURES_4K_DC_4kmap_DC_1_0001_Tga 20273
#define IDR_MAPS_TEXTURES_4K_DC_4kmap_DC_1_0100_Tga 20274
#define IDR_MAPS_TEXTURES_4K_DC_4kmap_DC_1_0101_Tga 20275
#define IDR_MAPS_TEXTURES_4K_DD_4kmap_DD_0_0000_Tga 20276
#define IDR_MAPS_TEXTURES_4K_DD_4kmap_DD_1_0000_Tga 20277
#define IDR_MAPS_TEXTURES_4K_DD_4kmap_DD_1_0001_Tga 20278
#define IDR_MAPS_TEXTURES_4K_DD_4kmap_DD_1_0100_Tga 20279
#define IDR_MAPS_TEXTURES_4K_DD_4kmap_DD_1_0101_Tga 20280
#define IDR_MAPS_TEXTURES_4K_END 20280
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 137
#define _APS_NEXT_COMMAND_VALUE 32787
#define _APS_NEXT_CONTROL_VALUE 1022
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif