Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

134 lines
3.0 KiB

  1. //===================== Copyright (c) Valve Corporation. All Rights Reserved. ======================
  2. //
  3. // A modeless dialog showing a list of all entities in the map that can be filtered by various criteria.
  4. //
  5. //==================================================================================================
  6. #ifndef ENTITYREPORTDLG_H
  7. #define ENTITYREPORTDLG_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <afxtempl.h>
  12. #include "resource.h"
  13. #include "MapDoc.h"
  14. //
  15. // Used to invoke the entity report dialog with a specific filter configuration.
  16. //
  17. struct EntityReportFilterParms_t
  18. {
  19. EntityReportFilterParms_t()
  20. {
  21. m_bFilterByKeyvalue = false;
  22. m_bFilterByClass = false;
  23. m_bFilterByHidden = false;
  24. m_bExact = false;
  25. m_nFilterByType = 0;
  26. }
  27. void FilterByKeyValue( const char *key, const char *value )
  28. {
  29. m_bFilterByKeyvalue = true;
  30. m_filterKey.Set( key );
  31. m_filterValue.Set( value );
  32. }
  33. bool m_bFilterByKeyvalue;
  34. bool m_bFilterByClass;
  35. bool m_bFilterByHidden;
  36. bool m_bExact;
  37. int m_nFilterByType;
  38. CUtlString m_filterKey;
  39. CUtlString m_filterValue;
  40. CUtlString m_filterClass;
  41. };
  42. class CEntityReportDlg : public CDialog
  43. {
  44. public:
  45. static void ShowEntityReport(CMapDoc *pDoc, CWnd *pParent = NULL, EntityReportFilterParms_t *pParms = NULL );
  46. private:
  47. CEntityReportDlg(CMapDoc *pDoc, CWnd* pParent = NULL); // standard constructor
  48. void GenerateReport();
  49. void SaveToIni();
  50. //{{AFX_DATA(CEntityReportDlg)
  51. enum { IDD = IDD_ENTITYREPORT };
  52. CButton m_cExact;
  53. CComboBox m_cFilterClass;
  54. CButton m_cFilterByClass;
  55. CListBox m_cEntities;
  56. CEdit m_cFilterValue;
  57. CEdit m_cFilterKey;
  58. CButton m_cFilterByType;
  59. CButton m_cFilterByKeyvalue;
  60. CButton m_cFilterByHidden;
  61. //}}AFX_DATA
  62. // ClassWizard generated virtual function overrides
  63. //{{AFX_VIRTUAL(CEntityReportDlg)
  64. protected:
  65. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  66. virtual void OnOK();
  67. //}}AFX_VIRTUAL
  68. protected:
  69. CMapDoc *m_pDoc;
  70. void UpdateEntityList();
  71. BOOL m_bFilterByKeyvalue;
  72. BOOL m_bFilterByClass;
  73. BOOL m_bFilterByHidden;
  74. BOOL m_bExact;
  75. int m_iFilterByType;
  76. CString m_szFilterKey;
  77. CString m_szFilterValue;
  78. CString m_szFilterClass;
  79. bool m_bFilterTextChanged : 1;
  80. bool m_bGotoFirstMatch: 1;
  81. DWORD m_dwFilterTime;
  82. // Generated message map functions
  83. //{{AFX_MSG(CEntityReportDlg)
  84. afx_msg void OnDelete();
  85. afx_msg void OnFilterbyhidden();
  86. afx_msg void OnFilterbykeyvalue();
  87. afx_msg void OnFilterbytype();
  88. afx_msg void OnChangeFilterkey();
  89. afx_msg void OnChangeFiltervalue();
  90. afx_msg void OnGoto();
  91. afx_msg void OnProperties();
  92. afx_msg void OnTimer(UINT nIDEvent);
  93. afx_msg void OnEditchangeFilterclass();
  94. afx_msg void OnFilterbyclass();
  95. afx_msg void OnSelchangeFilterclass();
  96. afx_msg void OnExactvalue();
  97. afx_msg void OnDestroy();
  98. afx_msg void OnClose();
  99. afx_msg void OnSelChangeEntityList();
  100. afx_msg void OnDblClkEntityList();
  101. //}}AFX_MSG
  102. DECLARE_MESSAGE_MAP()
  103. private:
  104. CMapDoc *MarkSelectedEntities( void );
  105. friend BOOL AddEntityToList(CMapEntity *pEntity, CEntityReportDlg *pDlg);
  106. };
  107. #endif // ENTITYREPORTDLG_H