diff options
Diffstat (limited to 'utils/vmpi/window_anchor_mgr.h')
| -rw-r--r-- | utils/vmpi/window_anchor_mgr.h | 59 |
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 |