Click here to Skip to main content
15,885,546 members
Articles / Web Development / HTML

A Comprehensive CE Class Library to Replace ATL and MFC

Rate me:
Please Sign up or sign in to vote.
4.48/5 (14 votes)
4 Oct 2000CPOL 278.7K   998   70  
A collection of classes for CE that do not use ATL or MFC, plus an FTP client, database viewer, and sample application that solves beam deflection equations.
// DbMainWnd.h
#include "CeLib.h"
#include "CeMap.h"

#define MAX_RECS	40

class CeDbMainWnd: public CeSplitFrame
{
private:
//	CeCmdBar m_cmdbar;

	int m_nFontSize;
	HFONT m_hFont;

	HWND m_hwndList;
	HWND m_hwndTree;

	CeSimpleMap<DWORD,WORD> m_mapColumn;
	int m_nCols;
	CEOID m_oidDb;
	CeDb m_db;

	// quick hack, should change
	int m_nFirst;
	int m_nRecs;
	CeDbRecord m_records[MAX_RECS];
	CEOID m_oids[MAX_RECS];

	HIMAGELIST m_hImages;
	bool m_bPalm;
	bool m_bMoving;

private:
	void CreateBars();
	void CreateList(CeRect& rcList, bool bOwnerData);
	void ReCreateList(bool bOwnerData);
	bool CacheRecords(int nStart, int nCount);
	void ResetList();
	void ResetContent(CEOID oidDb, DWORD dwProp);

	CEOID GetListOid(int nSel);
	bool DeleteRecord(int nRecord);

	bool AddDatabases();
	void SetCtrlFont(HFONT hFont);

	void OnDeleteDb();
	void OnDeleteRecord();
	void OnRefresh();
	void OnProperties();
	void OnAbout();
	void OnOptions();

protected:
	virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual BOOL OnCreate(LPCREATESTRUCT lpCS, bool& bHandled);
	virtual void OnDestroy(bool& bHandled);
	virtual void OnClose(bool& bHandled);
	virtual LRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
	virtual void OnSettingChange( WORD wFlag, LPCTSTR pszSection, bool& bHandled );

	virtual LRESULT OnNotify(int nCtrlId, LPNMHDR pNMH, bool& bHandled);
		void OnColumnClick(NMLISTVIEW * pLV);
		LRESULT OnDispInfo(NMLVDISPINFO * pDI);
		LRESULT OnCacheHint(NMLVCACHEHINT * pCH);
		LRESULT OnFindItem(NMLVFINDITEM * pFI);

//	virtual void OnLButtonDown( UINT nFlags, POINT point, bool& bHandled );
//	virtual void OnLButtonUp( UINT nFlags, POINT point, bool& bHandled );
//	virtual void OnMouseMove( UINT nFlags, POINT point, bool& bHandled );
//	virtual void OnPaint( bool& bHandled );

public:
	CeDbMainWnd();
};

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
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions