diff --git a/Utils/MapEdit/ChildFrm.cpp b/Utils/MapEdit/ChildFrm.cpp new file mode 100644 index 000000000..6ddaf36cf --- /dev/null +++ b/Utils/MapEdit/ChildFrm.cpp @@ -0,0 +1,70 @@ +// ChildFrm.cpp : implementation of the CChildFrame class +// + +#include "stdafx.h" +#include "MapEdit.h" + +#include "ChildFrm.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CChildFrame + +IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd) + +BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd) + //{{AFX_MSG_MAP(CChildFrame) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CChildFrame construction/destruction + +CChildFrame::CChildFrame() +{ + // TODO: add member initialization code here + +} + +CChildFrame::~CChildFrame() +{ +} + +BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: Modify the Window class or styles here by modifying + // the CREATESTRUCT cs + + if( !CMDIChildWnd::PreCreateWindow(cs) ) + return FALSE; + + return TRUE; +} + + + +///////////////////////////////////////////////////////////////////////////// +// CChildFrame diagnostics + +#ifdef _DEBUG +void CChildFrame::AssertValid() const +{ + CMDIChildWnd::AssertValid(); +} + +void CChildFrame::Dump(CDumpContext& dc) const +{ + CMDIChildWnd::Dump(dc); +} + +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CChildFrame message handlers diff --git a/Utils/MapEdit/ChildFrm.h b/Utils/MapEdit/ChildFrm.h new file mode 100644 index 000000000..c12f4c1b0 --- /dev/null +++ b/Utils/MapEdit/ChildFrm.h @@ -0,0 +1,53 @@ +// ChildFrm.h : interface of the CChildFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_CHILDFRM_H__13F6CD26_1D0B_4F0C_B05B_5BCD959B5AFC__INCLUDED_) +#define AFX_CHILDFRM_H__13F6CD26_1D0B_4F0C_B05B_5BCD959B5AFC__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +class CChildFrame : public CMDIChildWnd +{ + DECLARE_DYNCREATE(CChildFrame) +public: + CChildFrame(); + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CChildFrame) + virtual BOOL PreCreateWindow(CREATESTRUCT& cs); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CChildFrame(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +// Generated message map functions +protected: + //{{AFX_MSG(CChildFrame) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_CHILDFRM_H__13F6CD26_1D0B_4F0C_B05B_5BCD959B5AFC__INCLUDED_) diff --git a/Utils/MapEdit/Core.cpp b/Utils/MapEdit/Core.cpp new file mode 100644 index 000000000..a4f7e317a --- /dev/null +++ b/Utils/MapEdit/Core.cpp @@ -0,0 +1,101 @@ +/***********************/ +/*** Map Editor Core ***/ +/***********************/ + + +#include "stdafx.h" +#include "Core.h" + +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ +CCore::CCore() +{ + +} +/*****************************************************************************/ +CCore::~CCore() +{ +} + +/*****************************************************************************/ +/*** Layer Code **************************************************************/ +/*****************************************************************************/ +void CCore::LayerAdd(char *Name) +{ +sLayer NewLayer; + + if (!Name) + { + char DynName[32]; + sprintf(DynName,"Layer%2d",Layers.size()+1); + Name=DynName; + } + + strcpy(NewLayer.Name,Name); + TRACE1("New Layer [%s]\n",Name); + Layers.push_back(NewLayer); + +} + +/*****************************************************************************/ +void CCore::LayerSetActive(int i) +{ +} + +/*****************************************************************************/ +int CCore::LayerGetActive() +{ + return(ActiveLayer); +} + +/*****************************************************************************/ +int CCore::LayerGetCount() +{ + return(Layers.size()); +} + +/*****************************************************************************/ +sLayer const &CCore::LayerGet(int i) +{ + return(Layers[i]); +} + + +/*****************************************************************************/ +void CCore::LayerDelete(int Layer) +{ + Layers.erase(Layers.begin() + Layer); + TRACE0("Delete Layer\n"); +} + +/*****************************************************************************/ +void CCore::LayerMoveUp(int Layer) +{ +sLayer Tmp; + + Tmp=Layers[Layer]; + Layers[Layer]=Layers[Layer-1]; + Layers[Layer-1]=Tmp; + + TRACE0("Layer Up \n"); +} + +/*****************************************************************************/ +void CCore::LayerMoveDown(int Layer) +{ +sLayer Tmp; + + Tmp=Layers[Layer]; + Layers[Layer]=Layers[Layer+1]; + Layers[Layer+1]=Tmp; + + TRACE0("Layer Down\n"); + +} + +/*****************************************************************************/ +/*****************************************************************************/ +/*****************************************************************************/ + + diff --git a/Utils/MapEdit/Core.h b/Utils/MapEdit/Core.h new file mode 100644 index 000000000..375173abb --- /dev/null +++ b/Utils/MapEdit/Core.h @@ -0,0 +1,45 @@ +/***********************/ +/*** Map Editor Core ***/ +/***********************/ + +#ifndef __CORE_HEADER__ +#define __CORE_HEADER__ + +#include + + +/*****************************************************************************/ +//struct sLayer; +struct sLayer +{ + char Name[32]; +// sLayer *Next,*Prev; +}; + +/*****************************************************************************/ +class CCore +{ +public: + CCore(); + ~CCore(); + +// Layers + void LayerAdd(char *Name=0); + void LayerSetActive(int Layer); + int LayerGetActive(); + int LayerGetCount(); + sLayer const &LayerGet(int i); + void LayerDelete(int Layer); + void LayerMoveUp(int Layer); + void LayerMoveDown(int Layer); + + + +private: + + std::vector Layers; + int ActiveLayer; +}; + +/*****************************************************************************/ +#endif diff --git a/Utils/MapEdit/MainFrm.cpp b/Utils/MapEdit/MainFrm.cpp new file mode 100644 index 000000000..961b1a4aa --- /dev/null +++ b/Utils/MapEdit/MainFrm.cpp @@ -0,0 +1,135 @@ +// MainFrm.cpp : implementation of the CMainFrame class +// + +#include "stdafx.h" +#include "MapEdit.h" + +#include "MainFrm.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMainFrame + +IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd) + +BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd) + //{{AFX_MSG_MAP(CMainFrame) + ON_WM_CREATE() + ON_COMMAND(ID_TOOLBAR_LAYERBAR, OnToolbarLayerbar) + ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette) + //}}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; +// ToolBat + 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 + } + + EnableDocking(CBRS_ALIGN_ANY); + + m_wndToolBar.SetWindowText("ToolBar"); + m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); + DockControlBar(&m_wndToolBar); + +// LayerBar + if (!m_wndLayerBar.Create(this,IDD_LAYERBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_LAYERBAR)) + { + TRACE0("Failed to create LayerBar\n"); + return -1; + } + + m_wndLayerBar.EnableDocking( CBRS_ALIGN_ANY); + m_wndLayerBar.SetWindowText("Layer"); + DockControlBar(&m_wndLayerBar); + +// FloatControlBar(&m_wndLayerBar,CPoint(256,256)); + + 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 +/***************************************************************************/ +/***************************************************************************/ +/***************************************************************************/ +/*** Layer Bar Stuff ***/ + +void CMainFrame::OnToolbarLayerbar() +{ +int State=m_wndLayerBar.IsWindowVisible(); + + ShowControlBar(&m_wndLayerBar, !State, FALSE); +} + + + +/***************************************************************************/ +void CMainFrame::OnToolbarTilepalette() +{ + // TODO: Add your command handler code here + +} diff --git a/Utils/MapEdit/MainFrm.h b/Utils/MapEdit/MainFrm.h new file mode 100644 index 000000000..c7b04a73a --- /dev/null +++ b/Utils/MapEdit/MainFrm.h @@ -0,0 +1,63 @@ +// MainFrm.h : interface of the CMainFrame class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_) +#define AFX_MAINFRM_H__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_ + +#include "LayerBar.h" + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +//#include "LayerBar.h" + +class CMainFrame : public CMDIFrameWnd +{ + DECLARE_DYNAMIC(CMainFrame) +public: + CMainFrame(); + +// Attributes +public: + CLayerBar *GetLayerBar() {return(&m_wndLayerBar);} +// 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; + CLayerBar m_wndLayerBar; + + +// Generated message map functions +protected: + //{{AFX_MSG(CMainFrame) + afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct); + afx_msg void OnToolbarLayerbar(); + afx_msg void OnToolbarTilepalette(); + //}}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__CEC14D79_A1F2_4281_AA53_544F0924E7D8__INCLUDED_) diff --git a/Utils/MapEdit/MapEdit.clw b/Utils/MapEdit/MapEdit.clw new file mode 100644 index 000000000..67926c8e6 --- /dev/null +++ b/Utils/MapEdit/MapEdit.clw @@ -0,0 +1,283 @@ +; CLW file contains information for the MFC ClassWizard + +[General Info] +Version=1 +LastClass=CMapEditDoc +LastTemplate=CDialog +NewFileInclude1=#include "stdafx.h" +NewFileInclude2=#include "MapEdit.h" +LastPage=0 + +ClassCount=7 +Class1=CMapEditApp +Class2=CMapEditDoc +Class3=CMapEditView +Class4=CMainFrame + +ResourceCount=10 +Resource1=IDD_ABOUTBOX +Resource2=IDR_MAINFRAME +Resource3=IDR_MAPEDITYPE +Resource8=IDD_PROPPAGE_SMALL (English (U.S.)) +Class5=CChildFrame +Class6=CAboutDlg +Resource4=IDR_MAINFRAME (English (U.S.)) +Resource5=IDD_ABOUTBOX (English (U.S.)) +Resource6=IDR_MAPEDITYPE (English (U.S.)) +Resource7=IDD_PROPPAGE_LARGE (English (U.S.)) +Resource9=IDD_DIALOGBAR (English (U.S.)) +Class7=CLayerBar +Resource10=IDD_LAYERBAR (English (U.S.)) + +[CLS:CMapEditApp] +Type=0 +HeaderFile=MapEdit.h +ImplementationFile=MapEdit.cpp +Filter=N +LastObject=CMapEditApp + +[CLS:CMapEditDoc] +Type=0 +HeaderFile=MapEditDoc.h +ImplementationFile=MapEditDoc.cpp +Filter=N +LastObject=CMapEditDoc +BaseClass=CDocument +VirtualFilter=DC + +[CLS:CMapEditView] +Type=0 +HeaderFile=MapEditView.h +ImplementationFile=MapEditView.cpp +Filter=C +LastObject=CMapEditView +BaseClass=CView +VirtualFilter=VWC + + +[CLS:CMainFrame] +Type=0 +HeaderFile=MainFrm.h +ImplementationFile=MainFrm.cpp +Filter=D +LastObject=CMainFrame +BaseClass=CMDIFrameWnd +VirtualFilter=fWC + + +[CLS:CChildFrame] +Type=0 +HeaderFile=ChildFrm.h +ImplementationFile=ChildFrm.cpp +Filter=M +LastObject=IDC_LAYERBAR_LIST + + +[CLS:CAboutDlg] +Type=0 +HeaderFile=MapEdit.cpp +ImplementationFile=MapEdit.cpp +Filter=D +LastObject=CAboutDlg + +[DLG:IDD_ABOUTBOX] +Type=1 +ControlCount=4 +Control1=IDC_STATIC,static,1342177283 +Control2=IDC_STATIC,static,1342308352 +Control3=IDC_STATIC,static,1342308352 +Control4=IDOK,button,1342373889 +Class=CAboutDlg + +[MNU:IDR_MAINFRAME] +Type=1 +Class=CMainFrame +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_PRINT_SETUP +Command4=ID_FILE_MRU_FILE1 +Command5=ID_APP_EXIT +Command6=ID_VIEW_TOOLBAR +Command7=ID_VIEW_STATUS_BAR +CommandCount=8 +Command8=ID_APP_ABOUT + +[TB:IDR_MAINFRAME] +Type=1 +Class=CMainFrame +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_EDIT_CUT +Command5=ID_EDIT_COPY +Command6=ID_EDIT_PASTE +Command7=ID_FILE_PRINT +CommandCount=8 +Command8=ID_APP_ABOUT + +[MNU:IDR_MAPEDITYPE] +Type=1 +Class=CMapEditView +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_CLOSE +Command4=ID_FILE_SAVE +Command5=ID_FILE_SAVE_AS +Command6=ID_FILE_PRINT +Command7=ID_FILE_PRINT_PREVIEW +Command8=ID_FILE_PRINT_SETUP +Command9=ID_FILE_MRU_FILE1 +Command10=ID_APP_EXIT +Command11=ID_EDIT_UNDO +Command12=ID_EDIT_CUT +Command13=ID_EDIT_COPY +Command14=ID_EDIT_PASTE +CommandCount=21 +Command15=ID_VIEW_TOOLBAR +Command16=ID_VIEW_STATUS_BAR +Command17=ID_WINDOW_NEW +Command18=ID_WINDOW_CASCADE +Command19=ID_WINDOW_TILE_HORZ +Command20=ID_WINDOW_ARRANGE +Command21=ID_APP_ABOUT + +[ACL:IDR_MAINFRAME] +Type=1 +Class=CMainFrame +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_FILE_PRINT +Command5=ID_EDIT_UNDO +Command6=ID_EDIT_CUT +Command7=ID_EDIT_COPY +Command8=ID_EDIT_PASTE +Command9=ID_EDIT_UNDO +Command10=ID_EDIT_CUT +Command11=ID_EDIT_COPY +Command12=ID_EDIT_PASTE +CommandCount=14 +Command13=ID_NEXT_PANE +Command14=ID_PREV_PANE + + +[TB:IDR_MAINFRAME (English (U.S.))] +Type=1 +Class=? +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_EDIT_CUT +Command5=ID_EDIT_COPY +Command6=ID_EDIT_PASTE +Command7=ID_FILE_PRINT +Command8=ID_APP_ABOUT +Command9=ID_TOOLBAR_LAYERBAR +Command10=ID_TOOLBAR_TILEPALETTE +CommandCount=10 + +[MNU:IDR_MAINFRAME (English (U.S.))] +Type=1 +Class=CMainFrame +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_PRINT_SETUP +Command4=ID_FILE_MRU_FILE1 +Command5=ID_APP_EXIT +Command6=ID_VIEW_TOOLBAR +Command7=ID_VIEW_STATUS_BAR +Command8=ID_APP_ABOUT +CommandCount=8 + +[MNU:IDR_MAPEDITYPE (English (U.S.))] +Type=1 +Class=? +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_CLOSE +Command4=ID_FILE_SAVE +Command5=ID_FILE_SAVE_AS +Command6=ID_FILE_PRINT +Command7=ID_FILE_PRINT_PREVIEW +Command8=ID_FILE_PRINT_SETUP +Command9=ID_FILE_MRU_FILE1 +Command10=ID_APP_EXIT +Command11=ID_EDIT_UNDO +Command12=ID_EDIT_CUT +Command13=ID_EDIT_COPY +Command14=ID_EDIT_PASTE +Command15=ID_VIEW_TOOLBAR +Command16=ID_VIEW_STATUS_BAR +Command17=ID_WINDOW_NEW +Command18=ID_WINDOW_CASCADE +Command19=ID_WINDOW_TILE_HORZ +Command20=ID_WINDOW_ARRANGE +Command21=ID_APP_ABOUT +CommandCount=21 + +[ACL:IDR_MAINFRAME (English (U.S.))] +Type=1 +Class=? +Command1=ID_FILE_NEW +Command2=ID_FILE_OPEN +Command3=ID_FILE_SAVE +Command4=ID_FILE_PRINT +Command5=ID_EDIT_UNDO +Command6=ID_EDIT_CUT +Command7=ID_EDIT_COPY +Command8=ID_EDIT_PASTE +Command9=ID_EDIT_UNDO +Command10=ID_EDIT_CUT +Command11=ID_EDIT_COPY +Command12=ID_EDIT_PASTE +Command13=ID_NEXT_PANE +Command14=ID_PREV_PANE +CommandCount=14 + +[DLG:IDD_ABOUTBOX (English (U.S.))] +Type=1 +Class=CAboutDlg +ControlCount=4 +Control1=IDC_STATIC,static,1342177283 +Control2=IDC_STATIC,static,1342308480 +Control3=IDC_STATIC,static,1342308352 +Control4=IDOK,button,1342373889 + +[DLG:IDD_LAYERBAR (English (U.S.))] +Type=1 +Class=CLayerBar +ControlCount=5 +Control1=IDC_LAYERBAR_NEW,button,1342242816 +Control2=IDC_LAYERBAR_DELETE,button,1342242816 +Control3=IDC_LAYERBAR_UP,button,1342242816 +Control4=IDC_LAYERBAR_DOWN,button,1342242816 +Control5=IDC_LAYERBAR_LIST,listbox,1352728833 + +[DLG:IDD_PROPPAGE_SMALL (English (U.S.))] +Type=1 +Class=? +ControlCount=1 +Control1=IDC_STATIC,static,1342308352 + +[DLG:IDD_PROPPAGE_LARGE (English (U.S.))] +Type=1 +Class=? +ControlCount=1 +Control1=IDC_STATIC,static,1342308352 + +[DLG:IDD_DIALOGBAR (English (U.S.))] +Type=1 +Class=? +ControlCount=2 +Control1=IDC_STATIC,static,1342308352 +Control2=IDC_CUSTOM1,casd,1342242816 + +[CLS:CLayerBar] +Type=0 +HeaderFile=LayerBar.h +ImplementationFile=LayerBar.cpp +BaseClass=CDialogBar +Filter=D +VirtualFilter=dWC +LastObject=CLayerBar + diff --git a/Utils/MapEdit/MapEdit.cpp b/Utils/MapEdit/MapEdit.cpp new file mode 100644 index 000000000..b1b9baebd --- /dev/null +++ b/Utils/MapEdit/MapEdit.cpp @@ -0,0 +1,161 @@ +// MapEdit.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "MapEdit.h" + +#include "MainFrm.h" +#include "ChildFrm.h" +#include "MapEditDoc.h" +#include "MapEditView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMapEditApp + +BEGIN_MESSAGE_MAP(CMapEditApp, CWinApp) + //{{AFX_MSG_MAP(CMapEditApp) + ON_COMMAND(ID_APP_ABOUT, OnAppAbout) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG_MAP + // Standard file based document commands + ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew) + ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen) + // Standard print setup command + ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMapEditApp construction + +CMapEditApp::CMapEditApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CMapEditApp object + +CMapEditApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CMapEditApp initialization + +BOOL CMapEditApp::InitInstance() +{ + AfxEnableControlContainer(); + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#else + Enable3dControlsStatic(); // Call this when linking to MFC statically +#endif + + // Change the registry key under which our settings are stored. + // TODO: You should modify this string to be something appropriate + // such as the name of your company or organization. + SetRegistryKey(_T("Local AppWizard-Generated Applications")); + + LoadStdProfileSettings(); // Load standard INI file options (including MRU) + + // Register the application's document templates. Document templates + // serve as the connection between documents, frame windows and views. + + CMultiDocTemplate* pDocTemplate; + pDocTemplate = new CMultiDocTemplate( + IDR_MAPEDITYPE, + RUNTIME_CLASS(CMapEditDoc), + RUNTIME_CLASS(CChildFrame), // custom MDI child frame + RUNTIME_CLASS(CMapEditView)); + AddDocTemplate(pDocTemplate); + + // create main MDI Frame window + CMainFrame* pMainFrame = new CMainFrame; + if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) + return FALSE; + m_pMainWnd = pMainFrame; + + // Parse command line for standard shell commands, DDE, file open + CCommandLineInfo cmdInfo; + ParseCommandLine(cmdInfo); + + // Dispatch commands specified on the command line + if (!ProcessShellCommand(cmdInfo)) + return FALSE; + + // The main window has been initialized, so show and update it. + pMainFrame->ShowWindow(m_nCmdShow); + pMainFrame->UpdateWindow(); + + return TRUE; +} + + +///////////////////////////////////////////////////////////////////////////// +// CAboutDlg dialog used for App About + +class CAboutDlg : public CDialog +{ +public: + CAboutDlg(); + +// Dialog Data + //{{AFX_DATA(CAboutDlg) + enum { IDD = IDD_ABOUTBOX }; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CAboutDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + //{{AFX_MSG(CAboutDlg) + // No message handlers + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) +{ + //{{AFX_DATA_INIT(CAboutDlg) + //}}AFX_DATA_INIT +} + +void CAboutDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CAboutDlg) + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CAboutDlg, CDialog) + //{{AFX_MSG_MAP(CAboutDlg) + // No message handlers + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +// App command to run the dialog +void CMapEditApp::OnAppAbout() +{ + CAboutDlg aboutDlg; + aboutDlg.DoModal(); +} + +///////////////////////////////////////////////////////////////////////////// +// CMapEditApp message handlers + diff --git a/Utils/MapEdit/MapEdit.dsp b/Utils/MapEdit/MapEdit.dsp new file mode 100644 index 000000000..726c0ea11 --- /dev/null +++ b/Utils/MapEdit/MapEdit.dsp @@ -0,0 +1,194 @@ +# Microsoft Developer Studio Project File - Name="MapEdit" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Application" 0x0101 + +CFG=MapEdit - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "MapEdit.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 "MapEdit.mak" CFG="MapEdit - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "MapEdit - Win32 Release" (based on "Win32 (x86) Application") +!MESSAGE "MapEdit - Win32 Debug" (based on "Win32 (x86) Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "MapEdit - 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 Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL" +# ADD RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386 +# ADD LINK32 /nologo /subsystem:windows /machine:I386 + +!ELSEIF "$(CFG)" == "MapEdit - 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 Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL" +# ADD RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept +# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "MapEdit - Win32 Release" +# Name "MapEdit - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\ChildFrm.cpp +# End Source File +# Begin Source File + +SOURCE=.\Core.cpp +# End Source File +# Begin Source File + +SOURCE=.\LayerBar.cpp +# End Source File +# Begin Source File + +SOURCE=.\MainFrm.cpp +# End Source File +# Begin Source File + +SOURCE=.\MapEdit.cpp +# End Source File +# Begin Source File + +SOURCE=.\MapEdit.rc +# End Source File +# Begin Source File + +SOURCE=.\MapEditDoc.cpp +# End Source File +# Begin Source File + +SOURCE=.\MapEditView.cpp +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.cpp +# ADD CPP /Yc"stdafx.h" +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\ChildFrm.h +# End Source File +# Begin Source File + +SOURCE=.\Core.h +# End Source File +# Begin Source File + +SOURCE=.\LayerBar.h +# End Source File +# Begin Source File + +SOURCE=.\MainFrm.h +# End Source File +# Begin Source File + +SOURCE=.\MapEdit.h +# End Source File +# Begin Source File + +SOURCE=.\MapEditDoc.h +# End Source File +# Begin Source File + +SOURCE=.\MapEditView.h +# End Source File +# Begin Source File + +SOURCE=.\Resource.h +# End Source File +# Begin Source File + +SOURCE=.\StdAfx.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\res\MapEdit.ico +# End Source File +# Begin Source File + +SOURCE=.\res\MapEdit.rc2 +# End Source File +# Begin Source File + +SOURCE=.\res\MapEditDoc.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 diff --git a/Utils/MapEdit/MapEdit.dsw b/Utils/MapEdit/MapEdit.dsw new file mode 100644 index 000000000..8115d5e1f --- /dev/null +++ b/Utils/MapEdit/MapEdit.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "MapEdit"=.\MapEdit.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Utils/MapEdit/MapEdit.h b/Utils/MapEdit/MapEdit.h new file mode 100644 index 000000000..a5baba32a --- /dev/null +++ b/Utils/MapEdit/MapEdit.h @@ -0,0 +1,63 @@ +// MapEdit.h : main header file for the MAPEDIT application +// + +#if !defined(AFX_MAPEDIT_H__CFB33904_F24D_45E4_B777_DA7AC0133F3C__INCLUDED_) +#define AFX_MAPEDIT_H__CFB33904_F24D_45E4_B777_DA7AC0133F3C__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 + +///////////////////////////////////////////////////////////////////////////// +// CMapEditApp: +// See MapEdit.cpp for the implementation of this class +// +class CMapEditDoc; +class CMapEditApp : public CWinApp +{ +public: + CMapEditApp(); + + void SetCurrent(CMapEditDoc *Cur) + { + CurrentDoc=Cur; + } + + CMapEditDoc *GetCurrent() + { + return(CurrentDoc); + } +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMapEditApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + //{{AFX_MSG(CMapEditApp) + afx_msg void OnAppAbout(); + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +private: + + CMapEditDoc *CurrentDoc; +}; + + +///////////////////////////////////////////////////////////////////////////// +extern CMapEditApp theApp; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAPEDIT_H__CFB33904_F24D_45E4_B777_DA7AC0133F3C__INCLUDED_) diff --git a/Utils/MapEdit/MapEdit.rc b/Utils/MapEdit/MapEdit.rc new file mode 100644 index 000000000..be2be4bf7 --- /dev/null +++ b/Utils/MapEdit/MapEdit.rc @@ -0,0 +1,473 @@ +//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 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDR_MAINFRAME ICON DISCARDABLE "res\\MapEdit.ico" +IDR_MAPEDITYPE ICON DISCARDABLE "res\\MapEditDoc.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 + SEPARATOR + BUTTON ID_TOOLBAR_LAYERBAR + BUTTON ID_TOOLBAR_TILEPALETTE +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 "&Toolbar", ID_VIEW_TOOLBAR + MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR + END + POPUP "&Help" + BEGIN + MENUITEM "&About MapEdit...", ID_APP_ABOUT + END +END + +IDR_MAPEDITYPE 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 + END + POPUP "&View" + BEGIN + MENUITEM "&Toolbar", ID_VIEW_TOOLBAR + MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR + END + POPUP "&Window" + BEGIN + MENUITEM "&New Window", ID_WINDOW_NEW + MENUITEM "&Cascade", ID_WINDOW_CASCADE + MENUITEM "&Tile", ID_WINDOW_TILE_HORZ + MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE + END + POPUP "&Help" + BEGIN + MENUITEM "&About MapEdit...", 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 MapEdit" +FONT 8, "MS Sans Serif" +BEGIN + ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20 + LTEXT "MapEdit Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX + LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8 + DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP +END + +IDD_LAYERBAR DIALOGEX 0, 0, 92, 92 +STYLE DS_MODALFRAME | WS_CHILD +EXSTYLE WS_EX_TOOLWINDOW +FONT 8, "MS Sans Serif" +BEGIN + PUSHBUTTON "New",IDC_LAYERBAR_NEW,5,5,20,15 + PUSHBUTTON "Del",IDC_LAYERBAR_DELETE,25,5,20,15 + PUSHBUTTON "Up",IDC_LAYERBAR_UP,45,5,20,15 + PUSHBUTTON "Down",IDC_LAYERBAR_DOWN,65,5,20,15 + LISTBOX IDC_LAYERBAR_LIST,5,25,80,65,LBS_NOINTEGRALHEIGHT | + WS_VSCROLL | WS_TABSTOP +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", "MapEdit MFC Application\0" + VALUE "FileVersion", "1, 0, 0, 1\0" + VALUE "InternalName", "MapEdit\0" + VALUE "LegalCopyright", "Copyright (C) 2000\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "MapEdit.EXE\0" + VALUE "ProductName", "MapEdit 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_LAYERBAR, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 85 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// String Table +// + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + IDR_MAINFRAME "MapEdit" + IDR_MAPEDITYPE "\nMapEdi\nMapEdi\n\n\nMapEdit.Document\nMapEdi Document" +END + +STRINGTABLE PRELOAD DISCARDABLE +BEGIN + AFX_IDS_APP_TITLE "MapEdit" + 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_TOOLBAR_LAYERBAR "Hides/Shows Layer Bar" + ID_TOOLBAR_TILEPALETTE "Hides/Shows Tile Palette" +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#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\\MapEdit.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 + +#endif // English (U.K.) 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\MapEdit.rc2" // non-Microsoft Visual C++ edited resources +#include "afxres.rc" // Standard components +#include "afxprint.rc" // printing/print preview resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/Utils/MapEdit/MapEditDoc.cpp b/Utils/MapEdit/MapEditDoc.cpp new file mode 100644 index 000000000..0b7e3861f --- /dev/null +++ b/Utils/MapEdit/MapEditDoc.cpp @@ -0,0 +1,176 @@ +// MapEditDoc.cpp : implementation of the CMapEditDoc class +// + +#include "stdafx.h" +#include "MapEdit.h" +#include "Mainfrm.h" + +#include "MapEditDoc.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMapEditDoc + +IMPLEMENT_DYNCREATE(CMapEditDoc, CDocument) + +BEGIN_MESSAGE_MAP(CMapEditDoc, CDocument) + //{{AFX_MSG_MAP(CMapEditDoc) + ON_BN_CLICKED(IDC_LAYERBAR_NEW, OnLayerbarNew) + ON_BN_CLICKED(IDC_LAYERBAR_DELETE, OnLayerbarDelete) + ON_BN_CLICKED(IDC_LAYERBAR_UP, OnLayerbarUp) + ON_BN_CLICKED(IDC_LAYERBAR_DOWN, OnLayerbarDown) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CMapEditDoc construction/destruction + +CMapEditDoc::CMapEditDoc() +{ +CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd(); + LayerBar=Frm->GetLayerBar(); + + +} + +CMapEditDoc::~CMapEditDoc() +{ +} + +BOOL CMapEditDoc::OnNewDocument() +{ + if (!CDocument::OnNewDocument()) + return FALSE; + + // TODO: add reinitialization code here + // (SDI documents will reuse this document) + + return TRUE; +} + + + +///////////////////////////////////////////////////////////////////////////// +// CMapEditDoc serialization + +void CMapEditDoc::Serialize(CArchive& ar) +{ + if (ar.IsStoring()) + { + // TODO: add storing code here + } + else + { + // TODO: add loading code here + } +} + +///////////////////////////////////////////////////////////////////////////// +// CMapEditDoc diagnostics + +#ifdef _DEBUG +void CMapEditDoc::AssertValid() const +{ + CDocument::AssertValid(); +} + +void CMapEditDoc::Dump(CDumpContext& dc) const +{ + CDocument::Dump(dc); +} +#endif //_DEBUG + + +/***************************************************************************/ +void CMapEditDoc::UpdateAll() +{ + UpdateLayerBar(); + +} +/***************************************************************************/ +/*** Layer Commands ********************************************************/ +/***************************************************************************/ +void CMapEditDoc::OnLayerbarNew() +{ + Core.LayerAdd(); + UpdateLayerBar(); +} + +/***************************************************************************/ +void CMapEditDoc::OnLayerbarDelete() +{ +int Sel=GetLayerCurSel(); + + if (Sel==-1) return; + Core.LayerDelete(Sel); + UpdateLayerBar(); +} + +/***************************************************************************/ +void CMapEditDoc::OnLayerbarUp() +{ +int Sel=GetLayerCurSel(); + + if (Sel==-1) return; + if (Sel>0) + { + Core.LayerMoveUp(Sel); + UpdateLayerBar(); + } + +} + +/***************************************************************************/ +void CMapEditDoc::OnLayerbarDown() +{ +int Sel=GetLayerCurSel(); + if (Sel==-1) return; + if (SelGetDlgItem(IDC_LAYERBAR_LIST); +int CurSel=Dlg->GetCurSel(); + + Dlg->ResetContent(); + + for (int i=0;iAddString(ThisLayer.Name); + } + Dlg->SetCurSel(CurSel); + +} + +/***************************************************************************/ +int CMapEditDoc::GetLayerCurSel() +{ +CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST); + return(Dlg->GetCurSel()); + +} + +/***************************************************************************/ +int CMapEditDoc::GetLayerCount() +{ +CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST); + return(Dlg->GetCount()); + +} + +/***************************************************************************/ +/***************************************************************************/ +/***************************************************************************/ diff --git a/Utils/MapEdit/MapEditDoc.h b/Utils/MapEdit/MapEditDoc.h new file mode 100644 index 000000000..b17da79da --- /dev/null +++ b/Utils/MapEdit/MapEditDoc.h @@ -0,0 +1,69 @@ +// MapEditDoc.h : interface of the CMapEditDoc class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MAPEDITDOC_H__C235E087_8243_4400_BA8E_2937FBC1F9F2__INCLUDED_) +#define AFX_MAPEDITDOC_H__C235E087_8243_4400_BA8E_2937FBC1F9F2__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#include "Core.h" + +class CLayerBar; +class CMapEditDoc : public CDocument +{ +protected: // create from serialization only + CMapEditDoc(); + DECLARE_DYNCREATE(CMapEditDoc) + +// Attributes +public: + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMapEditDoc) + public: + virtual BOOL OnNewDocument(); + virtual void Serialize(CArchive& ar); + //}}AFX_VIRTUAL + +// Implementation +public: + virtual ~CMapEditDoc(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + void UpdateAll(); + +protected: + void UpdateLayerBar(); + int GetLayerCurSel(); + int GetLayerCount(); + + CCore Core; + CLayerBar *LayerBar; + +// Generated message map functions +protected: + //{{AFX_MSG(CMapEditDoc) + afx_msg void OnLayerbarNew(); + afx_msg void OnLayerbarDelete(); + afx_msg void OnLayerbarUp(); + afx_msg void OnLayerbarDown(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() + +}; + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAPEDITDOC_H__C235E087_8243_4400_BA8E_2937FBC1F9F2__INCLUDED_) diff --git a/Utils/MapEdit/MapEditView.cpp b/Utils/MapEdit/MapEditView.cpp new file mode 100644 index 000000000..c7e0660d7 --- /dev/null +++ b/Utils/MapEdit/MapEditView.cpp @@ -0,0 +1,115 @@ +// MapEditView.cpp : implementation of the CMapEditView class +// + +#include "stdafx.h" +#include "MapEdit.h" + +#include "MapEditDoc.h" +#include "MapEditView.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView + +IMPLEMENT_DYNCREATE(CMapEditView, CView) + +BEGIN_MESSAGE_MAP(CMapEditView, CView) + //{{AFX_MSG_MAP(CMapEditView) + ON_WM_SETFOCUS() + //}}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() + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView construction/destruction + +CMapEditView::CMapEditView() +{ + // TODO: add construction code here + +} + +CMapEditView::~CMapEditView() +{ +} + +BOOL CMapEditView::PreCreateWindow(CREATESTRUCT& cs) +{ + // TODO: Modify the Window class or styles here by modifying + // the CREATESTRUCT cs + + return CView::PreCreateWindow(cs); +} + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView drawing + +void CMapEditView::OnDraw(CDC* pDC) +{ + CMapEditDoc* pDoc = GetDocument(); + ASSERT_VALID(pDoc); + // TODO: add draw code for native data here +} + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView printing + +BOOL CMapEditView::OnPreparePrinting(CPrintInfo* pInfo) +{ + // default preparation + return DoPreparePrinting(pInfo); +} + +void CMapEditView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) +{ + // TODO: add extra initialization before printing +} + +void CMapEditView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/) +{ + // TODO: add cleanup after printing +} + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView diagnostics + +#ifdef _DEBUG +void CMapEditView::AssertValid() const +{ + CView::AssertValid(); +} + +void CMapEditView::Dump(CDumpContext& dc) const +{ + CView::Dump(dc); +} + +CMapEditDoc* CMapEditView::GetDocument() // non-debug version is inline +{ + ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CMapEditDoc))); + return (CMapEditDoc*)m_pDocument; +} +#endif //_DEBUG + +///////////////////////////////////////////////////////////////////////////// +// CMapEditView message handlers + +void CMapEditView::OnSetFocus(CWnd* pOldWnd) +{ +CMapEditDoc *CurDoc=GetDocument(); + CView::OnSetFocus(pOldWnd); + theApp.SetCurrent(CurDoc); + + CurDoc->UpdateAll(); // woohoo, that was easy + + // TODO: Add your message handler code here + +} diff --git a/Utils/MapEdit/MapEditView.h b/Utils/MapEdit/MapEditView.h new file mode 100644 index 000000000..f7847e9be --- /dev/null +++ b/Utils/MapEdit/MapEditView.h @@ -0,0 +1,66 @@ +// MapEditView.h : interface of the CMapEditView class +// +///////////////////////////////////////////////////////////////////////////// + +#if !defined(AFX_MAPEDITVIEW_H__DBE61BE7_547C_43E9_BC46_E55636495066__INCLUDED_) +#define AFX_MAPEDITVIEW_H__DBE61BE7_547C_43E9_BC46_E55636495066__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + + +class CMapEditView : public CView +{ +protected: // create from serialization only + CMapEditView(); + DECLARE_DYNCREATE(CMapEditView) + +// Attributes +public: + CMapEditDoc* GetDocument(); + +// Operations +public: + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CMapEditView) + 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 ~CMapEditView(); +#ifdef _DEBUG + virtual void AssertValid() const; + virtual void Dump(CDumpContext& dc) const; +#endif + +protected: + +// Generated message map functions +protected: + //{{AFX_MSG(CMapEditView) + afx_msg void OnSetFocus(CWnd* pOldWnd); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +#ifndef _DEBUG // debug version in MapEditView.cpp +inline CMapEditDoc* CMapEditView::GetDocument() + { return (CMapEditDoc*)m_pDocument; } +#endif + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_MAPEDITVIEW_H__DBE61BE7_547C_43E9_BC46_E55636495066__INCLUDED_) diff --git a/Utils/MapEdit/StdAfx.cpp b/Utils/MapEdit/StdAfx.cpp new file mode 100644 index 000000000..46dda1498 --- /dev/null +++ b/Utils/MapEdit/StdAfx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// MapEdit.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + + diff --git a/Utils/MapEdit/StdAfx.h b/Utils/MapEdit/StdAfx.h new file mode 100644 index 000000000..fb8d6fda7 --- /dev/null +++ b/Utils/MapEdit/StdAfx.h @@ -0,0 +1,27 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__67922BC1_781B_4EBB_86D3_B87FA7642774__INCLUDED_) +#define AFX_STDAFX_H__67922BC1_781B_4EBB_86D3_B87FA7642774__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include // MFC core and standard components +#include // MFC extensions +#include // MFC Automation classes +#include // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include // 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__67922BC1_781B_4EBB_86D3_B87FA7642774__INCLUDED_) diff --git a/Utils/MapEdit/resource.h b/Utils/MapEdit/resource.h new file mode 100644 index 000000000..f36fbb1f2 --- /dev/null +++ b/Utils/MapEdit/resource.h @@ -0,0 +1,27 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by MapEdit.rc +// +#define IDD_ABOUTBOX 100 +#define IDD_LAYERBAR 103 +#define IDR_MAINFRAME 128 +#define IDR_MAPEDITYPE 129 +#define IDC_LAYERBAR_NEW 1000 +#define IDC_LAYERBAR_DELETE 1001 +#define IDC_LAYERBAR_UP 1002 +#define IDC_LAYERBAR_DOWN 1003 +#define IDC_LAYERBAR_LIST 1011 +#define ID_TOOLBAR_LAYERBAR 32773 +#define ID_TOOLBAR_TILEPALETTE 32774 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_3D_CONTROLS 1 +#define _APS_NEXT_RESOURCE_VALUE 139 +#define _APS_NEXT_COMMAND_VALUE 32775 +#define _APS_NEXT_CONTROL_VALUE 1012 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif