Click here to Skip to main content
15,893,790 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 281.8K   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.
///////////////////////////////////////////////////////////////////////////////

#include <commctrl.h>

inline CeStatic::CeStatic()
	{}
inline BOOL CeStatic::Create(LPCTSTR lpszText, DWORD dwStyle, const RECT& rect, HWND hParentWnd, UINT nID, HINSTANCE hInst)
	{ return CeWnd::Create(_T("STATIC"), hParentWnd, rect, lpszText, dwStyle, 0, nID, hInst); }
//	{ return CeWnd::Create(_T("TTSTATIC"), hParentWnd, rect, lpszText, dwStyle, 0, nID, hInst); }

inline HBITMAP CeStatic::SetBitmap(HBITMAP hBitmap)
	{ return (HBITMAP) SendMessage(STM_SETIMAGE, IMAGE_BITMAP, (LPARAM)hBitmap); }
inline HBITMAP CeStatic::GetBitmap() const
	{ return (HBITMAP) ::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_BITMAP, 0L); }
inline HICON CeStatic::SetIcon(HICON hIcon)
	{ return (HICON) SendMessage(STM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon); }
inline HICON CeStatic::GetIcon() const
	{ return (HICON) ::SendMessage(m_hWnd, STM_GETIMAGE, IMAGE_ICON, 0L); }

inline CeStatic::~CeStatic()
	{}

///////////////////////////////////////////////////////////////////////////////

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

inline int CeEdit::Enable(BOOL fEnable)
	{ return ::Edit_Enable(m_hWnd, fEnable); }
inline int CeEdit::GetText(LPTSTR lpch, int cchMax)
	{ return GetWindowText(lpch, cchMax); }
inline int CeEdit::GetTextLength()
	{ return ::Edit_GetTextLength(m_hWnd); }
inline int CeEdit::SetText(LPCTSTR lpsz)
	{ return ::Edit_SetText(m_hWnd, lpsz); }
inline void CeEdit::LimitText(int cchMax)
	{ Edit_LimitText(m_hWnd, cchMax); }

inline int CeEdit::GetLineCount()
	{ return Edit_GetLineCount(m_hWnd); }

inline int CeEdit::GetLine(int line, LPCTSTR lpch, int cchMax)
	{ return Edit_GetLine(m_hWnd, line, lpch, cchMax); }
inline void CeEdit::GetRect(LPRECT lprc)
	{ Edit_GetRect(m_hWnd, lprc); }
inline void CeEdit::SetRect(LPCRECT lprc)
	{ Edit_SetRect(m_hWnd, lprc); }
inline void CeEdit::SetRectNoPaint(LPCRECT lprc)
	{ Edit_SetRectNoPaint(m_hWnd, lprc); }
inline int CeEdit::GetSel()
	{ return Edit_GetSel(m_hWnd); }
inline void CeEdit::SetSel(int ichStart, int ichEnd)
	{ Edit_SetSel(m_hWnd, ichStart, ichEnd); }
inline void CeEdit::ReplaceSel(LPCTSTR lpszReplace)
	{ Edit_ReplaceSel(m_hWnd, lpszReplace); }
inline BOOL CeEdit::GetModify()
	{ return Edit_GetModify(m_hWnd); }
inline void CeEdit::SetModify(BOOL fModified)
	{ Edit_SetModify(m_hWnd, fModified); }
inline int CeEdit::ScrollCaret()
	{ return Edit_ScrollCaret(m_hWnd); }
inline int CeEdit::LineFromChar(int ich)
	{ return Edit_LineFromChar(m_hWnd, ich); }
inline int CeEdit::LineIndex(int line)
	{ return Edit_LineIndex(m_hWnd, line); }
inline int CeEdit::LineLength(int line)
	{ return Edit_LineLength(m_hWnd, line); }
inline void CeEdit::Scroll(int dv, int dh)
	{ Edit_Scroll(m_hWnd, dv, dh); }
inline int CeEdit::CanUndo()
	{ return Edit_CanUndo(m_hWnd); }
inline int CeEdit::Undo()
	{ return Edit_Undo(m_hWnd); }
inline void CeEdit::EmptyUndoBuffer()
	{ Edit_EmptyUndoBuffer(m_hWnd); }
inline void CeEdit::SetTabStops(int cTabs, int* lpTabs)
	{ Edit_SetTabStops(m_hWnd, cTabs, lpTabs); }
inline int CeEdit::FmtLines(BOOL fAddEOL)
	{ return Edit_FmtLines(m_hWnd, fAddEOL); }
inline int CeEdit::GetFirstVisibleLine()
	{ return Edit_GetFirstVisibleLine(m_hWnd); }
inline int CeEdit::SetReadOnly(BOOL fReadOnly)
	{ return Edit_SetReadOnly(m_hWnd, fReadOnly); }
inline int CeEdit::GetPasswordChar()
	{ return Edit_GetPasswordChar(m_hWnd); }
inline void CeEdit::SetPasswordChar(TCHAR ch)
	{ Edit_SetPasswordChar(m_hWnd, ch); }

///////////////////////////////////////////////////////////////////////////////
inline CeDateTime::CeDateTime()
	{}

inline CeDateTime::~CeDateTime()
	{}

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

//   returns GDT_NONE if "none" is selected (DTS_SHOWNONE only)
//   returns GDT_VALID and modifies *pst to be the currently selected value
inline DWORD CeDateTime::GetSystemtime(LPSYSTEMTIME pst) const
	{ return DateTime_GetSystemtime(m_hWnd, pst); }

//   if gd==GDT_NONE, sets datetimepick to None (DTS_SHOWNONE only)
//   if gd==GDT_VALID, sets datetimepick to *pst
//   returns TRUE on success, FALSE on error (such as bad params)
inline BOOL CeDateTime::SetSystemtime(DWORD gd, LPSYSTEMTIME pst)
	{ return DateTime_SetSystemtime(m_hWnd, gd, pst); }

//   modifies rgst[0] to be the minimum ALLOWABLE systemtime (or 0 if no minimum)
//   modifies rgst[1] to be the maximum ALLOWABLE systemtime (or 0 if no maximum)
//   returns GDTR_MIN|GDTR_MAX if there is a minimum|maximum limit
inline DWORD CeDateTime::GetRange(LPSYSTEMTIME rgst) const
	{ return DateTime_GetRange(m_hWnd, rgst); }

//   if GDTR_MIN, sets the minimum ALLOWABLE systemtime to rgst[0], otherwise removes minimum
//   if GDTR_MAX, sets the maximum ALLOWABLE systemtime to rgst[1], otherwise removes maximum
//   returns TRUE on success, FALSE on error (such as invalid parameters)
inline BOOL CeDateTime::SetRange(DWORD gdtr, LPSYSTEMTIME rgst)
	{ return DateTime_SetRange(m_hWnd, gdtr, rgst);	}

//   sets the display formatting string to sz (see GetDateFormat and GetTimeFormat for valid formatting chars)
//   NOTE: 'X' is a valid formatting character which indicates that the application
//   will determine how to display information. Such apps must support DTN_WMKEYDOWN,
//   DTN_FORMAT, and DTN_FORMATQUERY.
inline BOOL CeDateTime::SetFormat(LPCTSTR sz)
	{ return DateTime_SetFormat(m_hWnd, sz); }

inline COLORREF CeDateTime::SetMonthCalColor(int iColor, COLORREF clr)
	{ return DateTime_SetMonthCalColor(m_hWnd, iColor, clr); }

inline COLORREF CeDateTime::GetMonthCalColor(int iColor)
	{ return DateTime_GetMonthCalColor(m_hWnd, iColor); }

//   returns the HWND of the MonthCal popup window. Only valid
// between DTN_DROPDOWN and DTN_CLOSEUP notifications.
inline HWND CeDateTime::GetMonthCal() const
	{ return DateTime_GetMonthCal(m_hWnd); }

inline void CeDateTime::SetMonthCalFont(HFONT hfont, BOOL fRedraw)
	{ DateTime_SetMonthCalFont(m_hWnd, hfont, fRedraw); }

inline HFONT CeDateTime::GetMonthCalFont() const
	{ return (HFONT) DateTime_GetMonthCalFont(m_hWnd); }

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