Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

Bar Graph Control

, 26 Jan 2004
Simple bar graph control class derived from CStatic
graphtest_bin.zip
GraphTest.exe
graphtest_src.zip
GraphTest
GraphTest.clw
GraphTest.dsp
res
GraphTest.ico
GraphTest.dsw
#if !defined(AFX_GRAPHCTRL_H__8D088C76_20F1_4F89_8527_C3B30E6F763D__INCLUDED_)
#define AFX_GRAPHCTRL_H__8D088C76_20F1_4F89_8527_C3B30E6F763D__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GraphCtrl.h : header file
//

#define UCM   28
#define UINCH 72

/////////////////////////////////////////////////////////////////////////////
// CGraphCtrl window

class CGraphCtrl : public CStatic
{
// Construction
public:
	CGraphCtrl();

// Attributes
public:

// Operations
public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CGraphCtrl)
	public:
	virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
	protected:
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	//}}AFX_VIRTUAL

// Implementation
public:
	void SetUnit(int);
	int unit;
	int offset;
	void SetBarValue(int, int);
	int SetNumberOfBars(int);
	int *bar;
	COLORREF *BC, BGC;
	virtual ~CGraphCtrl();
	UINT NumOfBars;

	// Generated message map functions
protected:
	//{{AFX_MSG(CGraphCtrl)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct);
	afx_msg void OnPaint();
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_GRAPHCTRL_H__8D088C76_20F1_4F89_8527_C3B30E6F763D__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 has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Shaibujan
Team Leader
India India
Mr. Shaibujan has got 9+ yrs of programming experience in C/C++, on various domains like Cryptography, Biometric Security, Network Security, Pattern Recognition, Image Processing, MPEG2, MPEG4, H.264, AAC etc.

| Advertise | Privacy | Mobile
Web02 | 2.8.140922.1 | Last Updated 27 Jan 2004
Article Copyright 2004 by Shaibujan
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid