-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAssemblyProductSelectDlg.cpp
71 lines (57 loc) · 2.17 KB
/
AssemblyProductSelectDlg.cpp
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
// AssemblyProductSelectDlg.cpp : implementation file
//
#include "stdafx.h"
#include "AP210Viewer.h"
#include "AssemblyProductSelectDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAssemblyProductSelectDlg dialog
CAssemblyProductSelectDlg::CAssemblyProductSelectDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAssemblyProductSelectDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAssemblyProductSelectDlg)
m_AssemblyProduct = _T("");
//}}AFX_DATA_INIT
}
void CAssemblyProductSelectDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAssemblyProductSelectDlg)
DDX_Control(pDX, IDC_ASSEMBLY_PRODUCT, m_controlAssemblyProduct);
DDX_LBString(pDX, IDC_ASSEMBLY_PRODUCT, m_AssemblyProduct);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAssemblyProductSelectDlg, CDialog)
//{{AFX_MSG_MAP(CAssemblyProductSelectDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAssemblyProductSelectDlg message handlers
BOOL CAssemblyProductSelectDlg::OnInitDialog() {
static SdaiEntity P = sdaiGetEntity(ModelRef, "product");
static SdaiAttr P_ID = sdaiGetAttrDefinition(P, "id");
SdaiAppInstance asmp; // assembly product
SdaiString id; // product.id
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SdaiIterator productItor = sdaiCreateIterator(products);
sdaiBeginning(productItor);
while(sdaiNext(productItor)) {
sdaiGetAggrByIterator(productItor, sdaiINSTANCE, &asmp);
TRACE(" asmp: %s\r\n", _sdaiGetPart21Description(asmp));
sdaiGetAttr(asmp, P_ID, sdaiSTRING, &id);
TRACE(" id: %s\r\n", id);
m_controlAssemblyProduct.AddString(id);
}
sdaiDeleteIterator(productItor);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CAssemblyProductSelectDlg::setValues(SdaiModel AP210Model, SdaiNPL prods) {
ModelRef = AP210Model;
products = prods;
}