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

A comprehensive CE class library to replace ATL and MFC

, 4 Oct 2000 CPOL
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 __CeCombo_h__
#define __CeCombo_h__

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

#include "CeWnd.h"

class CeCombo : public CeWnd
{
// Constructors
public:
	CeCombo();
	BOOL Create(LPCTSTR lpszText, DWORD dwStyle, DWORD dwExStyle, const RECT& rect, HWND hParentWnd, UINT nID, HINSTANCE hInst=NULL);

// Attributes
	// for entire combo box
	int GetCount() const;
	int GetCurSel() const;
	int SetCurSel(int nSelect);
	LCID GetLocale() const;
	LCID SetLocale(LCID nNewLocale);
// Win4
	int GetTopIndex() const;
	int SetTopIndex(int nIndex);
	int InitStorage(int nItems, UINT nBytes);
	void SetHorizontalExtent(UINT nExtent);
	UINT GetHorizontalExtent() const;
	int SetDroppedWidth(UINT nWidth);
	int GetDroppedWidth() const;

	// for edit control
	DWORD GetEditSel() const;
	BOOL LimitText(int nMaxChars);
	BOOL SetEditSel(int nStartChar, int nEndChar);

	// for combobox item
	DWORD GetItemData(int nIndex) const;
	int SetItemData(int nIndex, DWORD dwItemData);
	void* GetItemDataPtr(int nIndex) const;
	int SetItemDataPtr(int nIndex, void* pData);
	int GetLBText(int nIndex, LPTSTR lpszText) const;
	int GetLBTextLen(int nIndex) const;

	int SetItemHeight(int nIndex, UINT cyItemHeight);
	int GetItemHeight(int nIndex) const;
	int FindStringExact(int nIndexStart, LPCTSTR lpszFind) const;
	int SetExtendedUI(BOOL bExtended = TRUE);
	BOOL GetExtendedUI() const;
	void GetDroppedControlRect(LPRECT lprect) const;
	BOOL GetDroppedState() const;

// Operations
	// for drop-down combo boxes
	void ShowDropDown(BOOL bShowIt = TRUE);

	// manipulating listbox items
	int AddString(LPCTSTR lpszString);
	int DeleteString(UINT nIndex);
	int InsertString(int nIndex, LPCTSTR lpszString);
	void ResetContent();
	int Dir(UINT attr, LPCTSTR lpszWildCard);

	// selection helpers
	int FindString(int nStartAfter, LPCTSTR lpszString) const;
	int SelectString(int nStartAfter, LPCTSTR lpszString);

	// Clipboard operations
	void Clear();
	void Copy();
	void Cut();
	void Paste();

// Overridables (must override draw, measure and compare for owner draw)
//	virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
//	virtual void MeasureItem(LPMEASUREITEMSTRUCT lpMeasureItemStruct);
//	virtual int CompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct);
//	virtual void DeleteItem(LPDELETEITEMSTRUCT lpDeleteItemStruct);

// Implementation
public:
	virtual ~CeCombo();

protected:
//	virtual BOOL OnChildNotify(UINT, WPARAM, LPARAM, LRESULT*);
};


inline CeCombo::CeCombo()
	{ }
inline CeCombo::~CeCombo()
	{ }

inline BOOL CeCombo::Create(LPCTSTR lpszText, DWORD dwStyle, DWORD dwExStyle, const RECT& rect, HWND hParentWnd, UINT nID, HINSTANCE hInst)
	{ return CeWnd::Create(_T("COMBOBOX"), hParentWnd, rect, lpszText, dwStyle, dwExStyle, nID, hInst); }

inline int CeCombo::GetCount() const
	{ return (int) ((CeCombo*)this)->SendMessage(CB_GETCOUNT, 0, 0); }
inline int CeCombo::GetCurSel() const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETCURSEL, 0, 0); }
inline int CeCombo::SetCurSel(int nSelect)
	{ return (int)SendMessage(CB_SETCURSEL, nSelect, 0); }
inline DWORD CeCombo::GetEditSel() const
	{ return ((CeCombo*)this)->SendMessage(CB_GETEDITSEL, 0, 0); }
inline BOOL CeCombo::LimitText(int nMaxChars)
	{ return (BOOL)SendMessage(CB_LIMITTEXT, nMaxChars, 0); }
inline BOOL CeCombo::SetEditSel(int nStartChar, int nEndChar)
	{ return (BOOL)SendMessage(CB_SETEDITSEL, 0, MAKELONG(nStartChar, nEndChar)); }
inline DWORD CeCombo::GetItemData(int nIndex) const
	{ return ((CeCombo*)this)->SendMessage(CB_GETITEMDATA, nIndex, 0); }
inline int CeCombo::SetItemData(int nIndex, DWORD dwItemData)
	{ return (int)SendMessage(CB_SETITEMDATA, nIndex, (LPARAM)dwItemData); }
inline void* CeCombo::GetItemDataPtr(int nIndex) const
	{ return (LPVOID)GetItemData(nIndex); }
inline int CeCombo::SetItemDataPtr(int nIndex, void* pData)
	{ return SetItemData(nIndex, (DWORD)(LPVOID)pData); }
inline int CeCombo::GetLBText(int nIndex, LPTSTR lpszText) const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETLBTEXT, nIndex, (LPARAM)lpszText); }
inline int CeCombo::GetLBTextLen(int nIndex) const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETLBTEXTLEN, nIndex, 0); }
inline void CeCombo::ShowDropDown(BOOL bShowIt)
	{ SendMessage(CB_SHOWDROPDOWN, bShowIt, 0); }
inline int CeCombo::AddString(LPCTSTR lpszString)
	{ return (int)SendMessage(CB_ADDSTRING, 0, (LPARAM)lpszString); }
inline int CeCombo::DeleteString(UINT nIndex)
	{ return (int)SendMessage(CB_DELETESTRING, nIndex, 0);}
inline int CeCombo::InsertString(int nIndex, LPCTSTR lpszString)
	{ return (int)SendMessage(CB_INSERTSTRING, nIndex, (LPARAM)lpszString); }
inline void CeCombo::ResetContent()
	{ SendMessage(CB_RESETCONTENT, 0, 0); }
inline int CeCombo::FindString(int nStartAfter, LPCTSTR lpszString) const
	{ return (int)((CeCombo*)this)->SendMessage(CB_FINDSTRING, nStartAfter,	(LPARAM)lpszString); }
inline int CeCombo::SelectString(int nStartAfter, LPCTSTR lpszString)
	{ return (int)SendMessage(CB_SELECTSTRING, nStartAfter, (LPARAM)lpszString); }
inline void CeCombo::Clear()
	{ SendMessage(WM_CLEAR, 0, 0); }
inline void CeCombo::Copy()
	{ SendMessage(WM_COPY, 0, 0); }
inline void CeCombo::Cut()
	{ SendMessage(WM_CUT, 0, 0); }
inline void CeCombo::Paste()
	{ SendMessage(WM_PASTE, 0, 0); }
inline int CeCombo::SetItemHeight(int nIndex, UINT cyItemHeight)
	{ return (int)SendMessage(CB_SETITEMHEIGHT, nIndex, MAKELONG(cyItemHeight, 0)); }
inline int CeCombo::GetItemHeight(int nIndex) const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETITEMHEIGHT, nIndex, 0L); }
inline int CeCombo::FindStringExact(int nIndexStart, LPCTSTR lpszFind) const
	{ return (int)((CeCombo*)this)->SendMessage(CB_FINDSTRINGEXACT, nIndexStart, (LPARAM)lpszFind); }
inline int CeCombo::SetExtendedUI(BOOL bExtended )
	{ return (int)SendMessage(CB_SETEXTENDEDUI, bExtended, 0L); }
inline BOOL CeCombo::GetExtendedUI() const
	{ return (BOOL)((CeCombo*)this)->SendMessage(CB_GETEXTENDEDUI, 0, 0L); }
inline void CeCombo::GetDroppedControlRect(LPRECT lprect) const
	{ ((CeCombo*)this)->SendMessage(CB_GETDROPPEDCONTROLRECT, 0, (DWORD)lprect); }
inline BOOL CeCombo::GetDroppedState() const
	{ return (BOOL)((CeCombo*)this)->SendMessage(CB_GETDROPPEDSTATE, 0, 0L); }
inline LCID CeCombo::GetLocale() const
	{ return (LCID)((CeCombo*)this)->SendMessage(CB_GETLOCALE, 0, 0); }
inline LCID CeCombo::SetLocale(LCID nNewLocale)
	{ return (LCID)SendMessage(CB_SETLOCALE, (WPARAM)nNewLocale, 0); }

#ifndef _WIN32_WCE
inline int CeCombo::Dir(UINT attr, LPCTSTR lpszWildCard)
	{ return (int)SendMessage(CB_DIR, attr, (LPARAM)lpszWildCard); }
#endif

#if (WINVER >= 0x400)
inline int CeCombo::GetTopIndex() const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETTOPINDEX, 0, 0); }
inline int CeCombo::SetTopIndex(int nIndex)
	{ return (int)SendMessage(CB_SETTOPINDEX, nIndex, 0); }
inline int CeCombo::InitStorage(int nItems, UINT nBytes)
	{ return (int)SendMessage(CB_INITSTORAGE, (WPARAM)nItems, nBytes); }
inline void CeCombo::SetHorizontalExtent(UINT nExtent)
	{ SendMessage(CB_SETHORIZONTALEXTENT, nExtent, 0); }
inline UINT CeCombo::GetHorizontalExtent() const
	{ return (UINT)((CeCombo*)this)->SendMessage(CB_GETHORIZONTALEXTENT, 0, 0); }
inline int CeCombo::SetDroppedWidth(UINT nWidth)
	{ return (int)SendMessage(CB_SETDROPPEDWIDTH, nWidth, 0); }
inline int CeCombo::GetDroppedWidth() const
	{ return (int)((CeCombo*)this)->SendMessage(CB_GETDROPPEDWIDTH, 0, 0); }
#endif


#endif // __CeCombo_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
Web02 | 2.8.141022.2 | Last Updated 5 Oct 2000
Article Copyright 2000 by Kenny G
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid