diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /hammer/dynamicdialogwnd.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'hammer/dynamicdialogwnd.cpp')
| -rw-r--r-- | hammer/dynamicdialogwnd.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/hammer/dynamicdialogwnd.cpp b/hammer/dynamicdialogwnd.cpp new file mode 100644 index 0000000..7ddadb9 --- /dev/null +++ b/hammer/dynamicdialogwnd.cpp @@ -0,0 +1,72 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// DynamicDialogWnd.cpp : implementation file +// + +#include "stdafx.h" +#include "hammer.h" +#include "DynamicDialogWnd.h" + +// memdbgon must be the last include file in a .cpp file!!! +#include <tier0/memdbgon.h> + +///////////////////////////////////////////////////////////////////////////// +// CDynamicDialogWnd + +CDynamicDialogWnd::CDynamicDialogWnd(CWnd *pParent) +{ + m_pDialog = NULL; + Create(NULL, "DynamicDialogWnd", WS_BORDER | WS_CAPTION | WS_CHILD, + CRect(0, 0, 50, 50), pParent, 1); + SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); +} + +CDynamicDialogWnd::~CDynamicDialogWnd() +{ + SetDialogClass(0, NULL); +} + + +BEGIN_MESSAGE_MAP(CDynamicDialogWnd, CWnd) + //{{AFX_MSG_MAP(CDynamicDialogWnd) + // NOTE - the ClassWizard will add and remove mapping macros here. + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +///////////////////////////////////////////////////////////////////////////// +// CDynamicDialogWnd message handlers + +void CDynamicDialogWnd::SetDialogClass(UINT nID, CDialog *pDialog) +{ + delete m_pDialog; + + if(!pDialog) + return; + + m_pDialog = pDialog; + + CRect rWindow; + GetWindowRect(&rWindow); + + SetRedraw(FALSE); + +/* + m_pDialog->Create(nID, this); + + // resize this window + CRect rDialog; + m_pDialog->GetWindowRect(&rDialog); + MoveWindow(rWindow.left, rWindow.top, rDialog.Width(), rDialog.Height()); +*/ + MoveWindow(0, 0, 50, 50); + + SetRedraw(TRUE); + Invalidate(); + UpdateWindow(); +} |