Team Fortress 2 Source Code as on 22/4/2020
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.

104 lines
2.7 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef OP_INPUT_H
  8. #define OP_INPUT_H
  9. #pragma once
  10. #include "ObjectPage.h"
  11. #include "Resource.h"
  12. #include "MapEntity.h"
  13. #include "AnchorMgr.h"
  14. #define OUTPUT_LIST_NUM_COLUMNS 6
  15. enum SortDirection_t;
  16. // A list of connections and entites that send them
  17. class CInputConnection
  18. {
  19. public:
  20. CMapEntity* m_pEntity;
  21. CEntityConnection* m_pConnection;
  22. bool m_bIsValid;
  23. };
  24. // #############################################################################
  25. class COP_Input : public CObjectPage
  26. {
  27. public:
  28. static CImageList *m_pImageList;
  29. public:
  30. DECLARE_DYNCREATE(COP_Input)
  31. // Construction
  32. COP_Input(void);
  33. ~COP_Input(void);
  34. void UpdateData( int Mode, PVOID pData, bool bCanEdit );
  35. void SetSelectedConnection(CEntityConnection *pConnection);
  36. protected:
  37. void AddEntityConnections(const char *pTargetName, CMapEntity *pTestEntity);
  38. void UpdateConnectionList(void);
  39. void UpdateEntityList(void);
  40. void RemoveAllEntityConnections(void);
  41. void SortListByColumn(int nColumn, SortDirection_t eDirection);
  42. void SetSortColumn(int nColumn, SortDirection_t eDirection);
  43. void UpdateColumnHeaderText(int nColumn, bool bIsSortColumn, SortDirection_t eDirection);
  44. // Connection validity
  45. void UpdateItemValidity(int nItem);
  46. bool ValidateConnections(int nItem);
  47. protected:
  48. CAnchorMgr m_AnchorMgr;
  49. CMapEntityList *m_pEntityList; // Object list filtered for entities
  50. CEditGameClass *m_pEditGameClass;
  51. CMapEntity *m_pEntity;
  52. CMapEntityList *m_pTargetEntityList; // List of entites that target me
  53. CEntityConnectionList *m_pConnectionList; // List of all the connections that target me
  54. bool m_bMultipleTargetNames; // Entities with multiple target names selected
  55. //
  56. // Cached data for sorting the list view.
  57. //
  58. int m_nSortColumn; // Current column used for sorting.
  59. SortDirection_t m_eSortDirection[OUTPUT_LIST_NUM_COLUMNS]; // Last sort direction per column.
  60. //{{AFX_DATA(COP_Input)
  61. enum { IDD = IDD_OBJPAGE_INPUT };
  62. CListCtrl m_ListCtrl;
  63. //}}AFX_DATA
  64. // ClassWizard generate virtual function overrides
  65. //{{AFX_VIRTUAL(COP_Input)
  66. virtual void DoDataExchange(CDataExchange* pDX);
  67. virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT *pResult);
  68. //}}AFX_VIRTUAL
  69. // Generated message map functions
  70. //{{AFX_MSG(COP_Input)
  71. afx_msg void OnMark(void);
  72. afx_msg void OnSize( UINT nType, int cx, int cy );
  73. virtual BOOL OnInitDialog(void);
  74. virtual void OnDestroy(void);
  75. //}}AFX_MSG
  76. DECLARE_MESSAGE_MAP()
  77. };
  78. #endif // OP_INPUT_H