-
Notifications
You must be signed in to change notification settings - Fork 4
/
DlgNetLayout.cpp
150 lines (117 loc) · 3.32 KB
/
DlgNetLayout.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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// DlgNetLayout.cpp : implementation file
//
#include "stdafx.h"
#include "audtest.h"
#include "DlgNetLayout.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgNetLayout dialog
CDlgNetLayout::CDlgNetLayout(CWnd* pParent /*=NULL*/)
: CDialog(CDlgNetLayout::IDD, pParent)
{
EnableAutomation();
//{{AFX_DATA_INIT(CDlgNetLayout)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgNetLayout::OnFinalRelease()
{
// When the last reference for an automation object is released
// OnFinalRelease is called. The base class will automatically
// deletes the object. Add additional cleanup required for your
// object before calling the base class.
CDialog::OnFinalRelease();
}
void CDlgNetLayout::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgNetLayout)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgNetLayout, CDialog)
//{{AFX_MSG_MAP(CDlgNetLayout)
ON_BN_CLICKED(IDC_HORZ1, OnHorz1)
ON_BN_CLICKED(IDC_HORZ2, OnHorz2)
ON_BN_CLICKED(IDC_HORZ3, OnHorz3)
ON_BN_CLICKED(IDC_VERT1, OnVert1)
ON_BN_CLICKED(IDC_VERT2, OnVert2)
ON_BN_CLICKED(IDC_VERT3, OnVert3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
BEGIN_DISPATCH_MAP(CDlgNetLayout, CDialog)
//{{AFX_DISPATCH_MAP(CDlgNetLayout)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_DISPATCH_MAP
END_DISPATCH_MAP()
// Note: we add support for IID_IDlgNetLayout to support typesafe binding
// from VBA. This IID must match the GUID that is attached to the
// dispinterface in the .ODL file.
// {A9092EE0-8AEC-11CF-AA04-444553540000}
static const IID IID_IDlgNetLayout =
{ 0xa9092ee0, 0x8aec, 0x11cf, { 0xaa, 0x4, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0 } };
BEGIN_INTERFACE_MAP(CDlgNetLayout, CDialog)
INTERFACE_PART(CDlgNetLayout, IID_IDlgNetLayout, Dispatch)
END_INTERFACE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgNetLayout message handlers
static void set_Icon( CDialog *pDlg, UINT nID, UINT nIcon)
{
CWinApp *papp = AfxGetApp();
HICON hicon;
hicon = papp->LoadIcon( nIcon);
if ( hicon) // the icon exists, at least
{
CButton *pbut = (CButton *)pDlg->GetDlgItem( nID);
if ( pbut)
pbut->SetIcon( hicon);
}
}
BOOL CDlgNetLayout::OnInitDialog()
{
CDialog::OnInitDialog();
m_nLayStyle = 0;
// Set up the icon displays
set_Icon( this, IDC_VERT1, IDR_COMPVERT1);
set_Icon( this, IDC_VERT2, IDR_COMPVERT2);
set_Icon( this, IDC_VERT3, IDR_COMPVERT3);
set_Icon( this, IDC_HORZ1, IDR_COMPHORZ1);
set_Icon( this, IDC_HORZ2, IDR_COMPHORZ2);
set_Icon( this, IDC_HORZ3, IDR_COMPHORZ3);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgNetLayout::OnHorz1()
{
m_nLayStyle = 1;
EndDialog( IDOK);
}
void CDlgNetLayout::OnHorz2()
{
m_nLayStyle = 2;
EndDialog( IDOK);
}
void CDlgNetLayout::OnHorz3()
{
m_nLayStyle = 3;
EndDialog( IDOK);
}
void CDlgNetLayout::OnVert1()
{
m_nLayStyle = 4;
EndDialog( IDOK);
}
void CDlgNetLayout::OnVert2()
{
m_nLayStyle = 5;
EndDialog( IDOK);
}
void CDlgNetLayout::OnVert3()
{
m_nLayStyle = 6;
EndDialog( IDOK);
}