DataView.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #if !defined(AFX_DATAVIEW_H__A9B6C2E1_E61E_11D2_802E_0040056350C8__INCLUDED_)
  19. #define AFX_DATAVIEW_H__A9B6C2E1_E61E_11D2_802E_0040056350C8__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // DataView.h : header file
  24. //
  25. #include "AfxCView.H"
  26. class PhysClass;
  27. class ChunkSaveClass;
  28. class ChunkLoadClass;
  29. /////////////////////////////////////////////////////////////////////////////
  30. //
  31. // ItemInfoClass - stores info about all of the items in the CDataView
  32. //
  33. class ItemInfoClass
  34. {
  35. public:
  36. enum { MODEL = 0, INSTANCE };
  37. ItemInfoClass(const char * name,int type) : Instance(NULL) { Name = strdup(name); Type = type; }
  38. ~ItemInfoClass(void) { if (Name) free(Name); }
  39. char * Name;
  40. int Type;
  41. PhysClass * Instance;
  42. };
  43. /////////////////////////////////////////////////////////////////////////////
  44. //
  45. // CDataView view
  46. //
  47. class CDataView : public CTreeView
  48. {
  49. protected:
  50. CDataView(); // protected constructor used by dynamic creation
  51. DECLARE_DYNCREATE(CDataView)
  52. // Attributes
  53. public:
  54. // Operations
  55. public:
  56. void Rebuild_Tree(void);
  57. ItemInfoClass * Get_Selected_Item(void);
  58. void Save(ChunkSaveClass & csave);
  59. void Load(ChunkLoadClass & cload);
  60. // Overrides
  61. // ClassWizard generated virtual function overrides
  62. //{{AFX_VIRTUAL(CDataView)
  63. protected:
  64. virtual void OnDraw(CDC* pDC); // overridden to draw this view
  65. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  66. //}}AFX_VIRTUAL
  67. // Implementation
  68. protected:
  69. virtual ~CDataView();
  70. #ifdef _DEBUG
  71. virtual void AssertValid() const;
  72. virtual void Dump(CDumpContext& dc) const;
  73. #endif
  74. ///////////////////////////////////////////////////////
  75. //
  76. // Private member data
  77. //
  78. HTREEITEM ModelsRoot;
  79. HTREEITEM InstancesRoot;
  80. // Generated message map functions
  81. protected:
  82. //{{AFX_MSG(CDataView)
  83. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  84. afx_msg void OnDeleteitem(NMHDR* pNMHDR, LRESULT* pResult);
  85. afx_msg void OnSelchanged(NMHDR* pNMHDR, LRESULT* pResult);
  86. //}}AFX_MSG
  87. DECLARE_MESSAGE_MAP()
  88. };
  89. /////////////////////////////////////////////////////////////////////////////
  90. //{{AFX_INSERT_LOCATION}}
  91. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  92. #endif // !defined(AFX_DATAVIEW_H__A9B6C2E1_E61E_11D2_802E_0040056350C8__INCLUDED_)