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

Smart Auto-Complete (and Easy )

Rate me:
Please Sign up or sign in to vote.
3.32/5 (13 votes)
29 Jun 2003 52.6K   1K   31  
A Edit that Automatically completes your words
// AutoIni.h: interface for the CAutoIni class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AUTOINI_H__9C0E6447_56BC_466D_9E10_41138059909B__INCLUDED_)
#define AFX_AUTOINI_H__9C0E6447_56BC_466D_9E10_41138059909B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "AutoEdit.h"

class CAutoIni : public CAutoEdit  
{
public:
	void DeleteString(LPCSTR szKey);
	int AddString(LPCSTR szEntry);
	virtual bool OnSearch(LPCTSTR szFilter);
	CAutoIni();
	virtual ~CAutoIni();
protected:
	int m_iMaxKeys;
	CString m_strSectionName;// set the section for .ini or reg
	CString m_strNumItemsKey;// if not set: default is "NumItens"
	CString m_strItemDataKey;// if not set: default is "Item"
public:
	inline void SetKeyNumItem(LPCTSTR szKeyName)
	{
		m_strNumItemsKey = szKeyName;
	}

	inline CString GetKeyNumItem()
	{
		return m_strNumItemsKey;
	}

	inline void SetMaxKeys(int iMax)
	{
		m_iMaxKeys;
	}

	inline int GetMaxKeys()
	{
		return m_iMaxKeys;
	}

	inline void SetItemKey(LPCTSTR szItemKey)
	{
		m_strItemDataKey = szItemKey;
	}

	inline CString GetItemKey()
	{
		return m_strItemDataKey;
	}


	//{{AFX_VIRTUAL(CAutoIni)
	//}}AFX_VIRTUAL

	//{{AFX_MSG(CAutoIni)
	//}}AFX_MSG

	DECLARE_MESSAGE_MAP()

protected:
	virtual void OnFillList();
};

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


Written By
Software Developer (Senior)
Brazil Brazil
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions