|
// ZDlgUDMacroPS.cpp : implementation file
//
#include "stdafx.h"
#include "CPPCWiz.h"
#include "ZDlgUDMacroPS.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CZDlgUDMacroPS property page
IMPLEMENT_DYNCREATE(CZDlgUDMacroPS, CPropertyPage)
CZDlgUDMacroPS::CZDlgUDMacroPS() : CPropertyPage(CZDlgUDMacroPS::IDD)
{
//{{AFX_DATA_INIT(CZDlgUDMacroPS)
m_strMacroValue = _T("");
//}}AFX_DATA_INIT
m_pCommand = NULL;
}
CZDlgUDMacroPS::~CZDlgUDMacroPS()
{
}
void CZDlgUDMacroPS::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CZDlgUDMacroPS)
DDX_Control(pDX, IDC_LIST_UDMACROS, m_lstUDMacro);
DDX_Text(pDX, IDC_EDIT_MACROVALUE, m_strMacroValue);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CZDlgUDMacroPS, CPropertyPage)
//{{AFX_MSG_MAP(CZDlgUDMacroPS)
ON_LBN_SELCHANGE(IDC_LIST_UDMACROS, OnSelchangeListUdmacros)
ON_BN_CLICKED(IDC_BUTTON_EDITFILE, OnButtonEditfile)
ON_BN_CLICKED(IDC_BUTTON_RELOADCOMMENTFILE, OnButtonReloadcommentfile)
ON_BN_CLICKED(IDC_BUTTON_RELOADMACROFILE, OnButtonReloadmacrofile)
ON_BN_CLICKED(IDC_BUTTON_EDITCOMMENTFILE, OnButtonEditcommentfile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CZDlgUDMacroPS message handlers
VOID CZDlgUDMacroPS::SetCommandObject(CCommands *pCommand)
{
m_pCommand = pCommand;
}
BOOL CZDlgUDMacroPS::OnInitDialog()
{
CPropertyPage::OnInitDialog();
ASSERT(m_pCommand != NULL);
// TODO: Add extra initialization here
GetMacroListInTempPointers();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CZDlgUDMacroPS::OnOK()
{
// TODO: Add your specialized code here and/or call the base class
CPropertyPage::OnOK();
}
void CZDlgUDMacroPS::OnCancel()
{
// TODO: Add your specialized code here and/or call the base class
CPropertyPage::OnCancel();
}
BOOL CZDlgUDMacroPS::OnApply()
{
// TODO: Add your specialized code here and/or call the base class
return CPropertyPage::OnApply();
}
void CZDlgUDMacroPS::OnSelchangeListUdmacros()
{
// TODO: Add your control notification handler code here
INT iCurSel = -1;
iCurSel = m_lstUDMacro.GetCurSel();
if(iCurSel < 0 )
return;
m_strMacroValue = m_ArrTempMacroRepl.GetAt(iCurSel);
UpdateData(FALSE);
}
void CZDlgUDMacroPS::OnButtonEditfile()
{
// TODO: Add your control notification handler code here
CString FilePath = m_pCommand->m_OMacroResolver.GetMacroFilePath();
m_pCommand->m_OAddInAddOn.OpenFile(FilePath);
}
void CZDlgUDMacroPS::OnButtonReloadcommentfile()
{
// TODO: Add your control notification handler code here
m_pCommand->m_OCommentReader.ReparseFile();
}
void CZDlgUDMacroPS::OnButtonReloadmacrofile()
{
// TODO: Add your control notification handler code here
m_pCommand->m_OMacroResolver.ReparseMacroFile() ;
GetMacroListInTempPointers();
}
VOID CZDlgUDMacroPS::GetMacroListInTempPointers()
{
m_pArrMacro = m_pCommand->m_OMacroResolver.GetMacroArrayPointer();
m_pArrMacroRepl = m_pCommand->m_OMacroResolver.GetMacroReplArrayPointer();
m_ArrTempMacro.RemoveAll();
m_ArrTempMacroRepl.RemoveAll();
m_lstUDMacro.ResetContent();
CString strTmp;
for(int i=0;i< m_pArrMacro->GetSize() ; i++)
{
strTmp = m_pArrMacro->GetAt(i);
m_ArrTempMacro.Add(strTmp);
m_ArrTempMacroRepl.Add(m_pArrMacroRepl->GetAt(i));
m_lstUDMacro.AddString(strTmp);
}
}
void CZDlgUDMacroPS::OnButtonEditcommentfile()
{
// TODO: Add your control notification handler code here
CString FilePath = m_pCommand->m_OCommentReader.GetCommentFilePath();
m_pCommand->m_OAddInAddOn.OpenFile(FilePath);
}
|
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.
This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.
A list of licenses authors might use can be found here
A 8 or something in .NET, living in Ahmedabad, India owned IntelliPro Solutions Pvt. Ltd..
Currently working on .NET technologies, MVC and Silverlight.
My little blog is for helping community with the solution for problems or helping them to understand new technology. You can reach to my blog at http://maniish.wordpress.com.
To contact me, post comment here or email me at manish AT iprospl.com