SBSPSS/Utils/MapEdit/GUILayerTrigger.cpp

90 lines
2.6 KiB
C++
Raw Normal View History

2001-04-06 20:59:39 +02:00
// GUILayerTrigger.cpp : implementation file
//
#include "stdafx.h"
#include "mapedit.h"
#include "GUILayerTrigger.h"
2001-04-07 23:05:33 +02:00
#include "MapEditDoc.h"
#include "MainFrm.h"
2001-04-06 20:59:39 +02:00
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGUILayerTrigger dialog
CGUILayerTrigger::CGUILayerTrigger(CWnd* pParent /*=NULL*/)
: CDialog(CGUILayerTrigger::IDD, pParent)
{
2001-04-07 23:05:33 +02:00
DisableCallback(true);
2001-04-06 20:59:39 +02:00
//{{AFX_DATA_INIT(CGUILayerTrigger)
//}}AFX_DATA_INIT
2001-04-07 23:05:33 +02:00
DisableCallback(false);
2001-04-06 20:59:39 +02:00
}
void CGUILayerTrigger::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CGUILayerTrigger)
2001-05-05 23:18:12 +02:00
DDX_Control(pDX, IDC_TRIGGER_TARGETW_SPIN, m_TargetWSpin);
DDX_Control(pDX, IDC_TRIGGER_TARGETH_SPIN, m_TargetHSpin);
DDX_Control(pDX, IDC_TRIGGER_TEXT_TARGET_WH, m_TargetWHTxt);
DDX_Control(pDX, IDC_TRIGGER_TARGETW, m_TargetW);
DDX_Control(pDX, IDC_TRIGGER_TARGETH, m_TargetH);
2001-04-30 23:49:54 +02:00
DDX_Control(pDX, IDC_TRIGGER_TARGET, m_TargetTxt);
DDX_Control(pDX, IDC_TRIGGER_TARGETY_SPIN, m_TargetYSpin);
DDX_Control(pDX, IDC_TRIGGER_TARGETX_SPIN, m_TargetXSpin);
DDX_Control(pDX, IDC_TRIGGER_TARGETY, m_TargetY);
DDX_Control(pDX, IDC_TRIGGER_TARGETX, m_TargetX);
2001-04-09 16:56:05 +02:00
DDX_Control(pDX, IDC_TRIGGER_WIDTH_SPIN, m_WidthSpin);
DDX_Control(pDX, IDC_TRIGGER_HEIGHT_SPIN, m_HeightSpin);
2001-04-07 23:05:33 +02:00
DDX_Control(pDX, IDC_TRIGGER_WIDTH, m_Width);
DDX_Control(pDX, IDC_TRIGGER_HEIGHT, m_Height);
2001-04-06 20:59:39 +02:00
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CGUILayerTrigger, CDialog)
//{{AFX_MSG_MAP(CGUILayerTrigger)
2001-04-07 23:05:33 +02:00
ON_EN_CHANGE(IDC_TRIGGER_HEIGHT, OnParamChange)
ON_EN_CHANGE(IDC_TRIGGER_WIDTH, OnParamChange)
2001-04-30 23:49:54 +02:00
ON_EN_CHANGE(IDC_TRIGGER_TARGETX, OnParamChange)
ON_EN_CHANGE(IDC_TRIGGER_TARGETY, OnParamChange)
2001-05-05 23:18:12 +02:00
ON_EN_CHANGE(IDC_TRIGGER_TARGETH, OnParamChange)
ON_EN_CHANGE(IDC_TRIGGER_TARGETW, OnParamChange)
2001-04-06 20:59:39 +02:00
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
2001-04-07 23:05:33 +02:00
/////////////////////////////////////////////////////////////////////////////
void CGUILayerTrigger::SetVal(CEdit &Dlg,int Val)
{
CString Str;
if (!Dlg) return;
DisableCallback(true);
Str.Format("%i",Val);
Dlg.SetWindowText(Str);
DisableCallback(false);
}
/////////////////////////////////////////////////////////////////////////////
int CGUILayerTrigger::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 20:59:39 +02:00
/////////////////////////////////////////////////////////////////////////////
// CGUILayerTrigger message handlers
2001-04-07 23:05:33 +02:00
void CGUILayerTrigger::OnParamChange() {if (!CallbackFlag) theApp.GetCurrent()->GUIChanged();}