|
/**********************************************************************
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
*************************************************************************/
// SetIniFileDlg.cpp : implementation file
//
#include "stdafx.h"
#include "Addin.h"
#include "SetIniFileDlg.h"
#include "Resource.h"
#include ".\setinifiledlg.h"
#include "../StateTree/common.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
extern BOOL g_bEnableSetting;
// The setting of state tree max level number.
extern int g_nMaxLevelNum;
extern int g_nFileType;
// CSetIniFileDlg dialog
IMPLEMENT_DYNAMIC(CSetIniFileDlg, CDialog)
CSetIniFileDlg::CSetIniFileDlg(CWnd* pParent /*=NULL*/)
: CDialog(CSetIniFileDlg::IDD, pParent)
{
m_nMaxHierachyLevel = DEF_STATE_CHART_MAX_LEVEL;
m_iFileType = 0;
}
CSetIniFileDlg::~CSetIniFileDlg()
{
}
void CSetIniFileDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_HIERARCHY_LEVEL_EDIT, m_nMaxHierachyLevel);
DDV_MinMaxInt(pDX, m_nMaxHierachyLevel, 2, 8);
DDX_Radio(pDX, IDC_RADIO_FILE_TYPE_CPP, m_iFileType);
}
BEGIN_MESSAGE_MAP(CSetIniFileDlg, CDialog)
ON_EN_KILLFOCUS(IDC_HIERARCHY_LEVEL_EDIT, OnEnKillfocusHierarchyLevelEdit)
END_MESSAGE_MAP()
// CSetIniFileDlg message handlers
BOOL CSetIniFileDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
// Set default level is 4 (DEF_STATE_CHART_MAX_LEVEL)
CString sMaxLevel;
m_nMaxHierachyLevel = g_nMaxLevelNum;//CParamStore::GetInstance().GetIntValue("StateChart","MaxLevel");
// if (m_nMaxHierachyLevel<2 || m_nMaxHierachyLevel>8)
// m_nMaxHierachyLevel = 4;
m_iFileType = g_nFileType;//CParamStore::GetInstance().GetIntValue("StateChart","FileType");
UpdateData(FALSE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSetIniFileDlg::OnOK()
{
// TODO: Add extra validation here
// data is being retrieved (TRUE).
UpdateData(TRUE);
CString sMaxLevel;
sMaxLevel.Format("%d", m_nMaxHierachyLevel);
g_dsUtils.PutParamStoreValue("StateChart","MaxLevel",sMaxLevel);
g_nMaxLevelNum = m_nMaxHierachyLevel;
CString sFileType;
sFileType.Format("%d",m_iFileType);
g_dsUtils.PutParamStoreValue("StateChart","FileType",sFileType);
//enum {SRC_FILE_TYPE_CPP=0, SRC_FILE_TYPE_C =1};
g_nFileType = m_iFileType;
CDialog::OnOK();
}
void CSetIniFileDlg::OnEnKillfocusHierarchyLevelEdit()
{
// TODO: Add your control notification handler code here
// data is being retrieved (TRUE).
if (!UpdateData(TRUE))
{
m_nMaxHierachyLevel = DEF_STATE_CHART_MAX_LEVEL;
UpdateData(FALSE);
}
}
|
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.