SBSPSS/Utils/MapEdit/GUILayerPlatform.cpp

83 lines
2.2 KiB
C++
Raw Normal View History

2001-04-06 19:16:36 +02:00
// GUILayerPlatform.cpp : implementation file
//
#include "stdafx.h"
#include "mapedit.h"
#include "GUILayerPlatform.h"
2001-04-07 23:05:33 +02:00
#include "MapEditDoc.h"
#include "MainFrm.h"
2001-04-06 19:16:36 +02:00
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGUILayerPlatform dialog
CGUILayerPlatform::CGUILayerPlatform(CWnd* pParent /*=NULL*/)
: CDialog(CGUILayerPlatform::IDD, pParent)
{
2001-04-07 23:05:33 +02:00
DisableCallback(true);
2001-04-06 19:16:36 +02:00
//{{AFX_DATA_INIT(CGUILayerPlatform)
//}}AFX_DATA_INIT
2001-04-07 23:05:33 +02:00
DisableCallback(false);
2001-04-06 19:16:36 +02:00
}
void CGUILayerPlatform::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGUILayerPlatform)
2001-04-09 16:56:05 +02:00
DDX_Control(pDX, IDC_PLATFORM_TURNRATE_SPIN, m_TurnRateSpin);
DDX_Control(pDX, IDC_PLATFORM_SPEED_SPIN, m_SpeedSpin);
2001-04-07 23:05:33 +02:00
DDX_Control(pDX, IDC_PLATFORM_TYPE, m_Type);
DDX_Control(pDX, IDC_PLATFORM_MOVE_TYPE, m_MoveList);
DDX_Control(pDX, IDC_PLATFORM_COLLISION, m_Collision);
DDX_Control(pDX, IDC_PLATFORM_TURNRATE, m_TurnRate);
DDX_Control(pDX, IDC_PLATFORM_SPEED, m_Speed);
2001-04-06 19:16:36 +02:00
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGUILayerPlatform, CDialog)
//{{AFX_MSG_MAP(CGUILayerPlatform)
2001-04-07 23:05:33 +02:00
ON_EN_CHANGE(IDC_PLATFORM_SPEED, OnChangeParam)
ON_BN_CLICKED(IDC_PLATFORM_COLLISION, OnChangeParam)
ON_EN_CHANGE(IDC_PLATFORM_TURNRATE, OnChangeParam)
ON_CBN_SELCHANGE(IDC_PLATFORM_TYPE, OnChangeParam)
ON_CBN_SELCHANGE(IDC_PLATFORM_MOVE_TYPE, OnChangeParam)
2001-04-06 19:16:36 +02:00
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
2001-04-07 23:05:33 +02:00
/////////////////////////////////////////////////////////////////////////////
void CGUILayerPlatform::SetVal(CEdit &Dlg,int Val)
{
CString Str;
if (!Dlg) return;
DisableCallback(true);
Str.Format("%i",Val);
Dlg.SetWindowText(Str);
DisableCallback(false);
}
/////////////////////////////////////////////////////////////////////////////
int CGUILayerPlatform::GetVal(CEdit &Dlg)
{
CString Str;
int Val=0;
if (!Dlg) return(0);
Dlg.GetWindowText(Str);
if (Str.GetLength())
Val=atoi(Str);
return(Val);
}
2001-04-06 19:16:36 +02:00
/////////////////////////////////////////////////////////////////////////////
// CGUILayerPlatform message handlers
2001-04-07 23:05:33 +02:00
void CGUILayerPlatform::OnChangeParam() {if (!CallbackFlag) theApp.GetCurrent()->GUIChanged();}