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.

69 lines
1.5 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ====
  2. //
  3. //=============================================================================
  4. #ifndef CORDONLIST_H
  5. #define CORDONLIST_H
  6. #ifdef _WIN32
  7. #pragma once
  8. #endif
  9. #include "treelist.h"
  10. #define CORDONLIST_MSG_TOGGLE_STATE "TreeList_ToggleState"
  11. #define CORDONLIST_MSG_LEFT_DRAG_DROP "TreeList_LeftDragDrop"
  12. #define CORDONLIST_MSG_RIGHT_DRAG_DROP "TreeList_RightDragDrop"
  13. #define CORDONLIST_MSG_SEL_CHANGE "TreeList_SelChange"
  14. class BoundBox;
  15. struct Cordon_t;
  16. struct CordonListItem_t
  17. {
  18. Cordon_t *m_pCordon;
  19. BoundBox *m_pBox;
  20. };
  21. class CCordonList : public CTreeList
  22. {
  23. public:
  24. CCordonList();
  25. virtual ~CCordonList();
  26. void AddCordon( CordonListItem_t *pCordon, CordonListItem_t *pParent );
  27. void UpdateCordon(CordonListItem_t *item);
  28. inline int GetCordonCount();
  29. inline CordonListItem_t *GetCordon(int nIndex);
  30. inline CordonListItem_t *GetSelectedCordon();
  31. void OnRenameItem(void *item, const char *pszText);
  32. };
  33. //-----------------------------------------------------------------------------
  34. // Helper functions for avoiding casts in client code.
  35. //-----------------------------------------------------------------------------
  36. int CCordonList::GetCordonCount()
  37. {
  38. return GetItemCount();
  39. }
  40. CordonListItem_t *CCordonList::GetCordon(int nIndex)
  41. {
  42. return (CordonListItem_t *)GetItem(nIndex);
  43. }
  44. CordonListItem_t *CCordonList::GetSelectedCordon()
  45. {
  46. return (CordonListItem_t *)CTreeList::GetSelectedItem();
  47. }
  48. #endif // CORDONLIST_H