InstancesPage.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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_INSTANCESPAGE_H__E37C6D92_B4C0_11D2_9FF8_00104B791122__INCLUDED_)
  19. #define AFX_INSTANCESPAGE_H__E37C6D92_B4C0_11D2_9FF8_00104B791122__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // InstancesPage.h : header file
  24. //
  25. #ifndef __AFXEXT_H__
  26. #include <afxext.h>
  27. #endif
  28. #include "nodetypes.h"
  29. #include "resource.h"
  30. #include "dialogtoolbar.h"
  31. #include "bittype.h"
  32. #include "vector.h"
  33. // Forward declarations
  34. class NodeClass;
  35. class DefinitionFactoryClass;
  36. //////////////////////////////////////////////////////////
  37. //
  38. // InstancesPageClass
  39. //
  40. //////////////////////////////////////////////////////////
  41. class InstancesPageClass : public CDialog
  42. {
  43. public:
  44. InstancesPageClass (CWnd *parent_wnd);
  45. virtual ~InstancesPageClass (void);
  46. // Form Data
  47. public:
  48. //{{AFX_DATA(InstancesPageClass)
  49. enum { IDD = IDD_INSTANCES_FORM };
  50. CListCtrl m_ListCtrl;
  51. //}}AFX_DATA
  52. // Attributes
  53. public:
  54. // Operations
  55. public:
  56. // Overrides
  57. // ClassWizard generated virtual function overrides
  58. //{{AFX_VIRTUAL(InstancesPageClass)
  59. protected:
  60. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  61. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  62. //}}AFX_VIRTUAL
  63. // Implementation
  64. protected:
  65. #ifdef _DEBUG
  66. virtual void AssertValid() const;
  67. virtual void Dump(CDumpContext& dc) const;
  68. #endif
  69. // Generated message map functions
  70. //{{AFX_MSG(InstancesPageClass)
  71. afx_msg void OnSize(UINT nType, int cx, int cy);
  72. afx_msg void OnDestroy();
  73. afx_msg void OnEdit();
  74. afx_msg void OnGoto();
  75. afx_msg void OnShowAll();
  76. afx_msg void OnSelect();
  77. afx_msg void OnDelete();
  78. virtual BOOL OnInitDialog();
  79. afx_msg void OnDeleteitemInstanceList(NMHDR* pNMHDR, LRESULT* pResult);
  80. afx_msg void OnDblclkInstanceList(NMHDR* pNMHDR, LRESULT* pResult);
  81. afx_msg void OnItemchangedInstanceList(NMHDR* pNMHDR, LRESULT* pResult);
  82. //}}AFX_MSG
  83. DECLARE_MESSAGE_MAP()
  84. public:
  85. ///////////////////////////////////////////////////////
  86. // Public methods
  87. ///////////////////////////////////////////////////////
  88. void Add_Node (NodeClass *node);
  89. void Remove_Node (NodeClass *node);
  90. void Reset_List (void);
  91. protected:
  92. ///////////////////////////////////////////////////////
  93. // Protected methods
  94. ///////////////////////////////////////////////////////
  95. void Set_Node_Check (int index, bool bcheck = true);
  96. void Insert_Factory (LPCTSTR name, int class_id);
  97. void Insert_Node (NodeClass *node);
  98. void Insert_Navigator (void);
  99. NodeClass * Get_Item_Node (int index);
  100. void Populate_List (uint32 class_id);
  101. void Populate_List (NodeClass *node);
  102. void Hide_Nodes (int index, bool hide);
  103. void Hide_Node (NodeClass *node, uint32 class_id, bool hide);
  104. void Update_Button_States (void);
  105. bool Does_Factory_Have_Children (uint32 factory_id);
  106. void Update_Overlays (void);
  107. private:
  108. ///////////////////////////////////////////////////////
  109. // Private member data
  110. ///////////////////////////////////////////////////////
  111. DialogToolbarClass m_Toolbar;
  112. uint32 m_ClassID;
  113. DynamicVectorClass<uint32> m_ClassIDStack;
  114. };
  115. /////////////////////////////////////////////////////////////////////////////
  116. //{{AFX_INSERT_LOCATION}}
  117. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  118. #endif // !defined(AFX_INSTANCESPAGE_H__E37C6D92_B4C0_11D2_9FF8_00104B791122__INCLUDED_)