Click here to Skip to main content
15,895,777 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 698.2K   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.
// CAsComboBoxCell.h
//

#if !defined(_CASCOMBOBOXCELL_H_)
#define _CASCOMBOBOXCELL_H_

#include <map>
#include "AsBaseCell.h"

using namespace std;

class CAsComboBox;

class CAsComboBoxCell: public CAsBaseCell
{
public:
	CAsComboBoxCell();
	~CAsComboBoxCell();

	virtual void SetDrawArea(const CRect& drawArea);
	virtual CSize GetMinSize();
	virtual void Draw(CDC* pDC);
	virtual bool HitTest(const CPoint& pt);
	virtual void SetVisible(bool visible);
	virtual void SetText(const string& text);
	
	virtual bool ProcessMessage(DWORD msg, DWORD lParam, DWORD wParam, const CPoint& pt, const CRect& parentRect, bool& needRedraw);

	virtual void SetFontInfo(const CAsFontInfo& fontInfo);

	virtual void KillFocus(bool storeData = true, bool redraw = true);
	virtual void SetFocus(bool redraw = true);
	
	virtual void AddItem(const string& str, int key);
	virtual void SelectItem(const string& caption);
	virtual void SelectItem(int key);

	virtual int GetSelectedItemKey();
	virtual string GetSelectedItemCaption();

	virtual string GetText();
	virtual void SetSelection(bool redraw = true);

	virtual void DeleteAllItems();
	
protected:
	
	void DrawComboButton(CDC* pDC);
	void StoreData();

	CAsComboBox* comboBox_;
	CFont font_;
	
	int selKey_;
	int oldSelKey_;
	string oldText_;
	map<int, string> items_;
};

#endif //!defined(_CASCOMBOBOXCELL_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