|
// Documentation.cpp : implementation file
//
#include "stdafx.h"
#include "piccpc.h"
#include "Documentation.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDocumentation property page
IMPLEMENT_DYNCREATE(CDocumentation, CPropertyPage)
CDocumentation::CDocumentation() : CPropertyPage(CDocumentation::IDD)
{
//{{AFX_DATA_INIT(CDocumentation)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CDocumentation::~CDocumentation()
{
}
void CDocumentation::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDocumentation)
DDX_Control(pDX, IDC_DOC_INFO, m_sDOCInfo);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDocumentation, CPropertyPage)
//{{AFX_MSG_MAP(CDocumentation)
ON_BN_CLICKED(IDC_USE_HTML_HELP, OnUseHtmlHelp)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDocumentation message handlers
BOOL CDocumentation::OnKillActive()
{
PICInfo.bDOCUseHTML = IsDlgButtonChecked( IDC_USE_HTML );
PICInfo.bDOCUseHTMLHelp = IsDlgButtonChecked( IDC_USE_HTML_HELP );
PICInfo.bDOCUseRTF = IsDlgButtonChecked( IDC_USE_RTF );
PICInfo.bDOCUseLaTeX = IsDlgButtonChecked( IDC_USE_LATEX );
return CPropertyPage::OnKillActive();
}
BOOL CDocumentation::OnSetActive()
{
CheckDlgButton( IDC_USE_HTML, PICInfo.bDOCUseHTML );
CheckDlgButton( IDC_USE_HTML_HELP, PICInfo.bDOCUseHTMLHelp );
CheckDlgButton( IDC_USE_LATEX, PICInfo.bDOCUseLaTeX );
CheckDlgButton( IDC_USE_RTF, PICInfo.bDOCUseRTF );
return CPropertyPage::OnSetActive();
}
BOOL CDocumentation::OnInitDialog()
{
CPropertyPage::OnInitDialog();
m_sDOCInfo.SetWindowText( "- Source code is documented to support Doxygen"
" as the documentation system:\n"
"\thttp://www.stack.nl/~dimitri/doxygen/index.html\n\n"
"- To support HTML Help format, download the HTML Help Workshop from:\n"
"\thttp://www.microsoft.com/office/ork/xp/appndx/appa06.htm\n\n"
"- To support LaTeX format, you can download MiKTeX from:\n"
"\thttp://www.miktex.org\n"
"\tLaTeX format will create a PDF version." );
CFileFind ff;
if ( !ff.FindFile(PICInfo.sHHCPath) ) {
PICInfo.sHHCPath[0] = NULL;
}
CString s;
GetDlgItemText( IDC_USE_HTML_HELP, s );
if ( PICInfo.sHHCPath[0] == NULL ) {
s += sSPECIFY;
SetDlgItemText( IDC_USE_HTML_HELP, s );
}
else {
s += " [";
s += PICInfo.sHHCPath;
s += "]";
SetDlgItemText( IDC_USE_HTML_HELP, s );
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDocumentation::OnUseHtmlHelp()
{
if ( IsDlgButtonChecked(IDC_USE_HTML_HELP) ) {
if ( PICInfo.sHHCPath[0] == NULL ) {
CFileDialog fd(TRUE,NULL,"hhc.exe");
char cd[MAX_PATH];
GetCurrentDirectory( MAX_PATH, cd );
int r = fd.DoModal();
if ( IDOK == r ) {
AfxGetApp()->WriteProfileString( SETTINGS, HHCPATH, fd.GetPathName() );
CString s;
GetDlgItemText( IDC_USE_HTML_HELP, s );
s.Replace( sSPECIFY, "" );
SetDlgItemText( IDC_USE_HTML_HELP, s );
}
else {
CheckDlgButton( IDC_USE_HTML_HELP, 0 );
}
SetCurrentDirectory( cd );
}
}
}
|
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.