| 12345678910111213141516171819202122232425262728293031323334353637 |
- #include "../pch/pch.h"
- #include "CGameFrameWnd.h"
- #include "ControlEx.h"
- void CGameFrameWnd::Init()
- {
- m_pCloseBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("closebtn")));
- m_pMaxBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("maxbtn")));
- m_pRestoreBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("restorebtn")));
- m_pMinBtn = static_cast<CButtonUI*>(m_pm.FindControl(_T("minbtn")));
- }
- LRESULT CGameFrameWnd::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
- {
- LONG styleValue = ::GetWindowLong(*this, GWL_STYLE);
- styleValue &= ~WS_CAPTION;
- ::SetWindowLong(*this, GWL_STYLE, styleValue | WS_CLIPSIBLINGS | WS_CLIPCHILDREN);
- m_pm.Init(m_hWnd);
- CDialogBuilder builder;
- CDialogBuilderCallbackEx cb;
- CControlUI* pRoot = builder.Create(_T("main.xml"), (UINT)0, &cb, &m_pm);
- ASSERT(pRoot && "Failed to parse XML");
- m_pm.AttachDialog(pRoot);
- m_pm.AddNotifier(this);
- OrderListUI* orderlist = static_cast<OrderListUI*>(m_pm.FindControl(_T("orderlist")));
- orderlist->Refresh();
- Init();
- return 0;
- }
|