Click here to Skip to main content
15,891,905 members
Articles / Desktop Programming / MFC

CGridCtrl 1.5

Rate me:
Please Sign up or sign in to vote.
3.95/5 (19 votes)
17 Jun 20042 min read 132.8K   6.4K   41  
This article presents a tiny grid control derived from the standard list control
#pragma once

#include "CGridCtrl.h"

#define CHECK_COUNT	9

//
//	class BgListView
//
class BgListView: public CGridCtrl
{
public:
	BgListView();

protected:
	void OnGetComboBoxItems(IN  int Row,
							IN  int Col,
							OUT bool& HasImages,
							OUT CStringList& Items,
							OUT CArray<int, int>& Images);

	bool OnGetCellColors(	IN  int Row,
							IN  int Col,
							OUT COLORREF& TextColor,
							OUT COLORREF& BkColor,
							OUT UINT8& TextStyle) const;

	CellType OnGetCellType(	IN int Row,
							IN int Col);

	void OnCheckBoxClick(	IN int Row,
							IN int Col);

	void OnCustomCellClick(	IN int Row,
							IN int Col);

	virtual void	PreSubclassWindow(void);
	virtual void	OnDestroy();

	void OnCellRBtnUp(		IN int Row,
							IN int Col,
							IN const RECT *CellRect,
							IN const CPoint& Point);

private:
	void AdjustBrightness(	IN OUT COLORREF& Color,
							IN INT16 Amount) const;

private:
	bool mChecks[CHECK_COUNT];
	CMenu mMenu;

};

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


Written By
Web Developer
Romania Romania
- C/C++ Programming
- Windows Device Driver programming (DDK)
- Low-level networking programmer (firewalls, routers, sniffers...)
- AutoCAD ObjectARX/DBX programming
- ADT Object Modeling Framework (OMF) programmer

Comments and Discussions