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.

99 lines
2.6 KiB

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