MySuperGrid.h
上传用户:meggie0806
上传日期:2007-01-02
资源大小:87k
文件大小:3k
源码类别:

ListView/ListBox

开发平台:

Visual C++

  1. #if !defined(AFX_MYSUPERGRID_H__09B964C4_953D_11D2_9B04_002018026B76__INCLUDED_)
  2. #define AFX_MYSUPERGRID_H__09B964C4_953D_11D2_9B04_002018026B76__INCLUDED_
  3. #if _MSC_VER > 1000
  4. #pragma once
  5. #endif // _MSC_VER > 1000
  6. // MySuperGrid.h : header file
  7. //
  8. #include "SuperGridCtrl.h"
  9. /////////////////////////////////////////////////////////////////////////////
  10. // CMySuperGrid window
  11. class CMySuperGrid : public CSuperGridCtrl
  12. {
  13. // Construction
  14. public:
  15. CMySuperGrid();
  16. // Attributes
  17. public:
  18. // Operations
  19. public:
  20. //HOWTO:
  21. void InitializeGrid(void);
  22. void HowToInsertItemsAfterTheGridHasBeenInitialized(int nIndex, const CString& str);
  23. void HowToLoopThroughAllItems_if_we_wanted_to_print_them_or_what_ever(CDC *pDC);
  24. void HowToLoopThroughAllItems_that_has_a_checkmark_and_print_them_or_what_ever(CDC *pDC);
  25. void HowToSearch_I_am_using_hardcoded_values_here_cause_I_am_tired_now(void);
  26. void SortData(void);
  27. void _DeleteAll(void);
  28. CImageList *CreateDragImageEx(int nItem);
  29. BOOL m_bDrag;
  30. //search item and subitems 
  31. //usage:
  32. // CTreeItem *pResult = Search("Item 1","subitem x","Subitem y","subitem 0", NULL); //must finish with NULL terminator thank you
  33. //  if(pResult!=NULL) .....bla. bla. bla.
  34. // returns the pointer to node that matches the search criteria or NULL if not found
  35. CTreeItem *Search(CString strItem, ...);
  36. CTreeItem* SearchEx(CTreeItem *pStartPosition, CString strItem);
  37. // Overrides
  38. void OnControlLButtonDown(UINT nFlags, CPoint point, LVHITTESTINFO& ht);
  39. void OnUpdateListViewItem(CTreeItem* lpItem, LV_ITEM *plvItem);
  40. CItemInfo* CopyData(CItemInfo* lpSrc);
  41. int GetIcon(const CTreeItem* pItem);
  42. COLORREF GetCellRGB(void);
  43. BOOL OnItemExpanding(CTreeItem *pItem, int iItem);
  44. BOOL OnItemExpanded(CTreeItem* pItem, int iItem);
  45. BOOL OnCollapsing(CTreeItem *pItem);
  46. BOOL OnItemCollapsed(CTreeItem *pItem);
  47. BOOL OnDeleteItem(CTreeItem* pItem, int nIndex);
  48. BOOL OnVkReturn(void);
  49. BOOL OnItemLButtonDown(LVHITTESTINFO& ht);
  50. // ClassWizard generated virtual function overrides
  51. //{{AFX_VIRTUAL(CMySuperGrid)
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. public:
  55. virtual ~CMySuperGrid();
  56. protected:
  57. CImageList m_image;//Must provide an imagelist
  58. //positions and creates/initalize a combobox control
  59. CComboBox* ShowList(int nItem, int nCol, CStringList *lstItems);
  60. //helper function called from ShowList...calcs the lists max horz extent
  61. int CalcHorzExtent(CWnd* pWnd, CStringList *pList);
  62. // Generated message map functions
  63. protected:
  64. //{{AFX_MSG(CMySuperGrid)
  65. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  66. //}}AFX_MSG
  67. DECLARE_MESSAGE_MAP()
  68. };
  69. /////////////////////////////////////////////////////////////////////////////
  70. //{{AFX_INSERT_LOCATION}}
  71. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  72. #endif // !defined(AFX_MYSUPERGRID_H__09B964C4_953D_11D2_9B04_002018026B76__INCLUDED_)