This commit is contained in:
Daveo 2000-11-08 14:49:33 +00:00
parent 59484b9b75
commit 087d87f4be
12 changed files with 90 additions and 93 deletions

View file

@ -48,7 +48,7 @@ void CCore::NewMap()
Layers[LAYER_TYPE_FORE]= new CLayerTile("Fore", TileLayerDefaultWidth/0.5f, TileLayerDefaultHeight/0.5f, 0.5f, FALSE);
TileViewFlag=0;
LayerViewFlag=1;
ParamViewFlag=1;
ActiveLayer=LAYER_TYPE_ACTION;
MapCam=Vec(0,0,0);
@ -162,15 +162,16 @@ Vec &ThisCam=GetCam();
/*****************************************************************************/
/*** Layers ******************************************************************/
/*****************************************************************************/
void CCore::UpdateLayerBar(CMapEditView *View,BOOL ViewFlag)
void CCore::UpdateParamBar(CMapEditView *View,BOOL ViewFlag)
{
CMainFrame *Frm=(CMainFrame*)AfxGetApp()->GetMainWnd();
CToolBar *ToolBar=Frm->GetToolBar();
CDialogBar *LayerBar=Frm->GetLayerBar();
CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
CParamBar *ParamBar=Frm->GetParamBar();
CCheckListBox *Dlg=(CCheckListBox *)ParamBar->GetDlgItem(IDC_PARAMBAR_LAYER_LIST);
LayerViewFlag=ViewFlag;
if (LayerViewFlag)
Dlg->SetCheck(1,1);
ParamViewFlag=ViewFlag;
if (ParamViewFlag)
{
Dlg->ResetContent();
@ -182,22 +183,22 @@ CListBox *Dlg=(CListBox *)LayerBar->GetDlgItem(IDC_LAYERBAR_LIST);
Dlg->SetCurSel(ActiveLayer);
}
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_LAYERBAR,LayerViewFlag);
Frm->ShowControlBar(LayerBar, LayerViewFlag, FALSE);
ToolBar->GetToolBarCtrl().PressButton(ID_TOOLBAR_PARAMBAR,ParamViewFlag);
Frm->ShowControlBar(ParamBar, ParamViewFlag, FALSE);
if (View) UpdateView(View);
}
/*****************************************************************************/
void CCore::ToggleLayerView(CMapEditView *View)
void CCore::ToggleParamView(CMapEditView *View)
{
UpdateLayerBar(View,!LayerViewFlag);
UpdateParamBar(View,!ParamViewFlag);
}
/*****************************************************************************/
void CCore::SetActiveLayer(int i)
{
UpdateLayerBar(NULL,LayerViewFlag);
UpdateParamBar(NULL,ParamViewFlag);
}
@ -237,7 +238,7 @@ Vec &CCore::GetCam()
void CCore::UpdateAll(CMapEditView *View)
{
UpdateView(View);
UpdateLayerBar(View,LayerViewFlag);
UpdateParamBar(View,ParamViewFlag);
UpdateTileView(View,TileViewFlag);
}

View file

@ -42,11 +42,11 @@ public:
CTile GetTile(int Bank,int TileNo) {return(TileBank.GetTile(Bank,TileNo));}
// Param Bar
void UpdateParamBar(CMapEditView *View,BOOL ViewFlag);
void ToggleParamView(CMapEditView *View);
BOOL GetParamViewFlag() {return(ParamViewFlag);}
// Layers
void UpdateLayerBar(CMapEditView *View,BOOL ViewFlag);
void ToggleLayerView(CMapEditView *View);
BOOL GetLayerViewFlag() {return(LayerViewFlag);}
void SetActiveLayer(int Layer);
int GetActiveLayer() {return(ActiveLayer);}
CLayer *GetLayer(int i) {return(Layers[i]);}
@ -74,7 +74,7 @@ private:
BOOL RenderFlag;
BOOL TileViewFlag;
BOOL LayerViewFlag;
BOOL ParamViewFlag;
};

View file

@ -5,7 +5,6 @@
#include "MapEdit.h"
#include "MainFrm.h"
#include "ExToolBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
@ -50,19 +49,6 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) return -1;
EnableDocking(CBRS_ALIGN_ANY);
/*
// TileBar
if (!m_wndTileBar.Create(this,IDD_TILEBAR,(CBRS_TOP | CBRS_SIZE_DYNAMIC | CBRS_FLOAT_MULTI ),IDD_TILEBAR))
{
TRACE0("Failed to create ToolBar\n");
return -1;
}
m_wndTileBar.EnableDocking( CBRS_ALIGN_TOP);
m_wndTileBar.SetWindowText("TileBar");
DockControlBar(&m_wndTileBar);
*/
// Status Bar
if (!m_wndStatusBar.Create(this) || !m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
{
@ -70,16 +56,16 @@ int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
return -1; // fail to create
}
// LayerBar
if (!m_wndLayerBar.Create(this,IDD_LAYERBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_LAYERBAR))
// ParamBar
if (!m_wndParamBar.Create(this,IDD_PARAMBAR,(CBRS_LEFT | CBRS_SIZE_DYNAMIC),IDD_PARAMBAR))
{
TRACE0("Failed to create LayerBar\n");
TRACE0("Failed to create ParamBar\n");
return -1;
}
m_wndLayerBar.EnableDocking( CBRS_ALIGN_ANY);
m_wndLayerBar.SetWindowText("Layer");
DockControlBar(&m_wndLayerBar);
m_wndParamBar.EnableDocking( CBRS_ALIGN_ANY);
m_wndParamBar.SetWindowText("Param");
DockControlBar(&m_wndParamBar);
// ToolBar (plus extra code for extra controls!!)
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))

View file

@ -9,8 +9,16 @@
#pragma once
#endif // _MSC_VER > 1000
#include "ExToolbar.h"
#include "ParamBar.h"
/////////////////////////////////////////////////////////////////////////////
class CMainToolBar : public CToolBar
{
public:
CComboBox m_Combo;
};
/////////////////////////////////////////////////////////////////////////////
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
@ -20,7 +28,7 @@ public:
// Attributes
public:
CToolBar *GetToolBar() {return(&m_wndToolBar);}
CDialogBar *GetLayerBar() {return(&m_wndLayerBar);}
CParamBar *GetParamBar() {return(&m_wndParamBar);}
// CDialogBar *GetTileBar() {return(&m_wndTileBar);}
CStatusBar *GetStatusBar() {return(&m_wndStatusBar);}
// Operations
@ -41,10 +49,10 @@ public:
#endif
protected: // control bar embedded members
CStatusBar m_wndStatusBar;
CExToolBar m_wndToolBar;
CDialogBar m_wndLayerBar;
// CDialogBar m_wndTileBar;
CStatusBar m_wndStatusBar;
CMainToolBar m_wndToolBar;
CParamBar m_wndParamBar;
// Generated message map functions
protected:
@ -61,6 +69,9 @@ STATUS_BAR_XPOS,
STATUS_BAR_YPOS,
};
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}

View file

@ -2,7 +2,7 @@
[General Info]
Version=1
LastClass=CExToolBar
LastClass=CAboutDlg
LastTemplate=CToolBarCtrl
NewFileInclude1=#include "stdafx.h"
NewFileInclude2=#include "mapedit.h"
@ -11,7 +11,7 @@ LastPage=0
ClassCount=9
Class1=CChildFrame
Class2=CGLEnabledView
Class3=CListBoxEx
Class3=CParamBar
Class4=CMainFrame
Class5=CMapEditApp
Class6=CAboutDlg
@ -22,10 +22,10 @@ ResourceCount=8
Resource1=IDR_MAPEDITYPE (English (U.S.))
Resource2=IDD_TILEBAR (English (U.S.))
Resource3=IDD_LAYERBAR1 (English (U.S.))
Resource4=IDR_TOOLBAR (English (U.S.))
Resource5=IDD_ABOUTBOX (English (U.S.))
Resource4=IDD_ABOUTBOX (English (U.S.))
Resource5=IDD_PARAMBAR (English (U.S.))
Class9=CExToolBar
Resource6=IDD_LAYERBAR (English (U.S.))
Resource6=IDR_TOOLBAR (English (U.S.))
Resource7=IDR_MAINFRAME (English (U.S.))
Resource8=IDD_TRASHHEAP
@ -43,13 +43,6 @@ HeaderFile=GLEnabledView.h
ImplementationFile=GLEnabledView.cpp
LastObject=CGLEnabledView
[CLS:CListBoxEx]
Type=0
BaseClass=CListBox
HeaderFile=ListBoxEx.h
ImplementationFile=ListBoxEx.cpp
LastObject=CListBoxEx
[CLS:CMainFrame]
Type=0
BaseClass=CMDIFrameWnd
@ -162,12 +155,6 @@ Control2=IDC_STATIC,static,1342308480
Control3=IDC_STATIC,static,1342308352
Control4=IDOK,button,1342373889
[DLG:IDD_LAYERBAR (English (U.S.))]
Type=1
Class=?
ControlCount=1
Control1=IDC_LAYERBAR_LIST,listbox,1352728833
[DLG:IDD_TILEBAR (English (U.S.))]
Type=1
Class=?
@ -191,7 +178,7 @@ Command5=ID_EDIT_COPY
Command6=ID_EDIT_PASTE
Command7=ID_FILE_PRINT
Command8=ID_APP_ABOUT
Command9=ID_TOOLBAR_LAYERBAR
Command9=ID_TOOLBAR_PARAMBAR
Command10=ID_TOOLBAR_TILEPALETTE
Command11=ID_TOOLBAR_COMBO
CommandCount=11
@ -207,5 +194,20 @@ Type=0
HeaderFile=extoolbar.h
ImplementationFile=extoolbar.cpp
BaseClass=CToolBar
LastObject=CExToolBar
LastObject=IDC_LAYERBAR_LIST
[DLG:IDD_PARAMBAR (English (U.S.))]
Type=1
Class=CParamBar
ControlCount=1
Control1=IDC_PARAMBAR_LAYER_LIST,listbox,1352728833
[CLS:CParamBar]
Type=0
HeaderFile=ParamBar.h
ImplementationFile=ParamBar.cpp
BaseClass=CDialogBar
Filter=D
LastObject=CParamBar
VirtualFilter=dWC

View file

@ -198,6 +198,10 @@ SOURCE=.\MapEditView.cpp
# End Source File
# Begin Source File
SOURCE=.\ParamBar.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
@ -239,6 +243,10 @@ SOURCE=.\MapEditView.h
# End Source File
# Begin Source File
SOURCE=.\ParamBar.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
# End Source File
# Begin Source File

View file

@ -57,7 +57,7 @@ BEGIN
SEPARATOR
BUTTON ID_APP_ABOUT
SEPARATOR
BUTTON ID_TOOLBAR_LAYERBAR
BUTTON ID_TOOLBAR_PARAMBAR
BUTTON ID_TOOLBAR_TILEPALETTE
SEPARATOR
BUTTON ID_TOOLBAR_COMBO
@ -178,12 +178,12 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDD_LAYERBAR DIALOGEX 0, 0, 92, 92
IDD_PARAMBAR DIALOGEX 0, 0, 92, 246
STYLE DS_MODALFRAME | WS_CHILD
EXSTYLE WS_EX_TOOLWINDOW
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
LISTBOX IDC_LAYERBAR_LIST,5,5,80,85,LBS_NOINTEGRALHEIGHT |
LISTBOX IDC_PARAMBAR_LAYER_LIST,7,82,80,85,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
END
@ -250,12 +250,12 @@ BEGIN
BOTTOMMARGIN, 48
END
IDD_LAYERBAR, DIALOG
IDD_PARAMBAR, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 85
TOPMARGIN, 7
BOTTOMMARGIN, 85
BOTTOMMARGIN, 239
END
END
#endif // APSTUDIO_INVOKED
@ -390,16 +390,8 @@ END
STRINGTABLE DISCARDABLE
BEGIN
ID_TOOLBAR_LAYERBAR "Hides/Shows Layer Bar"
ID_TOOLBAR_TILEPALETTE "Hides/Shows Tile Palette"
END
STRINGTABLE DISCARDABLE
BEGIN
IDC_LAYERBAR_NEW "Create New Layer"
IDC_LAYERBAR_DELETE "Delete Current Layer"
IDC_LAYERBAR_UP "Move Layer Up List"
IDC_LAYERBAR_DOWN "Move Layer Down List"
ID_TOOLBAR_PARAMBAR "Toggle Param Bar On/Off"
END
STRINGTABLE DISCARDABLE

View file

@ -152,9 +152,9 @@ void CMapEditDoc::MouseMove(CMapEditView *View,UINT nFlags, CPoint &point)
}
/*********************************************************************************/
void CMapEditDoc::ToggleLayerView(CMapEditView *View)
void CMapEditDoc::ToggleParamView(CMapEditView *View)
{
Core.ToggleLayerView(View);
Core.ToggleParamView(View);
}
/*********************************************************************************/

View file

@ -30,7 +30,7 @@ public:
void RButtonControl(CMapEditView *View,UINT nFlags, CPoint &point,BOOL DownFlag);
void MouseWheel(CMapEditView *View,UINT nFlags, short zDelta, CPoint &pt);
void MouseMove(CMapEditView *View,UINT nFlags, CPoint &point);
void ToggleLayerView(CMapEditView *View);
void ToggleParamView(CMapEditView *View);
void ToggleTileView(CMapEditView *View);
// Operations

View file

@ -35,7 +35,7 @@ BEGIN_MESSAGE_MAP(CMapEditView, CGLEnabledView)
ON_WM_RBUTTONDOWN()
ON_WM_RBUTTONUP()
ON_WM_MOUSEMOVE()
ON_COMMAND(ID_TOOLBAR_LAYERBAR, OnToolbarLayerbar)
ON_COMMAND(ID_TOOLBAR_PARAMBAR, OnToolbarParamBar)
ON_COMMAND(ID_TOOLBAR_TILEPALETTE, OnToolbarTilepalette)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@ -147,5 +147,5 @@ BOOL CMapEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt) {GetDocume
void CMapEditView::OnRButtonDown(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,TRUE);}
void CMapEditView::OnRButtonUp(UINT nFlags, CPoint point) {GetDocument()->RButtonControl(this,nFlags,point,FALSE);}
void CMapEditView::OnMouseMove(UINT nFlags, CPoint point) {GetDocument()->MouseMove(this,nFlags, point);}
void CMapEditView::OnToolbarLayerbar() {GetDocument()->ToggleLayerView(this);}
void CMapEditView::OnToolbarParamBar() {GetDocument()->ToggleParamView(this);}
void CMapEditView::OnToolbarTilepalette() {GetDocument()->ToggleTileView(this);}

View file

@ -55,7 +55,7 @@ protected:
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnToolbarLayerbar();
afx_msg void OnToolbarParamBar();
afx_msg void OnToolbarTilepalette();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()

View file

@ -3,23 +3,20 @@
// Used by MapEdit.rc
//
#define IDD_ABOUTBOX 100
#define IDD_LAYERBAR 103
#define IDD_PARAMBAR 103
#define IDD_TILETOOLBAR 104
#define IDR_MAINFRAME 128
#define IDR_TOOLBAR 128
#define IDR_MAPEDITYPE 129
#define IDD_TRASHHEAP 142
#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 IDC_PARAMBAR_LAYER_LIST 1011
#define IDC_TILETOOLBAR_COMBO 1013
#define IDC_TOOLBAR_COMBO 1018
#define IDC_LIST1 1019
#define ID_TOOLBAR_LAYERBAR 32773
#define ID_TOOLBAR_TILEPALETTE 32774
#define ID_TOOLBAR_COMBO 32777
#define ID_TOOLBAR_COMBOx 32777
#define ID_TOOLBAR_PARAMBAR 32783
#define ID_INDICATOR_CURSORXY 59142
// Next default values for new objects
@ -28,8 +25,8 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 143
#define _APS_NEXT_COMMAND_VALUE 32783
#define _APS_NEXT_CONTROL_VALUE 1019
#define _APS_NEXT_COMMAND_VALUE 32784
#define _APS_NEXT_CONTROL_VALUE 1020
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif