// TextureLibFrame.cpp : implementation file
//

#include "stdafx.h"
#include "ImageGrinder.h"
#include "TextureLibFrame.h"


/////////////////////////////////////////////////////////////////////////////
// CTextureLibFrame

IMPLEMENT_DYNCREATE(CTextureLibFrame, CMDIChildWnd)

CTextureLibFrame::CTextureLibFrame()
{
DiagPanel=NULL;
}

CTextureLibFrame::~CTextureLibFrame()
{
if(DiagPanel) delete DiagPanel;
}


BEGIN_MESSAGE_MAP(CTextureLibFrame, CMDIChildWnd)
	//{{AFX_MSG_MAP(CTextureLibFrame)
	ON_WM_CLOSE()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CTextureLibFrame message handlers

void CTextureLibFrame::Create(CMDIFrameWnd *Parent)
{

// 	CMDIChildWnd::Create(NULL,"Texture Library",WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_CHILD,rectDefault,Parent);
	CMDIChildWnd::Create(NULL,"Texture Library",WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_CHILD,rectDefault,Parent);
	DiagPanel=new CTextureLibDiag;
	DiagPanel->Create(CTextureLibDiag::IDD,this);
	CRect rct;
	DiagPanel->GetWindowRect(&rct);
	SetWindowPos(NULL,0,0,
			rct.Width()+GetSystemMetrics(SM_CXSIZEFRAME)*2,
			rct.Height()+GetSystemMetrics(SM_CXSIZEFRAME)+GetSystemMetrics(SM_CYCAPTION),
			SWP_NOZORDER|SWP_NOMOVE);
	DiagPanel->ShowWindow(SW_SHOW);
}

void CTextureLibFrame::OnClose() 
{
	// TODO: Add your message handler code here and/or call default
	
//	CMDIChildWnd::OnClose();
}

BOOL CTextureLibFrame::OnIdle()
{
if(DiagPanel) return DiagPanel->OnIdle();
return FALSE;
}
