-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDlgEditAntiFlags.cpp
More file actions
69 lines (55 loc) · 1.46 KB
/
DlgEditAntiFlags.cpp
File metadata and controls
69 lines (55 loc) · 1.46 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
#include "stdafx.h"
#include "WinDE.h"
#include "DlgEditAntiFlags.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
DlgEditAntiFlags::DlgEditAntiFlags(CWnd* pParent /*=NULL*/)
: CDialog(DlgEditAntiFlags::IDD, pParent)
{
antis[0] = 0;
antis[1] = 0;
//{{AFX_DATA_INIT(DlgEditAntiFlags)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void DlgEditAntiFlags::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(DlgEditAntiFlags)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(DlgEditAntiFlags, CDialog)
//{{AFX_MSG_MAP(DlgEditAntiFlags)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BOOL DlgEditAntiFlags::OnInitDialog()
{
CListBox* lb;
int i;
lb = (CListBox*)GetDlgItem(IDC_ANTI_FLAGS);
for(i = 0; i < AntiFlagsCount(); i++) {
lb->InsertString(i, anti_flags[i].name);
if(IS_SET(antis[anti_flags[i].bv->group], anti_flags[i].bv->vector))
lb->SetSel(i);
}
CDialog::OnInitDialog();
return TRUE;
}
void DlgEditAntiFlags::OnOK()
{
CListBox* lb;
int i;
lb = (CListBox*)GetDlgItem(IDC_ANTI_FLAGS);
for(i = 0; i < lb->GetCount(); i++) {
if(lb->GetSel(i)) {
SET_BIT(antis[anti_flags[i].bv->group], anti_flags[i].bv->vector);
} else if(IS_SET(antis[anti_flags[i].bv->group], anti_flags[i].bv->vector)) {
REMOVE_BIT(antis[anti_flags[i].bv->group], anti_flags[i].bv->vector);
}
}
CDialog::OnOK();
}