-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathKCOMChartPpg.cpp
More file actions
141 lines (111 loc) · 4.53 KB
/
Copy pathKCOMChartPpg.cpp
File metadata and controls
141 lines (111 loc) · 4.53 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
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
// KCOMChartPpg.cpp : Implementation of the CKCOMChartPropPage property page class.
#include "stdafx.h"
#include "KCOMChart.h"
#include "KCOMChartPpg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
IMPLEMENT_DYNCREATE(CKCOMChartPropPage, COlePropertyPage)
/////////////////////////////////////////////////////////////////////////////
// Message map
BEGIN_MESSAGE_MAP(CKCOMChartPropPage, COlePropertyPage)
//{{AFX_MSG_MAP(CKCOMChartPropPage)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Initialize class factory and guid
IMPLEMENT_OLECREATE_EX(CKCOMChartPropPage, "KCOMCHART.KCOMChartPropPage.1",
0x503612a6, 0x50b5, 0x11d3, 0xa7, 0xfe, 0, 0x80, 0xc8, 0x76, 0x3f, 0xa4)
/////////////////////////////////////////////////////////////////////////////
// CKCOMChartPropPage::CKCOMChartPropPageFactory::UpdateRegistry -
// Adds or removes system registry entries for CKCOMChartPropPage
BOOL CKCOMChartPropPage::CKCOMChartPropPageFactory::UpdateRegistry(BOOL bRegister)
{
if (bRegister)
return AfxOleRegisterPropertyPageClass(AfxGetInstanceHandle(),
m_clsid, IDS_KCOMCHART_PPG);
else
return AfxOleUnregisterClass(m_clsid, NULL);
}
/////////////////////////////////////////////////////////////////////////////
// CKCOMChartPropPage::CKCOMChartPropPage - Constructor
CKCOMChartPropPage::CKCOMChartPropPage() :
COlePropertyPage(IDD, IDS_KCOMCHART_PPG_CAPTION)
{
//{{AFX_DATA_INIT(CKCOMChartPropPage)
m_sAppearance = -1;
m_sBorderStyle = -1;
m_nTitleAlignment = -1;
m_nFooterAlignment = -1;
m_bDrawLegend = FALSE;
m_strTitle = _T("");
m_strFooter = _T("");
m_nSeriesCount = 0;
m_nGroupCount = 0;
m_bDrawGroupTitle = FALSE;
m_nDataMode = -1;
//}}AFX_DATA_INIT
}
/////////////////////////////////////////////////////////////////////////////
// CKCOMChartPropPage::DoDataExchange - Moves data between page and properties
void CKCOMChartPropPage::DoDataExchange(CDataExchange* pDX)
{
int nMode = GetDataMode();
GetDlgItem(IDC_EDIT_GROUPCOUNT)->EnableWindow(nMode);
GetDlgItem(IDC_EDIT_SERIESCOUNT)->EnableWindow(nMode);
//{{AFX_DATA_MAP(CKCOMChartPropPage)
DDP_CBIndex(pDX, IDC_COMBO_APPEARANCE, m_sAppearance, _T("Appearance") );
DDX_CBIndex(pDX, IDC_COMBO_APPEARANCE, m_sAppearance);
DDP_CBIndex(pDX, IDC_COMBO_BORDERSTYLE, m_sBorderStyle, _T("BorderStyle") );
DDX_CBIndex(pDX, IDC_COMBO_BORDERSTYLE, m_sBorderStyle);
DDP_CBIndex(pDX, IDC_COMBO_TITLEALIGNMENT, m_nTitleAlignment, _T("TitleAlignment") );
DDX_CBIndex(pDX, IDC_COMBO_TITLEALIGNMENT, m_nTitleAlignment);
DDP_CBIndex(pDX, IDC_COMBO_FOOTERALIGNMENT, m_nFooterAlignment, _T("FooterAlignment") );
DDX_CBIndex(pDX, IDC_COMBO_FOOTERALIGNMENT, m_nFooterAlignment);
DDP_Check(pDX, IDC_CHECK_DRAWLEGEND, m_bDrawLegend, _T("DrawLegend") );
DDX_Check(pDX, IDC_CHECK_DRAWLEGEND, m_bDrawLegend);
DDP_Text(pDX, IDC_EDIT_TITLE, m_strTitle, _T("Title") );
DDX_Text(pDX, IDC_EDIT_TITLE, m_strTitle);
DDP_Text(pDX, IDC_EDIT_FOOTER, m_strFooter, _T("Footer") );
DDX_Text(pDX, IDC_EDIT_FOOTER, m_strFooter);
DDP_Text(pDX, IDC_EDIT_SERIESCOUNT, m_nSeriesCount, _T("SeriesCount") );
DDX_Text(pDX, IDC_EDIT_SERIESCOUNT, m_nSeriesCount);
DDV_MinMaxLong(pDX, m_nSeriesCount, 1, 255);
DDP_Text(pDX, IDC_EDIT_GROUPCOUNT, m_nGroupCount, _T("GroupCount") );
DDX_Text(pDX, IDC_EDIT_GROUPCOUNT, m_nGroupCount);
DDV_MinMaxLong(pDX, m_nGroupCount, 1, 255);
DDP_Check(pDX, IDC_CHECK_DRAWGROUPTITLE, m_bDrawGroupTitle, _T("DrawGroupTitle") );
DDX_Check(pDX, IDC_CHECK_DRAWGROUPTITLE, m_bDrawGroupTitle);
DDP_CBIndex(pDX, IDC_COMBO_DATAMODE, m_nDataMode, _T("DataMode") );
DDX_CBIndex(pDX, IDC_COMBO_DATAMODE, m_nDataMode);
//}}AFX_DATA_MAP
DDP_PostProcessing(pDX);
}
/////////////////////////////////////////////////////////////////////////////
// CKCOMChartPropPage message handlers
BOOL CKCOMChartPropPage::OnInitDialog()
{
COlePropertyPage::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
int CKCOMChartPropPage::GetDataMode()
{
ULONG Ulong;
LPDISPATCH FAR *m_lpDispatch = GetObjectArray(&Ulong);
// Get the CCmdTarget object associated to any one of the above
// array elements
if (Ulong == 0)
return 0;
DISPPARAMS tParam;
tParam.rgdispidNamedArgs = NULL;
tParam.cArgs = 0;
tParam.cNamedArgs = 0;
tParam.rgvarg = 0;
COleVariant va;
HRESULT hr = m_lpDispatch[0]->Invoke(15, IID_NULL, LOCALE_USER_DEFAULT,
DISPATCH_METHOD | DISPATCH_PROPERTYGET, &tParam, &va, NULL, NULL);
return va.lVal;
}