/*
*******************************************************************************
* Copyright (c) 1996-97 Digi International Inc., All Rights Reserved          *
*                                                                             *
* This  software  contains  proprietary  and  confidential   information   of *
* Digi International  Inc.   By  accepting  transfer  of this copy, Recipient *
* agrees to retain this software in  confidence,  to  prevent  disclosure  to *
* others,  and  to make no  use of this software other than that for which it *
* was delivered.  This is an unpublished copyright work  Digi   International *
* Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is *
* strictly prohibited.                                                        *
*                                                                             *
* Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc. *
* Confidential  when   combined   with   the   aggregated  modules  for  this *
* product) OBJECT CODE ONLY SOURCE MATERIALS                                  *
*                                                                             *
* (C) COPYRIGHT Digi International Inc. 1996-97                               *
*                                                                             *
* All Rights Reserved                                                         *
*                                                                             *
* US   Government   Users   Restricted   Rights   -   Use,   duplication   or *
* disclosure  restricted by GSA ADP Schedule Contract with Digi International *
* Inc.                                                                        *
*                                                                             *
*******************************************************************************

// PacketTreeView.h : header file
//

Revision History:

   $History: PacketTreeView.h $
 * 
 * *****************  Version 11  *****************
 * User: Mikez        Date: 7/11/97    Time: 5:02p
 * Branched in $/Components/Windows/NT/Sync/Build/Diag
 * 
 * *****************  Version 10  *****************
 * User: Rodgerb      Date: 1/27/97    Time: 1:18p
 * Updated in $/Components/Windows/NT/Sync/rev2diag
 * 1) documentation
 * 2) added some new params to Physical layer stats
*/

/////////////////////////////////////////////////////////////////////////////
// CPacketTreeView view

class CPacketTreeView : public CTreeView
{
protected:
	CPacketTreeView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CPacketTreeView)

	CMap<CString, LPCTSTR, UINT, UINT> m_StateMap;
	HTREEITEM m_SelItem;
	
	BOOL InTreeChange;
	BOOL m_bActive;

	static BOOL SaveStateFunc(CTreeCtrl&, HTREEITEM, LPVOID);
	static BOOL RestoreStateFunc(CTreeCtrl&, HTREEITEM, LPVOID);

	typedef BOOL (*PItemFunc)(CTreeCtrl&, HTREEITEM, LPVOID);
	void TraverseTree(PItemFunc, LPVOID);

// Attributes
public:
	CDiagDoc* GetDocument();

// Operations
public:
	void SaveTreeState();
	void RestoreTreeState();

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPacketTreeView)
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CPacketTreeView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CPacketTreeView)
	afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DiagView.cpp
inline CDiagDoc* CPacketTreeView::GetDocument()
   { return (CDiagDoc*)m_pDocument; }
#endif

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