
#include "stdafx.h"

#include "RegDumpView.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#define new DEBUG_NEW
#endif

/////////////////////////////////////////////////////////////////////////////
// CRegDumpView
IMPLEMENT_DYNAMIC(CRegDumpView, CDockablePane)

CRegDumpView::CRegDumpView()
{
}

CRegDumpView::~CRegDumpView()
{
}

BEGIN_MESSAGE_MAP(CRegDumpView, CDockablePane)
	ON_WM_CREATE()
	ON_WM_SIZE()
	ON_WM_SETFOCUS()
	ON_WM_PAINT()
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// обработчики сообщений CWorkspaceBar

int CRegDumpView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDockablePane::OnCreate(lpCreateStruct) == -1)
	{
		return -1;
	}

	if (!m_wndDlgex.Create(IDD_REGDUMP_DLG, this))
	{
		TRACE0("Не удалось создать диалог Дамп регистров\n");
		return -1;      // не удалось создать
	}

	AdjustLayout();
	return 0;
}

void CRegDumpView::OnSize(UINT nType, int cx, int cy)
{
	CDockablePane::OnSize(nType, cx, cy);
	AdjustLayout();
}

void CRegDumpView::OnSetFocus(CWnd *pOldWnd)
{
	CDockablePane::OnSetFocus(pOldWnd);
	m_wndDlgex.SetFocus();
}

void CRegDumpView::AdjustLayout()
{
	if (GetSafeHwnd() == NULL)
	{
		return;
	}

	CRect rectClient;
	GetClientRect(rectClient);
	m_wndDlgex.SetWindowPos(NULL, rectClient.left, rectClient.top, rectClient.Width(), rectClient.Height(), SWP_NOACTIVATE | SWP_NOZORDER);
}

void CRegDumpView::OnPaint()
{
	CPaintDC dc(this); // device context for painting
	// TODO: добавьте свой код обработчика сообщений
	// Не вызывать CDockablePane::OnPaint() для сообщений рисования
	m_wndDlgex.RedrawWindow();
}
