CGameFrameWnd.cpp 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. #include "../pch/pch.h"
  2. #include "CGameFrameWnd.h"
  3. #include "ControlEx.h"
  4. void CGameFrameWnd::Init()
  5. {
  6. m_pCloseBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("closebtn")));
  7. m_pMaxBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("maxbtn")));
  8. m_pRestoreBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("restorebtn")));
  9. m_pMinBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("minbtn")));
  10. }
  11. LRESULT CGameFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
  12. {
  13. LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
  14. styleValue &= ~WS_CAPTION;
  15. ::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
  16. m_pm.Init(m_hWnd);
  17. CDialogBuilder builder;
  18. CDialogBuilderCallbackEx cb;
  19. CControlUI* pRoot = builder.Create(_T("main.xml"), (UINT)0, &cb, &m_pm);
  20. ASSERT(pRoot && "Failed to parse XML");
  21. m_pm.AttachDialog(pRoot);
  22. m_pm.AddNotifier(this);
  23. OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
  24. orderlist->Refresh();
  25. Init();
  26. return 0;
  27. }