home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / msdn_vcb / samples / vc98 / mfc / database / daoview / treeview.h < prev   
Encoding:
C/C++ Source or Header  |  1998-03-27  |  2.7 KB  |  95 lines

  1. // TreeView.h : interface of the CDaoTreeView class
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992-1998 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and related
  9. // electronic documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. class CDaoTreeView : public CTreeView
  14. {
  15. protected: // create from serialization only
  16.     CDaoTreeView();
  17.     DECLARE_DYNCREATE(CDaoTreeView)
  18.  
  19. // Attributes
  20. public:
  21.     CDaoViewDoc* GetDocument();
  22.     CDaoDatabase* m_pDB;
  23.     UINT m_nIDClipFormat;
  24.     CTreeCursor m_ItemSel;
  25.     BOOL m_bNoNotifications;
  26.  
  27. // Operations
  28. public:
  29.     enum ImageIDS{
  30.         IID_DATABASE = 0,IID_DATABASES,
  31.         IID_TABLE,IID_TABLES,
  32.         IID_FIELD,IID_FIELDS,
  33.         IID_INDEX,IID_INDEXES,
  34.         IID_RELATION,IID_RELATIONS,
  35.         IID_QUERYDEF,IID_QUERYDEFS
  36.     };
  37.  
  38. // Overrides
  39.     // ClassWizard generated virtual function overrides
  40.     //{{AFX_VIRTUAL(CDaoTreeView)
  41.     public:
  42.     virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
  43.     virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
  44.     virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
  45.     //}}AFX_VIRTUAL
  46.  
  47. // Implementation
  48. public:
  49.     virtual ~CDaoTreeView();
  50. #ifdef _DEBUG
  51.     virtual void AssertValid() const;
  52.     virtual void Dump(CDumpContext& dc) const;
  53. #endif
  54.  
  55.     void PopulateTree();
  56.     void AddItem(WORD nItemType, LPCTSTR lpszName);
  57.     void DeleteItem(CTreeCursor& itemDelete);
  58.  
  59. protected:
  60.  
  61.     CImageList  m_ctlImage;
  62.  
  63.     // Some bookmarks to places in the tree
  64.     CTreeCursor tDatabases, tDatabase;
  65.     CTreeCursor tTables, tTable;
  66.     CTreeCursor tIndexes, tFields;
  67.     CTreeCursor tRelations, tQueryDefs;
  68.  
  69.     COleDropTarget m_dropTarget;
  70.  
  71. // Generated message map functions
  72. protected:
  73.     //{{AFX_MSG(CDaoTreeView)
  74.     afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  75.     afx_msg void OnSysColorChange();
  76.     afx_msg void OnNewQuery();
  77.     afx_msg void OnQueryEdit();
  78.     //}}AFX_MSG
  79.     afx_msg void OnPopupCommand(UINT nMenuID);
  80.     void OnNodeSelect(NMHDR *pNotifyStruct,LRESULT *result);
  81.     void OnBeginDrag(NMHDR *pNotifyStruct,LRESULT *result);
  82.     void OnKeyDown(NMHDR *pNotifyStruct,LRESULT *result);
  83.     void OnRightClick(NMHDR *pNotifyStruct,LRESULT *result);
  84.     void DoPopupMenu(UINT nMenuID);
  85.  
  86.     DECLARE_MESSAGE_MAP()
  87. };
  88. /*
  89. #ifndef _DEBUG  // debug version in TreeView.cpp
  90. inline CDaoViewDoc* CDaoTreeView::GetDocument()
  91.    { return (CDaoViewDoc*)m_pDocument; }
  92. #endif
  93. */
  94. /////////////////////////////////////////////////////////////////////////////
  95.