// DlgFull.cpp : implementation file
//

#include "stdafx.h"
#include "NetPlayX.h"
#include "DlgFull.h"
#include "lauplaym4.h"
#include "NetPlayXCtl.h"

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

/////////////////////////////////////////////////////////////////////////////
// CDlgFull dialog


CDlgFull::CDlgFull(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgFull::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgFull)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_parent = NULL;
}


void CDlgFull::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgFull)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgFull, CDialog)
	//{{AFX_MSG_MAP(CDlgFull)
	ON_WM_RBUTTONUP()
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgFull message handlers

BOOL CDlgFull::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	MoveWindow(
		0,
		0,
		GetSystemMetrics(SM_CXSCREEN),
		GetSystemMetrics(SM_CYSCREEN),
		TRUE);	

	if(m_parent->s_hPlayHandle != NULL)
	{
		LCPLAYM4_PlaySetWnd(m_parent->s_hPlayHandle,m_hWnd);
		LCPLAYM4_RefreshDisplay(m_parent->s_hPlayHandle);
	}
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgFull::OnRButtonUp(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	CDialog::OnOK();
	CDialog::OnRButtonUp(nFlags, point);
}

void CDlgFull::OnPaint() 
{	
	CPaintDC dc(this); // device context for painting
	if(m_parent->s_hPlayHandle == NULL)
	{
		CRect Rect;
		CBrush tempBrush(UNLINK_COLOR);
		GetClientRect(&Rect);
		dc.FillRect(Rect, &tempBrush);
		return;
	}
	else
	{
		CRect Rect;
		CBrush tempBrush(FACE_COLOR);
		GetClientRect(&Rect);
		dc.FillRect(Rect, &tempBrush);
	}	
}

void CDlgFull::DlgPlay( BOOL isfull )
{
    if ( isfull )
    {
        LCPLAYM4_PlaySetWnd(m_parent->s_hPlayHandle, m_hWnd);
        LCPLAYM4_RefreshDisplay(m_parent->s_hPlayHandle);
    }
}
