This repository was archived by the owner on Jun 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtomDialog.cpp
More file actions
103 lines (83 loc) · 2.68 KB
/
Copy pathAtomDialog.cpp
File metadata and controls
103 lines (83 loc) · 2.68 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
// AtomDialog.cpp : implementation file
//
#include "stdafx.h"
#include "LatticeRelaxation.h"
#include "AtomDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// AtomDialog dialog
AtomDialog::AtomDialog(CWnd* pParent /*=NULL*/)
: CDialog(AtomDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(AtomDialog)
m_Moveable = FALSE;
m_Visible = FALSE;
m_forceX = 0.0;
m_forceY = 0.0;
m_forceZ = 0.0;
m_positionX = 0.0;
m_positionY = 0.0;
m_positionZ = 0.0;
//}}AFX_DATA_INIT
}
void AtomDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(AtomDialog)
DDX_Control(pDX, IDC_ATOMTYPE_COMBO, m_atomTypeCombo);
DDX_Check(pDX, IDC_CHECK_MOVEABLE, m_Moveable);
DDX_Check(pDX, IDC_CHECK_VISIBLE, m_Visible);
DDX_Text(pDX, IDC_EDIT_FORCE_X, m_forceX);
DDX_Text(pDX, IDC_EDIT_FORCE_Y, m_forceY);
DDX_Text(pDX, IDC_EDIT_FORCE_Z, m_forceZ);
DDX_Text(pDX, IDC_EDIT_POSITION_X, m_positionX);
DDX_Text(pDX, IDC_EDIT_POSITION_Y, m_positionY);
DDX_Text(pDX, IDC_EDIT_POSITION_Z, m_positionZ);
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate) {
m_positionX *= 2.86;
m_positionY *= 2.86;
m_positionZ *= 2.86;
}
}
BEGIN_MESSAGE_MAP(AtomDialog, CDialog)
//{{AFX_MSG_MAP(AtomDialog)
ON_CBN_EDITCHANGE(IDC_ATOMTYPE_COMBO, OnEditchangeAtomtypeCombo)
ON_CBN_SELENDCANCEL(IDC_ATOMTYPE_COMBO, OnSelendcancelAtomtypeCombo)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// AtomDialog message handlers
BOOL AtomDialog::OnInitDialog()
{
CDialog::OnInitDialog();
std::set<AtomType*>::iterator atomTypesIterator;
for (atomTypesIterator = atomTypes.begin(); atomTypesIterator != atomTypes.end(); atomTypesIterator++) {
AtomType* atomType = *atomTypesIterator;
m_atomTypeCombo.AddString(atomType->name);
m_atomTypeCombo.SetItemDataPtr(m_atomTypeCombo.GetCount() - 1, atomType);
if (this->atomType == atomType) {
m_atomTypeCombo.SetCurSel(m_atomTypeCombo.GetCount() - 1);
}
}
m_positionX /= 2.86;
m_positionY /= 2.86;
m_positionZ /= 2.86;
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void AtomDialog::OnEditchangeAtomtypeCombo()
{
// TODO: Add your control notification handler code here
atomType = (AtomType*)m_atomTypeCombo.GetItemDataPtr(m_atomTypeCombo.GetCurSel());
}
void AtomDialog::OnSelendcancelAtomtypeCombo()
{
// TODO: Add your control notification handler code here
atomType = (AtomType*)m_atomTypeCombo.GetItemDataPtr(m_atomTypeCombo.GetCurSel());
}