Click here to Skip to main content
15,867,568 members
Articles / Desktop Programming / MFC

The Ultimate Toolbox - Updates and User Contributions

Rate me:
Please Sign up or sign in to vote.
4.79/5 (26 votes)
12 Feb 2013CPOL8 min read 253.8K   23.6K   170  
Updates and User Contributions for the Ultimate Toolbox Libraries
// OutlookGrid.h: interface for the COutlookGrid class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_CELLTYPEOUTLOOK_H__D784EA52_AE06_40B4_945D_895EBDAA1B6D__INCLUDED_)
#define AFX_CELLTYPEOUTLOOK_H__D784EA52_AE06_40B4_945D_895EBDAA1B6D__INCLUDED_

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

#include "ugctrl.h"

//cell types
#include "ugctexpand.h"
#include "UGCTMail.h"
#include "UGCTMailSort.h"
#include "UGCTOutlookHeader.h"

class COutlookGrid : public CUGCtrl  
{
public:
	COutlookGrid();
	virtual ~COutlookGrid();
	void SetFlag(int index);
	void SetDefaultFlag(int index);
	void ChangeReadFlag();
	
	void SetMailWindow(CRichEditCtrl* pWnd);

	void SetShowGroups(bool show);
	bool GetShowGroups();

	CUGCTMailSort::sortBy GetSortBy();
	void SetSortBy(CUGCTMailSort::sortBy sort);

	void CollapseAll();
	void ExpandAll();

	void MarkAllRead();
	void MarkAllUnread();

private:
	// CUGExpandType cell type
	CUGExpandType		m_expand;
	int					m_nExpandIndex;

	// CUGOutlookHeader cell type
	CUGCTOutlookHeader  m_header;
	int					m_nHeaderIndex;

	// CUGOutlookMail cell type
	CUGCTMail			m_mail;
	int					m_nMailIndex;

	// CUGMailSort cell type
	CUGCTMailSort		m_mailSort;
	int					m_nMailSortIndex;

	//fonts
	CFont				m_defFont;
	CFont				m_boldFont;
	CFont				m_medFont;
	CFont				m_medBoldFont;
	CFont				m_lrgFont;
	CFont				m_smFont;

	int					m_lastMenuRow;
	// This is used so when we navigate away from an item we just marked as unread,
	// it will stay that way
	bool				m_bMarkedAsUnread;
	CRichEditCtrl *		m_pMailWindow;

	bool				m_bShowGroups;

	// This method calls SortBy then handles the setting up of cell heights and removal/insertion of header cells
	void DoSort();
	// As we need to remove headers to do the sorting, these methods search the sorted rows and reinsert them.
	void InsertHeadersByFlag();
	void InsertHeadersByDate();
	void InsertHeadersByStringProperty();
	void InsertHeadersBySize();
	void InsertHeadersByAttachments();

	//***** Over-ridable Notify Functions *****
	virtual void OnSetup();
	virtual int OnCellTypeNotify(long ID,int col,long row,long msg,long param);
	virtual void OnCellChange(int oldcol,int newcol,long oldrow,long newrow);
	virtual int OnHint(int col,long row,int section,CString *string);
	virtual int OnSortEvaluate( CUGCell* pCell1, CUGCell* pCell2, int iFlags );

	//{{AFX_MSG(CCellTypeDemoGrid)
	afx_msg void OnSize(UINT nType, int cx, int cy);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

#endif // !defined(AFX_CELLTYPEOUTLOOK_H__D784EA52_AE06_40B4_945D_895EBDAA1B6D__INCLUDED_)

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
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions