SpecSheet.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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_SPECSHEET_H__9CC8BAEB_7052_11D3_A05A_00104B791122__INCLUDED_)
  19. #define AFX_SPECSHEET_H__9CC8BAEB_7052_11D3_A05A_00104B791122__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. // SpecSheet.h : header file
  24. //
  25. #include "vector.h"
  26. // Forward declarations
  27. class DefinitionClass;
  28. class ParameterCtrlClass;
  29. class ParameterClass;
  30. /////////////////////////////////////////////////////////////////////////////
  31. //
  32. // SpecSheetClass
  33. //
  34. /////////////////////////////////////////////////////////////////////////////
  35. class SpecSheetClass : public CWnd
  36. {
  37. // Construction
  38. public:
  39. SpecSheetClass (DefinitionClass *definition);
  40. // Attributes
  41. public:
  42. // Operations
  43. public:
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(SpecSheetClass)
  47. protected:
  48. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  49. virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
  50. virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
  51. //}}AFX_VIRTUAL
  52. // Implementation
  53. public:
  54. virtual ~SpecSheetClass();
  55. // Generated message map functions
  56. protected:
  57. //{{AFX_MSG(SpecSheetClass)
  58. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  59. afx_msg UINT OnNcHitTest(CPoint point);
  60. afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
  61. afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
  62. afx_msg void OnNcMouseMove(UINT nHitTest, CPoint point);
  63. afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point);
  64. afx_msg void OnNcLButtonUp(UINT nHitTest, CPoint point);
  65. afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
  66. afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
  67. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  68. afx_msg void OnSize(UINT nType, int cx, int cy);
  69. afx_msg void OnDestroy();
  70. //}}AFX_MSG
  71. DECLARE_MESSAGE_MAP()
  72. public:
  73. ///////////////////////////////////////////////////////////////////
  74. // Public methods
  75. ///////////////////////////////////////////////////////////////////
  76. void Apply (void);
  77. DefinitionClass * Get_Definition (void) const { return m_Definition; }
  78. int Get_Parameter_Count (void) const { return m_CtrlList.Count (); }
  79. ParameterClass * Get_Parameter (int index);
  80. void Get_Current_Filename_Value (int index, CString &value);
  81. // Accessors
  82. bool Is_Temp (void) const { return m_IsTemp; }
  83. void Set_Is_Temp (bool is_temp) { m_IsTemp = is_temp; }
  84. bool Is_Read_Only (void) const { return m_IsReadOnly; }
  85. void Set_Read_Only (bool onoff) { m_IsReadOnly = onoff; }
  86. void Show_File_Only (bool onoff) { m_ShowFileOnly = onoff; }
  87. bool Were_Files_Changed (void) const { return m_WereFilesChanged; }
  88. void Set_Asset_Tree_Only (bool onoff) { m_AssetTreeOnly = onoff; }
  89. protected:
  90. ///////////////////////////////////////////////////////////////////
  91. // Protected methods
  92. ///////////////////////////////////////////////////////////////////
  93. bool Is_Filtered (ParameterClass *parameter);
  94. void Add_Parameter (ParameterClass *parameter);
  95. void Scroll_Controls (int amount);
  96. void Set_Scroll_Pos (int new_pos);
  97. private:
  98. ///////////////////////////////////////////////////////////////////
  99. // Private member data
  100. ///////////////////////////////////////////////////////////////////
  101. bool m_IsReadOnly;
  102. bool m_IsTemp;
  103. bool m_ShowFileOnly;
  104. bool m_WereFilesChanged;
  105. bool m_IsScrolling;
  106. bool m_AssetTreeOnly;
  107. CPoint m_LastPoint;
  108. int m_ScrollPos;
  109. int m_MaxScrollPos;
  110. DefinitionClass * m_Definition;
  111. DynamicVectorClass<ParameterCtrlClass *> m_CtrlList;
  112. };
  113. /////////////////////////////////////////////////////////////////////////////
  114. //{{AFX_INSERT_LOCATION}}
  115. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  116. #endif // !defined(AFX_SPECSHEET_H__9CC8BAEB_7052_11D3_A05A_00104B791122__INCLUDED_)