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.

99 lines
2.7 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef OBJECTPAGE_H
  8. #define OBJECTPAGE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "MapClass.h"
  13. enum SaveData_Reason_t;
  14. class CObjectPage : public CPropertyPage
  15. {
  16. DECLARE_DYNCREATE(CObjectPage)
  17. public:
  18. CObjectPage(void)
  19. {
  20. m_bMultiEdit = false;
  21. m_bFirstTimeActive = true;
  22. m_bHasUpdatedData = false;
  23. }
  24. CObjectPage(UINT nResourceID) : CPropertyPage(nResourceID)
  25. {
  26. m_bMultiEdit = false;
  27. m_bFirstTimeActive = false;
  28. }
  29. ~CObjectPage() {}
  30. virtual void MarkDataDirty() {}
  31. enum
  32. {
  33. LoadFirstData,
  34. LoadData,
  35. LoadFinished,
  36. };
  37. inline void SetObjectList(const CMapObjectList *pObjectList);
  38. // Called by the sheet to update the selected objects. pData points to the object being added to the selection.
  39. virtual void UpdateData( int Mode, PVOID pData, bool bCanEdit );
  40. // Called by the sheet to store this page's data into the objects being edited.
  41. virtual bool SaveData( SaveData_Reason_t reason ) { return(true); }
  42. // Called by the sheet to let the dialog remember its state before a refresh of the data.
  43. virtual void RememberState(void) {}
  44. virtual void SetMultiEdit(bool b) { m_bMultiEdit = b; }
  45. virtual void OnShowPropertySheet(BOOL bShow, UINT nStatus) {}
  46. bool IsMultiEdit() { return m_bMultiEdit; }
  47. CRuntimeClass * GetEditObjectRuntimeClass(void) { return m_pEditObjectRuntimeClass; }
  48. PVOID GetEditObject();
  49. BOOL OnSetActive(void);
  50. BOOL OnApply(void) { return(TRUE); }
  51. bool m_bFirstTimeActive; // Used to detect the first time this page becomes active.
  52. bool m_bHasUpdatedData; // Used to prevent SaveData() called on pages that haven't had loaded the data yet.
  53. // Set while we are changing the page layout.
  54. static BOOL s_bRESTRUCTURING;
  55. protected:
  56. const CMapObjectList *m_pObjectList; // The list of objects that we are editing.
  57. bool m_bMultiEdit; // Set to true if we are editing more than one object.
  58. bool m_bCanEdit; // Set to true if this page allows for editing
  59. CRuntimeClass *m_pEditObjectRuntimeClass; // The type of object that this page can edit.
  60. static char *VALUE_DIFFERENT_STRING;
  61. };
  62. //-----------------------------------------------------------------------------
  63. // Purpose: Sets the list of objects that this dialog should reflect.
  64. // Input : pObjectList - List of objects (typically the selection list).
  65. //-----------------------------------------------------------------------------
  66. void CObjectPage::SetObjectList(const CMapObjectList *pObjectList)
  67. {
  68. Assert(pObjectList != NULL);
  69. m_pObjectList = pObjectList;
  70. }
  71. #endif // OBJECTPAGE_H