Click here to Skip to main content
15,885,757 members
Articles / Desktop Programming / MFC

MS Outlook style Calendar

Rate me:
Please Sign up or sign in to vote.
4.92/5 (49 votes)
6 Aug 200511 min read 292.7K   9.4K   167  
A custom CWnd derived control which simulates the functionality of MS Outlook Calendar control.
// CWVCellDataItem : header file
/////////////////////////////////////////////////////////////////////////////

#ifndef __WVCELLDATAITEM_H
#define __WVCELLDATAITEM_H

/////////////////////////////////////////////////////////////////////////////
// CWVCellDataItem class

class CWVCellDataItem : public CObject
{
// Construction / destruction
public:

	// Constructs a CWVCellDataItem object.
	CWVCellDataItem();

	// Destroys a CWVCellDataItem object, handles cleanup and de-allocation.
	virtual ~CWVCellDataItem();

// Member variables
protected:

// Member functions
public:
	void SetItemImage(int nImg);
	void SetImageList(CImageList *pIList);
	DWORD GetItemData();
	void SetItemData(DWORD dwD);
	void SetBkColor(COLORREF clrBk);
	void SetMilitaryTime(BOOL bSet);
	void DrawItem(CPaintDC *pDC, CRect *pCellArea, BOOL bMView = FALSE);
	void SetHightlight(BOOL bSet);
	void SetRectArea(CRect *pRect);
	void GetRectArea(CRect *pRect);
	void SetItemFont(int nSize, CString strFName);
	COLORREF GetItemColor();
	void SetItemColor(COLORREF clrColor);
	void SetAlarmTime(COleDateTime dtDate);
	void GetAlarmTime(COleDateTime *dtDate);
	BOOL IsAlarmSet();
	void SetItemAlarm(BOOL bSet, COleDateTime dtDate);
	CString GetItemText();
	void SetItemText(CString strLine);
	void GetEndTime(COleDateTime *dtDate);
	void SetEndTime (COleDateTime dtDate);
	void GetStartTime(COleDateTime *dtDate);
	void SetStartTime(COleDateTime dtDate);
	long GetItemID();
	void SetItemID(long nID);

private:
	int nImage;
	CImageList *pImgList;
	DWORD dwData;
	COLORREF clrBackGrnd;
	BOOL bMilTime;
	long nItemID;
	COleDateTime dtStart, dtEnd;
	CString strItem;
	COLORREF clrItem;
	BOOL bAlarm, bHighlight;
	COleDateTime dtAlarm;
	CRect rArea;
	int nFontSize;
	CString strFontName;
};

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

#endif // __WVCELLDATAITEM_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 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
Founder Virtual Cyber Studios, LLC
United States United States
I have been programming Windows applications since 1990 (v 3.0). Remember Borland's Turbo C/C++ and Microsoft C/C++ 6? Both were in Text mode... WTF | :WTF:

Comments and Discussions