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

📄 daotreeview.h

📁 Visual C++ 实践与提高--数据库篇的源代码。很好的东西。欢迎下载。
💻 H
字号:
// DAOTreeView.h : interface of the CDAOTreeView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_DAOTREEVIEW_H__7A2699E1_BEC6_11D4_A7B3_0010B54D545E__INCLUDED_)
#define AFX_DAOTREEVIEW_H__7A2699E1_BEC6_11D4_A7B3_0010B54D545E__INCLUDED_

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

#include "ctrlext.h"
class CDAOQryDoc;
class CDaoTreeView : public CTreeView
{
protected: // create from serialization only
	CDaoTreeView();
	DECLARE_DYNCREATE(CDaoTreeView)

// Attributes
public:
	CDAOQryDoc* GetDocument();
	CDaoDatabase* m_pDB;
	UINT m_nIDClipFormat;
	CTreeCursor m_ItemSel;
	BOOL m_bNoNotifications;

// Operations
public:
	//对象对应的位图ID
	enum ImageIDS{
		IID_DATABASE = 0,IID_DATABASES,
		IID_TABLE,IID_TABLES,
		IID_FIELD,IID_FIELDS,
		IID_INDEX,IID_INDEXES,
		IID_RELATION,IID_RELATIONS,
		IID_QUERYDEF,IID_QUERYDEFS
	};

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CDaoTreeView)
	public:
	virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
	virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
	virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
	//}}AFX_VIRTUAL

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

	void PopulateTree();
	void AddItem(WORD nItemType, LPCTSTR lpszName);
	void DeleteItem(CTreeCursor& itemDelete);

protected:

	CImageList  m_ctlImage;

	//定义树控件位置书签
	CTreeCursor tDatabases, tDatabase;
	CTreeCursor tTables, tTable;
	CTreeCursor tIndexes, tFields;
	CTreeCursor tRelations, tQueryDefs;

	//拖拽目标
	COleDropTarget m_dropTarget;

// Generated message map functions
protected:
	//{{AFX_MSG(CDaoTreeView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSysColorChange();
	afx_msg void OnNewQuery();
	afx_msg void OnQueryEdit();
	//}}AFX_MSG
	afx_msg void OnPopupCommand(UINT nMenuID);
	void OnNodeSelect(NMHDR *pNotifyStruct,LRESULT *result);
	void OnBeginDrag(NMHDR *pNotifyStruct,LRESULT *result);
	void OnKeyDown(NMHDR *pNotifyStruct,LRESULT *result);
	void OnRightClick(NMHDR *pNotifyStruct,LRESULT *result);
	void DoPopupMenu(UINT nMenuID);

	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DAOTreeView.cpp
inline CDAOQryDoc* CDAOTreeView::GetDocument()
   { return (CDAOQryDoc*)m_pDocument; }
#endif

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

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

#endif // !defined(AFX_DAOTREEVIEW_H__7A2699E1_BEC6_11D4_A7B3_0010B54D545E__INCLUDED_)

⌨️ 快捷键说明

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