Click here to Skip to main content
15,893,564 members
Articles / Desktop Programming / MFC

GDI+ Plot ActiveX Control

Rate me:
Please Sign up or sign in to vote.
4.89/5 (10 votes)
5 Sep 2013LGPL32 min read 91.3K   12.1K   65  
GDI+ 2D plot ActiveX control
#if !defined(AFX_GDIPLUSPLOT_H__900E791F_268C_4E74_9EC3_F5334416881B__INCLUDED_)
#define AFX_GDIPLUSPLOT_H__900E791F_268C_4E74_9EC3_F5334416881B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.

/////////////////////////////////////////////////////////////////////////////
// CGDIPlusPlot wrapper class

class CGDIPlusPlot : public CWnd
{
protected:
	DECLARE_DYNCREATE(CGDIPlusPlot)
public:
	CLSID const& GetClsid()
	{
		static CLSID const clsid
			= { 0xdcd24674, 0xd4a1, 0x4ece, { 0xb6, 0xa0, 0xd8, 0x54, 0xdb, 0x5a, 0xd6, 0x92 } };
		return clsid;
	}
	virtual BOOL Create(LPCTSTR lpszClassName,
		LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect,
		CWnd* pParentWnd, UINT nID,
		CCreateContext* pContext = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID); }

    BOOL Create(LPCTSTR lpszWindowName, DWORD dwStyle,
		const RECT& rect, CWnd* pParentWnd, UINT nID,
		CFile* pPersist = NULL, BOOL bStorage = FALSE,
		BSTR bstrLicKey = NULL)
	{ return CreateControl(GetClsid(), lpszWindowName, dwStyle, rect, pParentWnd, nID,
		pPersist, bStorage, bstrLicKey); }

// Attributes
public:
	CString GetCaption();
	void SetCaption(LPCTSTR);
	BOOL GetXTime();
	void SetXTime(BOOL);
	CString GetXLabel();
	void SetXLabel(LPCTSTR);
	CString GetYLabel();
	void SetYLabel(LPCTSTR);
	short GetInterval();
	void SetInterval(short);
	CString GetAnnolabel();
	void SetAnnolabel(LPCTSTR);
	BOOL GetXTrack();
	void SetXTrack(BOOL);

// Operations
public:
	void PlotXY(double xValue, double yValue, short index);
	void SetRange(double xMin, double xMax, double yMin, double yMax);
	void PlotY(double newValue, short index);
	void ClearGraph();
	void AddElement(short color);
	void IsElementVisible(short index, BOOL visible);
	void SetXCursorPos(double xValue);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_GDIPLUSPLOT_H__900E791F_268C_4E74_9EC3_F5334416881B__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU Lesser General Public License (LGPLv3)


Written By
Engineer
China China
An individual human existence should be like a river - small at first, narrowly contained within its banks, and rushing passionately past boulders and over waterfalls. Gradually the river grows wider, the banks recede, the waters flow more quietly, and in the end, without any visible break, they become merged in the sea, and painlessly lose their individual being.

Comments and Discussions