-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathAddWinFctDlg.cpp
More file actions
79 lines (60 loc) · 1.75 KB
/
AddWinFctDlg.cpp
File metadata and controls
79 lines (60 loc) · 1.75 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
// AddWinFctDlg.cpp : implementation file
//
#include "stdafx.h"
#include "LFP_Demo_Dialog.h"
#include "AddWinFctDlg.h"
#include "MyDefinitions.h"
// CAddWinFctDlg dialog
IMPLEMENT_DYNAMIC(CAddWinFctDlg, CDialog)
//CAddWinFctDlg::CAddWinFctDlg(CWnd* pParent /*=NULL*/)
// : CDialog(CAddWinFctDlg::IDD, pParent),m_FilterDlg(NULL)
//{
//
//}
CAddWinFctDlg::CAddWinFctDlg(CDialog* filterDialog,CWnd* pParent /*=NULL*/)
: CDialog(CAddWinFctDlg::IDD, pParent)
{
m_FilterDlg=filterDialog;
}
CAddWinFctDlg::~CAddWinFctDlg()
{
}
void CAddWinFctDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_COMBO1, m_cbWindowType);
}
BEGIN_MESSAGE_MAP(CAddWinFctDlg, CDialog)
ON_CBN_DROPDOWN(IDC_COMBO1, &CAddWinFctDlg::OnCbnDropdownCombo1)
ON_BN_CLICKED(IDOK, &CAddWinFctDlg::OnBnClickedOk)
END_MESSAGE_MAP()
// CAddWinFctDlg message handlers
void CAddWinFctDlg::OnCbnDropdownCombo1()
{
// TODO: Add your control notification handler code here
if(m_cbWindowType.GetCount() == 0)
{
CRect lprect;
m_cbWindowType.GetWindowRect( &lprect );
lprect.bottom = lprect.top + 4 * m_cbWindowType.GetItemHeight( -1 ) + lprect.Height();
m_cbWindowType.SetWindowPos(NULL, 0, 0, lprect.Width(), lprect.Height(), SWP_NOMOVE | SWP_NOZORDER );
for(int i=4; i<8; i++)
{
m_cbWindowType.AddString(filterNames[i]);
}
}
}
void CAddWinFctDlg::OnBnClickedOk()
{
// TODO: Add your control notification handler code here
int FilterId = m_cbWindowType.GetCurSel() + 4 ;
//we check if the length of the kernel is a power of two and if
//a filter type has been selected from the drop-down list
if(FilterId >= 4 )
{
CFilterDlg* filterDlg;
filterDlg=dynamic_cast<CFilterDlg*>(m_FilterDlg);
filterDlg->AddWindowToList(FilterId);
OnOK();
}
}