summaryrefslogtreecommitdiff
path: root/hammer/objectpage.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/objectpage.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'hammer/objectpage.h')
-rw-r--r--hammer/objectpage.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/hammer/objectpage.h b/hammer/objectpage.h
new file mode 100644
index 0000000..47498f0
--- /dev/null
+++ b/hammer/objectpage.h
@@ -0,0 +1,99 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef OBJECTPAGE_H
+#define OBJECTPAGE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "MapClass.h"
+
+
+class CObjectPage : public CPropertyPage
+{
+ DECLARE_DYNCREATE(CObjectPage)
+
+public:
+
+ CObjectPage(void)
+ {
+ m_bMultiEdit = false;
+ m_bFirstTimeActive = true;
+ m_bHasUpdatedData = false;
+ }
+
+ CObjectPage(UINT nResourceID) : CPropertyPage(nResourceID)
+ {
+ m_bMultiEdit = false;
+ m_bFirstTimeActive = false;
+ }
+
+ ~CObjectPage() {}
+
+ virtual void MarkDataDirty() {}
+
+ enum
+ {
+ LoadFirstData,
+ LoadData,
+ LoadFinished,
+ };
+
+ inline void SetObjectList(const CMapObjectList *pObjectList);
+
+ // Called by the sheet to update the selected objects. pData points to the object being added to the selection.
+ virtual void UpdateData( int Mode, PVOID pData, bool bCanEdit );
+
+ // Called by the sheet to store this page's data into the objects being edited.
+ virtual bool SaveData(void) { return(true); }
+
+ // Called by the sheet to let the dialog remember its state before a refresh of the data.
+ virtual void RememberState(void) {}
+
+ virtual void SetMultiEdit(bool b) { m_bMultiEdit = b; }
+ virtual void OnShowPropertySheet(BOOL bShow, UINT nStatus) {}
+
+ bool IsMultiEdit() { return m_bMultiEdit; }
+
+ CRuntimeClass * GetEditObjectRuntimeClass(void) { return m_pEditObjectRuntimeClass; }
+ PVOID GetEditObject();
+
+ BOOL OnSetActive(void);
+ BOOL OnApply(void) { return(TRUE); }
+
+ bool m_bFirstTimeActive; // Used to detect the first time this page becomes active.
+ bool m_bHasUpdatedData; // Used to prevent SaveData() called on pages that haven't had loaded the data yet.
+
+ // Set while we are changing the page layout.
+ static BOOL s_bRESTRUCTURING;
+
+protected:
+
+ const CMapObjectList *m_pObjectList; // The list of objects that we are editing.
+ bool m_bMultiEdit; // Set to true if we are editing more than one object.
+ bool m_bCanEdit; // Set to true if this page allows for editing
+
+ CRuntimeClass *m_pEditObjectRuntimeClass; // The type of object that this page can edit.
+
+ static char *VALUE_DIFFERENT_STRING;
+};
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Sets the list of objects that this dialog should reflect.
+// Input : pObjectList - List of objects (typically the selection list).
+//-----------------------------------------------------------------------------
+void CObjectPage::SetObjectList(const CMapObjectList *pObjectList)
+{
+ Assert(pObjectList != NULL);
+ m_pObjectList = pObjectList;
+}
+
+
+#endif // OBJECTPAGE_H