⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tyopcclientview.h

📁 OPC Client 源代码
💻 H
字号:
// TYOPCClientView.h : interface of the CViewOPCItem class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_TYOPCCLIENTVIEW_H__9B731184_E480_4317_9E04_C368098B7C47__INCLUDED_)
#define AFX_TYOPCCLIENTVIEW_H__9B731184_E480_4317_9E04_C368098B7C47__INCLUDED_


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


class CViewOPCItem : public CListView
{
protected:
	CViewOPCItem();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CViewOPCItem)

// Attributes
public:

// Operations
public:
	static int CompareItems (const void *arg1, const void *arg2);

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

// Implementation
protected:
	virtual ~CViewOPCItem();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif
public:
	CTYOPCClientDoc* GetDocument();

	// Generated message map functions
protected:
	//{{AFX_MSG(CViewOPCItem)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnGetDispInfo(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnTimer(UINT nIDEvent);
	afx_msg void OnItemClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnOPCItemAsync20Write();
	afx_msg void OnRClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	BOOL OnPreparePrinting(CPrintInfo* pInfo);
	void OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/);
	void OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/);
	DECLARE_MESSAGE_MAP()

public:
	virtual int OnToolHitTest (CPoint cPoint, TOOLINFO *pTI) const;
	void Insert(COPCItem *pItem,BOOL bSelItem=TRUE);

protected:
	void GetSelOPCItem(CStringArray &strSelItems);
	int  GetCellRectFromPoint (CPoint &cPoint, CRect &rc, int *pCol) const;
	bool RequireCellToolTip (int nRow, int nCol, CRect rc) const;
	void SortItems();
	//
	CImageList	m_cImageList;

	WORD m_wUpdateInterval;

	//在qsort中回调的函数中使用
	static WORD sm_wSortColumn;			//列排序----第几列
	static WORD sm_wSortOrder;			//排序顺序:ASCENDING(升序)---DESCENDING(降序)
	static DWORD *sm_pSortedItems;		//COPCItem项地址数组 access from static  function
	int m_nSortedItems;					//已有数据量
	int m_nSortedListSize;				//sm_pSortedItems能容纳数据总数
	
	//CSafeLock----创建一个安全线程
	//Create a CSafeLock to make this object thread safe.
	CCriticalSection m_csSortedList;
};

#ifndef _DEBUG  // debug version in TYOPCClientView.cpp
inline CTYOPCClientDoc* CViewOPCItem::GetDocument()
   { return (CTYOPCClientDoc*)m_pDocument; }
#endif

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_TYOPCCLIENTVIEW_H__9B731184_E480_4317_9E04_C368098B7C47__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -