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.

72 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. // DynamicDialogWnd.cpp : implementation file
  9. //
  10. #include "stdafx.h"
  11. #include "hammer.h"
  12. #include "DynamicDialogWnd.h"
  13. // memdbgon must be the last include file in a .cpp file!!!
  14. #include <tier0/memdbgon.h>
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CDynamicDialogWnd
  17. CDynamicDialogWnd::CDynamicDialogWnd(CWnd *pParent)
  18. {
  19. m_pDialog = NULL;
  20. Create(NULL, "DynamicDialogWnd", WS_BORDER | WS_CAPTION | WS_CHILD,
  21. CRect(0, 0, 50, 50), pParent, 1);
  22. SetWindowPos(&wndTopMost, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
  23. }
  24. CDynamicDialogWnd::~CDynamicDialogWnd()
  25. {
  26. SetDialogClass(0, NULL);
  27. }
  28. BEGIN_MESSAGE_MAP(CDynamicDialogWnd, CWnd)
  29. //{{AFX_MSG_MAP(CDynamicDialogWnd)
  30. // NOTE - the ClassWizard will add and remove mapping macros here.
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // CDynamicDialogWnd message handlers
  35. void CDynamicDialogWnd::SetDialogClass(UINT nID, CDialog *pDialog)
  36. {
  37. delete m_pDialog;
  38. if(!pDialog)
  39. return;
  40. m_pDialog = pDialog;
  41. CRect rWindow;
  42. GetWindowRect(&rWindow);
  43. SetRedraw(FALSE);
  44. /*
  45. m_pDialog->Create(nID, this);
  46. // resize this window
  47. CRect rDialog;
  48. m_pDialog->GetWindowRect(&rDialog);
  49. MoveWindow(rWindow.left, rWindow.top, rDialog.Width(), rDialog.Height());
  50. */
  51. MoveWindow(0, 0, 50, 50);
  52. SetRedraw(TRUE);
  53. Invalidate();
  54. UpdateWindow();
  55. }