summaryrefslogtreecommitdiff
path: root/utils/vmpi/window_anchor_mgr.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 /utils/vmpi/window_anchor_mgr.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'utils/vmpi/window_anchor_mgr.h')
-rw-r--r--utils/vmpi/window_anchor_mgr.h59
1 files changed, 59 insertions, 0 deletions
diff --git a/utils/vmpi/window_anchor_mgr.h b/utils/vmpi/window_anchor_mgr.h
new file mode 100644
index 0000000..5d5014c
--- /dev/null
+++ b/utils/vmpi/window_anchor_mgr.h
@@ -0,0 +1,59 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef WINDOW_ANCHOR_MGR_H
+#define WINDOW_ANCHOR_MGR_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "utllinkedlist.h"
+
+
+enum
+{
+ ANCHOR_LEFT = 1,
+ ANCHOR_RIGHT,
+ ANCHOR_TOP,
+ ANCHOR_BOTTOM,
+ ANCHOR_WIDTH_PERCENT,
+ ANCHOR_HEIGHT_PERCENT
+};
+
+
+class CWindowAnchor
+{
+public:
+
+ bool Init( CWnd *pParentWnd, CWnd *pChildWnd, int aLeft, int aTop, int aRight, int aBottom );
+ void Update( CWnd *pParentWnd );
+
+
+private:
+ CWnd *m_pWnd;
+ CRect m_Rect; // The rectangle in client coordinates of the parent.
+ CRect m_ParentRect;
+
+ int m_aLeft, m_aTop, m_aRight, m_aBottom;
+};
+
+
+class CWindowAnchorMgr
+{
+public:
+
+ bool AddAnchor( CWnd *pParentWnd, CWnd *pChildWnd, int aLeft, int aTop, int aRight, int aBottom );
+ void UpdateAnchors( CWnd *pParentWnd );
+
+
+private:
+ CUtlLinkedList<CWindowAnchor,int> m_Anchors;
+};
+
+
+#endif // WINDOW_ANCHOR_MGR_H