Click here to Skip to main content
15,879,535 members
Articles / Desktop Programming / ATL

CM_ConfigBuilder 1.2g: Visual Studio 6/Visual Studio 2005/Visual Studio 2008 Code Generator for Application Settings Graphic Management

Rate me:
Please Sign up or sign in to vote.
4.94/5 (126 votes)
12 Feb 2008CPOL17 min read 696K   9.8K   262  
CM_ConfigBuilder generates and compiles the required files to manage your application's settings/preferences and to store/retrieve them in XML format.
// AsTableRow.h: interface for the CAsTableRow class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(_ASTABLEROW_H_)
#define _ASTABLEROW_H_

#include <vector>
#include "AsTableCellEnum.h"
#include "AsFontInfo.h"

using namespace std;

class CAsBaseCell;

class CAsTableRow  
{
public:
	CAsTableRow();
	virtual ~CAsTableRow();

	enum enTableRowHitTest {
		enTableRowHitTest_None = 0,
		enTableRowHitTest_Splitter,
		enTableRowHitTest_FixedColumn,
		enTableRowHitTest_NonFixedColumn
	};

	// attributes
	//
	void SetNumColumns(int numColumns);
	int GetNumColumns() const;

	void SetDrawArea(const CRect& drawArea, bool forceRecalc);
	CRect GetDrawArea() const;

	void SetParentWnd(CWnd* parentWnd);

	void SetRowHeight(int height);
	int GetRowHeight() const;

	void SetColumnWidthList(const vector<int>& widthList);
	void SetColumnWidth(int index, int width);

	void SetFixedColumnsNumber(int number);
	int GetFixedColumnsNumber() const;

	void SetFirstNonFixedColIndex(int index);
	int GetFirstNonFixedColIndex() const;

	static int SplitterArea_;

	// operations
	//
	void Draw(CDC* pDC);

	CAsBaseCell* CreateCell(int index, enTableCellType cellType);
	CAsBaseCell* GetCell(int index);
	CAsBaseCell* GetFocusedCell(int& cellIndex);
	CAsBaseCell* GetSelectedCell(int& cellIndex);

	enTableRowHitTest HitTest(const CPoint& pt, int& index);

	bool ProcessMessage(DWORD msg, DWORD lParam, DWORD wParam, const CPoint& pt, const CRect& parentRect, bool& needRedraw);

	void SetVisible(bool visible);
	bool IsVisible() const;

	
protected:

	void DrawBackground(CDC* pDC);
	void DrawBorders(CDC* pDC);
	void DrawCells(CDC* pDC);

	void Clear();

	int numColumns_;
	int rowHeight_;
	CRect drawArea_;
	CWnd* parentWnd_;
	CAsFontInfo fontInfo_;
	vector<CAsBaseCell*> cells_;

	COLORREF borderColor_;

	vector<int> colWidthList_;
	int fixedColumnsNumber_;
	int firstNonFixedColIndex_;

	bool visible_;
};

#endif // !defined(_ASTABLEROW_H_)

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 Code Project Open License (CPOL)


Written By
Web Developer
Italy Italy
For all Stefano's latest code, binaries and tutorials visit www.codemachines.com

Comments and Discussions