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-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-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();}
|