|
/**********************************************************************
UML StateWizard provides its software under the LGPL License and
zlib/libpng License for open source projects.
Email us at info@intelliwizard.com for any information, suggestions and
feature requestions.
Home Page: http://www.intelliwizard.com
*************************************************************************/
// StateChartDlg.cpp : implementation file
//
#include "stdafx.h"
#include "StateTree.h"
#include "StateChartDlg.h"
#include "resource.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifdef _DUMMY_DEBUG
#define new SME_DEBUG_NEW
#define delete SME_DEBUG_DELETE
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// StateChartDlg dialog
StateChartDlg::StateChartDlg(CWnd* pParent /*=NULL*/)
: CDialog(StateChartDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(StateChartDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void StateChartDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(StateChartDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(StateChartDlg, CDialog)
//{{AFX_MSG_MAP(StateChartDlg)
ON_WM_CREATE()
ON_WM_SIZE()
//}}AFX_MSG_MAP
ON_MESSAGE(WM_CLOSE_DLG, OnViewClose)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// StateChartDlg message handlers
int StateChartDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
// TODO: Add your specialized creation code here
// graph create:
CRect rcl(0,0,800,400);
m_StateChartView.Create(NULL, "", WS_CHILD | WS_HSCROLL | WS_VSCROLL, rcl, this, NULL);
m_StateChartView.m_pStateTree = m_pStateTree;
m_StateChartView.ShowWindow(SW_SHOW);
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
void StateChartDlg::OnSize(UINT nType, int cx, int cy)
{
CRect rclClient;
GetClientRect(&rclClient);
m_StateChartView.SetWindowPos(NULL, 0, 0, rclClient.Width(), rclClient.Height(), SWP_NOZORDER | SWP_NOACTIVATE);
// Set to -1 means it is first time to initialize state view or it is set by left button click
if (m_StateChartView.m_bSizeChange == -1)
m_StateChartView.m_bSizeChange = 0;
// Set to 1 means the window has been enlarged
else if (m_StateChartView.m_bSizeChange == 0)
m_StateChartView.m_bSizeChange = 1;
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
}
///////////////////////////////////////////////////////////////////////////////////////////
// DESCRIPTION: Initialize the AddApp(state) dialog
// INPUT: None
// OUTPUT: None
// Note:
///////////////////////////////////////////////////////////////////////////////////////////
BOOL StateChartDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
//. SME_TRACE("Create draw state chart dialog!\n");
m_hIcon = AfxGetApp()->LoadIcon(IDI_APP);
SetIcon(m_hIcon, FALSE); //small icon
// SetIcon(NULL, TRUE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void StateChartDlg::OnDestroy()
{
m_StateChartView.DestroyWindow();
CDialog::OnDestroy();
if (m_hIcon) DestroyIcon(m_hIcon);
// TODO: Add your message handler code here
//. SME_TRACE("Destroy draw state chart dialog!\n");
//. SME_ALLOC_MEM_SIZE();
}
LRESULT StateChartDlg::OnViewClose(WPARAM wParam, LPARAM lParam)
{
OnCancel();
return TRUE;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.