Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version
Go to top

A comprehensive CE class library to replace ATL and MFC

, 4 Oct 2000
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.
kgwince-old.zip
WinCe
BeamEx
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.ini
BeamEx.plg
bitmap1.bmp
bmp00001.bmp
bmp00002.bmp
calc.bmp
calc16.bmp
circ_cross.ico
cir_cross.ico
cross_4.ico
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico00005.ico
ico00008.ico
ico00009.ico
ico00010.ico
icon1.ico
icon2.ico
icon4.ico
id_downl.bmp
Install
BeamEx.inf
BeamEx.ini
BeamEx.MIPS_PPCBW.CAB
BeamEx.MIPS_PPCColor.CAB
BeamEx.SH3_PPCColor.CAB
Setup.exe
i_cross.ico
l_cross.ico
magenic.ico
mssccprj.scc
obl_corss.ico
obl_cross.ico
options.bmp
options1.bmp
ping16.bmp
rect_cross.ico
scene_5.ico
scene_6.ico
tri_cross.ico
vssver.scc
CeLib
CeLabel.inl
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.old
CeLib.plg
CeLib.vcp
CeMisc.inl
CeProperty.inl
CeTab.inl
CeWnd.inl
mssccprj.scc
vssver.scc
WinLib.dsp
WinLib.dsw
dbView
bitmap1.bmp
bmp00001.bmp
db5.bmp
dbView.aps
DbView.dsp
dbView.dsw
dbView.old
dbView.plg
DbView.vcp
deldb.bp2
deldb5.bmp
delrec.bp2
delrecor.bmp
help16.bmp
help4.bmp
icon1.ico
icon2.ico
Install
dbView.inf
dbView.ini
Setup.exe
magenic.bmp
magenic.ico
mssccprj.scc
vssver.scc
ftpView
appicon.ico
bitmap1.bmp
bitmap2.bmp
bitmap3.bmp
bitmap4.bmp
bmp00001.bmp
bmp00002.bmp
db5.bmp
deldb.bp2
delrec.bp2
FtpView.dsp
ftpView.dsw
FtpView.old
ftpView.plg
FtpView.vcl
FtpView.vcp
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico171.ico
ico35.ico
icon1.ico
icon2.ico
imagelis.bmp
IMAGES.bmp
Install
ftpView.inf
ftpView.ini
Setup.exe
vssver.scc
magenic.bmp
magenic.ico
mssccprj.scc
options.bmp
options1.bmp
seperato.bmp
vssver.scc
Setup
ico101.ico
Setup.aps
Setup.dsp
setup.ico
Setup.plg
WinCe.dsw
WinLib.dsw
kgwince.zip
app.ico
BeamEx.dsp
BeamEx.dsw
BeamEx.ini
BeamEx.plg
BeamEx.vcl
BeamEx.vcp
bitmap1.bmp
bmp00001.bmp
bmp00002.bmp
calc.bmp
calc16.bmp
circ_cross.ico
cir_cross.ico
cross_4.ico
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico00005.ico
ico00008.ico
ico00009.ico
ico00010.ico
icon1.ico
icon2.ico
icon4.ico
id_downl.bmp
BeamEx.inf
BeamEx.ini
Setup.exe
i_cross.ico
l_cross.ico
magenic.ico
mssccprj.scc
obl_corss.ico
obl_cross.ico
options.bmp
options1.bmp
ping16.bmp
rect_cross.ico
scene_5.ico
scene_6.ico
tri_cross.ico
vssver.scc
CeFtp.vcp
CeFtp.vcw
CeLabel.inl
CeLib.aps
CeLib.dsp
CeLib.dsw
CeLib.plg
CeLib.vcl
CeLib.vcp
CeMisc.inl
CeProperty.inl
CeTab.inl
CeWnd.inl
mssccprj.scc
vssver.scc
WinLib.dsp
WinLib.dsw
bitmap1.bmp
bitmap2.bmp
bmp00001.bmp
db5.bmp
DbView.dsp
dbView.dsw
dbView.plg
DbView.vcl
DbView.vcp
deldb.bp2
deldb5.bmp
delrec.bp2
delrecor.bmp
help16.bmp
help4.bmp
icon1.ico
icon2.ico
dbView.inf
dbView.ini
Setup.exe
magenic.bmp
magenic.ico
menu1_5.bmp
mssccprj.scc
vssver.scc
appicon.ico
bitmap1.bmp
bitmap2.bmp
bitmap3.bmp
bitmap4.bmp
bmp00001.bmp
bmp00002.bmp
db5.bmp
deldb.bp2
delrec.bp2
FtpView.dsp
ftpView.dsw
ftpView.plg
FtpView.vcl
FtpView.vcp
FtpView.vcw
help16.bmp
help4.bmp
ico00001.ico
ico00002.ico
ico171.ico
ico35.ico
icon1.ico
icon2.ico
imagelis.bmp
IMAGES.bmp
ftpView.inf
ftpView.ini
Setup.exe
vssver.scc
magenic.bmp
magenic.ico
mssccprj.scc
newmenu.bmp
options.bmp
options1.bmp
rcdata1.bin
seperato.bmp
toolbar1.bmp
vssver.scc
WinCe.dsw
WinCe.vcw
#ifndef __CeTab_h__
#define __CeTab_h__

#include <commctrl.h>

#include "CeWnd.h"
#include "CeDialog.h"
#include "CeMisc.h"
#include "CeArray.h"

///////////////////////////////////////////////////////////////////////////////
//
// Wrapper around a dialog imbedded in a tab control
//
class CeTabPage: public CeScrollDialog
{
private:
	WCHAR m_szPage[32];

public:
	CeTabPage(UINT nDlgID = 0, LPCTSTR lpszLabel = NULL):
		CeScrollDialog(nDlgID)
		{
			if (lpszLabel)
				_tcsncpy(m_szPage, lpszLabel, 32);
			else
				*m_szPage = 0;
		}

	virtual ~CeTabPage()
		{}

	// need to be available BEFORE the dialog is created, used to create it
	// and it's tab
	virtual LPCTSTR GetTabTitle()
		{ return m_szPage; }
	virtual LPCTSTR GetID()
		{ return m_lpTemplateName; }

	virtual BOOL OnSetActive()
		{ return TRUE; }
	virtual BOOL OnKillActive()
		{ return TRUE; }
	virtual void OnApply()
		{ }
	virtual void OnReset()
		{ }
};


///////////////////////////////////////////////////////////////////////////////
//
// Wrapper around a Tab Control
//
class CeTabCtrl: public CeWnd
{
// Constructors
public:
	CeTabCtrl();
	virtual BOOL Create(DWORD dwStyle, const RECT& rect, HWND hWndParent, UINT nID, HINSTANCE hInst);

// Attributes
	int GetItemCount() const;
	BOOL GetItem(int nItem, TCITEM* pTabCtrlItem) const;
	BOOL SetItem(int nItem, TCITEM* pTabCtrlItem);
	BOOL SetItemExtra(int nBytes);
	BOOL GetItemRect(int nItem, LPRECT lpRect) const;
	int GetCurSel() const;
	int SetCurSel(int nItem);
	void SetCurFocus(int nItem);
	//CeSize SetItemSize(CeSize size);
	void SetPadding(const SIZE& size);
	int GetRowCount() const;
	int GetCurFocus() const;
	int SetMinTabWidth(int cx);
	DWORD GetExtendedStyle();
	DWORD SetExtendedStyle(DWORD dwNewStyle, DWORD dwExMask = 0);
	DWORD GetItemState(int nItem, DWORD dwMask) const;
	BOOL SetItemState(int nItem, DWORD dwMask, DWORD dwState);

// Operations
	BOOL InsertItem(int nItem, TCITEM* pTabCtrlItem);
	BOOL InsertItem(int nItem, LPCTSTR lpszItem);
	BOOL InsertItem(int nItem, LPCTSTR lpszItem, int nImage);
	BOOL InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem,
		int nImage, LPARAM lParam);
	BOOL InsertItem(UINT nMask, int nItem, LPCTSTR lpszItem,
		int nImage, LPARAM lParam, DWORD dwState, DWORD dwStateMask);
	BOOL DeleteItem(int nItem);
	BOOL DeleteAllItems();
	void AdjustRect(BOOL bLarger, LPRECT lpRect);
	void RemoveImage(int nImage);
	int HitTest(TCHITTESTINFO* pHitTestInfo) const;
	void DeselectAll(BOOL fExcludeFocus);
	BOOL HighlightItem(int idItem, BOOL fHighlight = TRUE);

	HIMAGELIST SetImageList(HIMAGELIST hImageList);
	HIMAGELIST GetImageList() const;

// Implementation
public:
	virtual ~CeTabCtrl();
protected:
//	virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
//	virtual void OnDestroy();
};

#include "CeTab.inl"

/////////////////////////////////////////////////////////////////////////////
// CeTabSheet window
//
// A control reponsible for creating, holding and displaying embedded
// tab pages (dialogs).  The pages will be sized with the control
// so that the control can be embedded in any application window
// and not worry about it's children
//

class CeTabSheet : public CeWnd
{
private:
	void FindSizeOfTabWindow(HWND hWndPage, LPRECT pRect);
	int FindPage(CeTabPage *pPage) const;

	HINSTANCE m_hInst;
	CeTabCtrl m_tabCtrl;
	CeArray<CeTabPage*> m_arPages;
	int m_nActivePage;
	DWORD m_dwTabStyle;

// Construction
public:
	CeTabSheet();
	virtual BOOL Create(DWORD dwStyle, const RECT& rect, HWND hWndParent, UINT nID, HINSTANCE hInst = NULL);

// Attributes
public:
	int GetPageIndex(CeTabPage* pPage) const { return FindPage(pPage); }
	int GetPageCount() const { return m_arPages.GetSize(); }
	CeTabPage* GetPage(int nPage) const { return (nPage < 0) ? NULL: (CeTabPage*)m_arPages[nPage]; }
	int GetActiveIndex() const { return m_nActivePage; }
	CeTabPage* GetActivePage() const { return GetPage(m_nActivePage); }
    void GetPageRect(LPRECT rectWnd);

// Operations
public:
	BOOL SetActivePage(int nPage);
	BOOL SetActivePage(CeTabPage* pPage);
//	BOOL ModifyStyle(DWORD dwRemove, DWORD dwAdd, UINT nFlags = 0);
	void AddPage(CeTabPage* pPage, int nBitmap=-1); 
	void RemovePage(CeTabPage* Page);
	void RemovePage(int nPage);
	
	void Apply();
	void Reset();

	void RemoveImage(int nImage)
		{ ASSERT(::IsWindow(m_tabCtrl.m_hWnd)); m_tabCtrl.RemoveImage(nImage); }
	HIMAGELIST SetImageList(HIMAGELIST hImageList)
		{ ASSERT(::IsWindow(m_tabCtrl.m_hWnd)); return m_tabCtrl.SetImageList(hImageList); }
	HIMAGELIST GetImageList() const
		{ ASSERT(::IsWindow(m_tabCtrl.m_hWnd)); return m_tabCtrl.GetImageList(); }

// Overrides
	virtual LRESULT OnNotifyTabChanged();
	virtual LRESULT OnNotifyTabChanging();

// Implementation
public:
	virtual ~CeTabSheet();

protected:
	virtual int OnCreate( LPCREATESTRUCT lpCS, bool& bHandled ); 
	virtual void OnPaint( bool& bHandled );
	virtual void OnSize( UINT nType, int cx, int cy, bool& bHandled );
	virtual LRESULT OnNotify(int nCtrlId, LPNMHDR pNMH, bool& bHandled);
	virtual LRESULT OnMessage(UINT uMsg, WPARAM wParam, LPARAM lParam, bool& bHandled);
};


#endif // __CeTab_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)

Share

About the Author

Kenny G

United States United States
No Biography provided

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 5 Oct 2000
Article Copyright 2000 by Kenny G
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid