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.

76 lines
2.0 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #include "stdafx.h"
  8. #include "hammer.h"
  9. #include "ObjectPage.h"
  10. #include "GlobalFunctions.h"
  11. #include "ObjectProperties.h"
  12. //
  13. // Used to indicate multiselect of entities with different keyvalues.
  14. //
  15. char *CObjectPage::VALUE_DIFFERENT_STRING = "(different)";
  16. //
  17. // Set while we are changing the page layout.
  18. //
  19. BOOL CObjectPage::s_bRESTRUCTURING = FALSE;
  20. IMPLEMENT_DYNCREATE(CObjectPage, CPropertyPage)
  21. //-----------------------------------------------------------------------------
  22. // Purpose: stores whether or not this page can be updated
  23. // Input : Mode - unused
  24. // pData - unused
  25. // bCanEdit - the edit state
  26. //-----------------------------------------------------------------------------
  27. void CObjectPage::UpdateData( int Mode, PVOID pData, bool bCanEdit )
  28. {
  29. m_bCanEdit = bCanEdit;
  30. }
  31. //-----------------------------------------------------------------------------
  32. // Purpose: Called when we become the active page.
  33. //-----------------------------------------------------------------------------
  34. BOOL CObjectPage::OnSetActive(void)
  35. {
  36. //VPROF_BUDGET( "CObjectPage::OnSetActive", "Object Properties" );
  37. if (CObjectPage::s_bRESTRUCTURING || !GetActiveWorld())
  38. {
  39. return CPropertyPage::OnSetActive();
  40. }
  41. CObjectProperties *pParent = (CObjectProperties *)GetParent();
  42. pParent->UpdateAnchors( this );
  43. if (m_bFirstTimeActive)
  44. {
  45. m_bFirstTimeActive = false;
  46. pParent->LoadDataForPages(pParent->GetPageIndex(this));
  47. }
  48. return CPropertyPage::OnSetActive();
  49. }
  50. //-----------------------------------------------------------------------------
  51. // Purpose:
  52. //-----------------------------------------------------------------------------
  53. PVOID CObjectPage::GetEditObject()
  54. {
  55. //VPROF_BUDGET( "CObjectPage::GetEditObject", "Object Properties" );
  56. return ((CObjectProperties*) GetParent())->GetEditObject(GetEditObjectRuntimeClass());
  57. }