StringPickerDialog.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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_STRINGPICKERDIALOG_H__03729371_364E_42B5_8342_4B80F999DC8F__INCLUDED_)
  19. #define AFX_STRINGPICKERDIALOG_H__03729371_364E_42B5_8342_4B80F999DC8F__INCLUDED_
  20. #if _MSC_VER > 1000
  21. #pragma once
  22. #endif // _MSC_VER > 1000
  23. #include "resource.h"
  24. #include "vector.h"
  25. #include "stringscategoryviewdialog.h"
  26. /////////////////////////////////////////////////////////////////////////////
  27. // Forward declarations
  28. /////////////////////////////////////////////////////////////////////////////
  29. class TDBCategoryClass;
  30. class TDBObjClass;
  31. /////////////////////////////////////////////////////////////////////////////
  32. //
  33. // StringPickerDialogClass
  34. //
  35. /////////////////////////////////////////////////////////////////////////////
  36. class StringPickerDialogClass : public CDialog, public StringsCategoryViewCallbackClass
  37. {
  38. // Construction
  39. public:
  40. StringPickerDialogClass(CWnd* pParent = NULL); // standard constructor
  41. ~StringPickerDialogClass (void);
  42. // Dialog Data
  43. //{{AFX_DATA(StringPickerDialogClass)
  44. enum { IDD = IDD_STRING_LIBRARY_VIEW };
  45. CTabCtrl m_TabCtrl;
  46. //}}AFX_DATA
  47. // Overrides
  48. // ClassWizard generated virtual function overrides
  49. //{{AFX_VIRTUAL(StringPickerDialogClass)
  50. protected:
  51. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  52. //}}AFX_VIRTUAL
  53. // Implementation
  54. protected:
  55. // Generated message map functions
  56. //{{AFX_MSG(StringPickerDialogClass)
  57. afx_msg void OnSelchangeTabCtrl(NMHDR* pNMHDR, LRESULT* pResult);
  58. afx_msg void OnSize(UINT nType, int cx, int cy);
  59. virtual BOOL OnInitDialog();
  60. //}}AFX_MSG
  61. DECLARE_MESSAGE_MAP()
  62. public:
  63. ///////////////////////////////////////////////////////////////////
  64. // Public methods
  65. ///////////////////////////////////////////////////////////////////
  66. //
  67. // Creation
  68. //
  69. void Create (CWnd *parent_wnd);
  70. //
  71. // Selection access
  72. //
  73. void Set_Selection (int object_id) { SelectedObjectID = object_id; }
  74. int Get_Selection (void);
  75. //
  76. // From StringsCategoryViewCallbackClass
  77. //
  78. void On_Selection_Changed (int sel_object_id);
  79. protected:
  80. ///////////////////////////////////////////////////////////////////
  81. // Protected methods
  82. ///////////////////////////////////////////////////////////////////
  83. void Resize_Controls (void);
  84. void Update_Selected_String (void);
  85. private:
  86. ///////////////////////////////////////////////////////////////////
  87. // Private methods
  88. ///////////////////////////////////////////////////////////////////
  89. void Add_Category_Page (TDBCategoryClass *category);
  90. void Update_Page_Visibility (void);
  91. ///////////////////////////////////////////////////////////////////
  92. // Private member data
  93. ///////////////////////////////////////////////////////////////////
  94. bool IsInitialized;
  95. int CurrentTab;
  96. int SelectedObjectID;
  97. DynamicVectorClass<StringsCategoryViewDialogClass *> CategoryPages;
  98. };
  99. //{{AFX_INSERT_LOCATION}}
  100. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  101. #endif // !defined(AFX_STRINGPICKERDIALOG_H__03729371_364E_42B5_8342_4B80F999DC8F__INCLUDED_)