SelectPresetDialog.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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_SELECTPRESETDIALOG_H__8AB9B616_40C4_11D4_A0A6_00104B791122__INCLUDED_)
  19. #define AFX_SELECTPRESETDIALOG_H__8AB9B616_40C4_11D4_A0A6_00104B791122__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. #include "ntree.h"
  25. ///////////////////////////////////////////////////////////////////////
  26. // Forward declarations
  27. ///////////////////////////////////////////////////////////////////////
  28. class PresetClass;
  29. /////////////////////////////////////////////////////////////////////////////
  30. //
  31. // SelectPresetDialogClass
  32. //
  33. /////////////////////////////////////////////////////////////////////////////
  34. class SelectPresetDialogClass : public CDialog
  35. {
  36. // Construction
  37. public:
  38. SelectPresetDialogClass(CWnd* pParent = NULL); // standard constructor
  39. // Dialog Data
  40. //{{AFX_DATA(SelectPresetDialogClass)
  41. enum { IDD = IDD_PRESET_SELECT };
  42. CTreeCtrl m_TreeCtrl;
  43. //}}AFX_DATA
  44. // Overrides
  45. // ClassWizard generated virtual function overrides
  46. //{{AFX_VIRTUAL(SelectPresetDialogClass)
  47. protected:
  48. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  49. //}}AFX_VIRTUAL
  50. // Implementation
  51. protected:
  52. // Generated message map functions
  53. //{{AFX_MSG(SelectPresetDialogClass)
  54. virtual BOOL OnInitDialog();
  55. virtual void OnOK();
  56. afx_msg void OnDestroy();
  57. afx_msg void OnSelchangedPresetTree(NMHDR* pNMHDR, LRESULT* pResult);
  58. afx_msg void OnInfo();
  59. //}}AFX_MSG
  60. DECLARE_MESSAGE_MAP()
  61. public:
  62. ///////////////////////////////////////////////////////////////
  63. // Public methods
  64. ///////////////////////////////////////////////////////////////
  65. void Set_Icon_Index (int index) { m_IconIndex = index; }
  66. void Set_Class_ID (int class_id) { m_ClassID = class_id; }
  67. PresetClass * Get_Selection (void) const { return m_Preset; }
  68. void Set_Preset (PresetClass *preset) { m_Preset = preset; }
  69. //
  70. // Selection control
  71. //
  72. void Allow_None_Selection (bool onoff) { m_AllowNoneSelection = onoff; }
  73. //
  74. // Dialog text control
  75. //
  76. void Set_Title (LPCTSTR title) { m_Title = title; }
  77. void Set_Message (LPCTSTR msg) { m_Message = msg; }
  78. private:
  79. ///////////////////////////////////////////////////////////////
  80. // Private methods
  81. ///////////////////////////////////////////////////////////////
  82. void Fill_Tree (NTreeLeafClass<PresetClass *> *leaf, HTREEITEM parent_item);
  83. void Generate_Tree (int class_id, HTREEITEM parent_item);
  84. void Build_Full_Preset_Tree (void);
  85. ///////////////////////////////////////////////////////////////
  86. // Private member data
  87. ///////////////////////////////////////////////////////////////
  88. bool m_AllowNoneSelection;
  89. int m_IconIndex;
  90. int m_ClassID;
  91. PresetClass * m_Preset;
  92. HTREEITEM m_InitialSelection;
  93. CString m_Title;
  94. CString m_Message;
  95. };
  96. //{{AFX_INSERT_LOCATION}}
  97. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  98. #endif // !defined(AFX_SELECTPRESETDIALOG_H__8AB9B616_40C4_11D4_A0A6_00104B791122__INCLUDED_)