[dad864]: IcewindCre.cpp  Maximize  Restore  History

Download this file

125 lines (101 with data), 3.0 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// IcewindCre.cpp : implementation file
//
#include "stdafx.h"
#include "chitem.h"
#include "IcewindCre.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// IcewindCre dialog
IcewindCre::IcewindCre(CWnd* pParent /*=NULL*/)
: CDialog(IcewindCre::IDD, pParent)
{
//{{AFX_DATA_INIT(IcewindCre)
//}}AFX_DATA_INIT
}
void IcewindCre::DoDataExchange(CDataExchange* pDX)
{
CString tmpstr;
int value;
int i;
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(IcewindCre)
//}}AFX_DATA_MAP
RetrieveVariable(tmpstr, the_creature.iwdheader.scriptname, false);
DDX_Text(pDX, IDC_SCRIPTNAME, tmpstr);
DDV_MaxChars(pDX, tmpstr, 32);
StoreVariable(tmpstr, the_creature.iwdheader.scriptname, false);
RetrieveVariable(tmpstr, the_creature.iwdheader.scriptname2, false);
DDX_Text(pDX, IDC_SCRIPTNAME2, tmpstr);
DDV_MaxChars(pDX, tmpstr, 32);
StoreVariable(tmpstr, the_creature.iwdheader.scriptname2, false);
for(i=0;i<4;i++)
{
value = the_creature.iwdheader.scriptflags[i];
DDX_Check(pDX, IDC_FLAG1+i, value);
the_creature.iwdheader.scriptflags[i] = (char) value;
}
for(i=0;i<5;i++)
{
DDX_Text(pDX, IDC_U1+i,the_creature.iwdheader.internals[i]);
}
}
BEGIN_MESSAGE_MAP(IcewindCre, CDialog)
//{{AFX_MSG_MAP(IcewindCre)
ON_EN_KILLFOCUS(IDC_SCRIPTNAME, DefaultKillfocus)
ON_BN_CLICKED(IDC_FLAG1, OnFlag1)
ON_BN_CLICKED(IDC_FLAG2, OnFlag2)
ON_BN_CLICKED(IDC_FLAG3, OnFlag3)
ON_EN_KILLFOCUS(IDC_SCRIPTNAME2, DefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U1, DefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U2, DefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U3, DefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U4, DefaultKillfocus)
ON_EN_KILLFOCUS(IDC_U5, DefaultKillfocus)
ON_BN_CLICKED(IDC_FLAG4, OnFlag4)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// IcewindCre message handlers
void IcewindCre::DefaultKillfocus()
{
UpdateData(UD_RETRIEVE);
UpdateData(UD_DISPLAY);
}
BOOL IcewindCre::OnInitDialog()
{
CDialog::OnInitDialog();
//tooltips
{
m_tooltip.Create(this,TTS_NOPREFIX);
m_tooltip.SetMaxTipWidth(200);
m_tooltip.SetTipBkColor(RGB(240,224,160));
m_tooltip.AddTool(GetDlgItem(IDCANCEL), IDS_CANCEL);
}
UpdateData(UD_DISPLAY);
return TRUE;
}
void IcewindCre::OnFlag1()
{
the_creature.iwdheader.scriptflags[0]=!the_creature.iwdheader.scriptflags[0];
}
void IcewindCre::OnFlag2()
{
the_creature.iwdheader.scriptflags[1]=!the_creature.iwdheader.scriptflags[1];
}
void IcewindCre::OnFlag3()
{
the_creature.iwdheader.scriptflags[2]=!the_creature.iwdheader.scriptflags[2];
}
void IcewindCre::OnFlag4()
{
the_creature.iwdheader.scriptflags[3]=!the_creature.iwdheader.scriptflags[3];
}
BOOL IcewindCre::PreTranslateMessage(MSG* pMsg)
{
m_tooltip.RelayEvent(pMsg);
return CDialog::PreTranslateMessage(pMsg);
}

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks