/* -----------------------------------------------------------------------------

 Copyright (C) Siemens AG 1994-2001,  ALL RIGHTS RESERVED

 This software is protected by the inclusion of the above copyright
 notice. This software may not be provided or otherwise made available
 to, or used by, any other person. No title to or ownership of the
 software is  hereby  transferred.
 The information contained in this document is considered the
 CONFIDENTIAL and PROPRIETARY information of Siemens AG and may
 not be disclosed or discussed with anyone who is not employed by
 Siemens AG, unless the individual / company
 (i) has an express need to know such information, and
 (ii) disclosure of information is subject to the terms of a duly
 executed Confidentiality and Non-Disclosure Agreement between
 Siemens AG and the individual / company.



.AUTHOR         Zhang Jing (SLC)

.FILENAME       sp_jheapdlg.cpp

.VERSION        01.00.00

.DATE           2004-02-17

.SHORT_DESCR    Runtime Heap Dialog for Shaped Ui

.SW_COMPONENT   MMI PC-SIMULATION

.SW_TYPE        

.EXIT_CODES

.CHANGE_CONTROL 
Version  Date        Changed by
         Reason of change
--------------------------------------------------------------------------------
01.00.00 2004-02-17  Zhang Jing (PEK)
         Initial version

*/


#include "smsafxh.h"
#include "sp_jheapdlgh.h"
#include ".\sp_jheapdlgh.h"
#include "..\..\private_pc\sp_jheapdlgh.h"
#include "mmidisph.h"
#include "simuapph.h"




IMPLEMENT_DYNAMIC(CJavaHeapInfo, CDialog)
CJavaHeapInfo::CJavaHeapInfo(CWnd* pParent /*=NULL*/)
	: CDialog(CJavaHeapInfo::IDD, pParent)
{
}

CJavaHeapInfo::~CJavaHeapInfo()
{
}

void CJavaHeapInfo::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CJavaHeapInfo, CDialog)
	ON_WM_CREATE()
	ON_WM_DESTROY()
	ON_WM_CLOSE()
END_MESSAGE_MAP()


// CJavaHeapInfo message handlers

BOOL CJavaHeapInfo::OnInitDialog()
{
	CDialog::OnInitDialog();

   if (!m_HeapView.Create(NULL, NULL, AFX_WS_DEFAULT_VIEW,
        CRect(JAVA_VIEW_LEFT, JAVA_VIEW_TOP, JAVA_VIEW_RIGHT, JAVA_VIEW_BOTTOM), this, AFX_IDW_PANE_FIRST+2, NULL))
    {
        TRACE0("Failed to create view window\n");
        return -1;
    }
	//m_HeapView
	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}

int CJavaHeapInfo::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  Add your specialized creation code here

	return 0;
}

BOOL CJavaHeapInfo::Create(INT m_nID, CWnd* pParentWnd)
{

	return CDialog::Create(m_nID, pParentWnd);
}


BOOL CJavaHeapInfo::Create(LPCTSTR lpszTemplateName, CWnd* pParentWnd)
{
	return CDialog::Create(lpszTemplateName, pParentWnd);

}
void CJavaHeapInfo::OnDestroy()
{
	CDialog::OnDestroy();
	m_HeapView.DestroyWindow();

	CMMIDispWindow * p_Disp = ((CMFC_Simulation_App *)AfxGetApp())->GetMMIDispWindow(); 

	p_Disp->MakeActiveWnd();

	//delete this;

}

void CJavaHeapInfo::OnClose()
{
	// TODO: Add your message handler code here and/or call default

	CDialog::OnClose();

	DestroyWindow();
}
