|
/***************************************************************************/
/* NOTE: */
/* This document is copyright (c) by Oz Solomonovich. All non-commercial */
/* use is allowed, as long as this document is not altered in any way, and */
/* due credit is given. */
/***************************************************************************/
// MainDlg.cpp : implementation file
//
#include "stdafx.h"
#include "LineCount.h"
#include "MainDlg.h"
#include "Config.h"
#include "Options.h"
#include "Parser.h"
#include "Help\HelpIDs.h"
#include "ResultsDlg.h"
#include "AboutDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainDlg dialog
CMainDlg::CMainDlg(WWhizInterface *pwwi, CWnd* pParent /*=NULL*/)
: m_pWWI(pwwi),
CHHDialog(CMainDlg::IDD, pParent, true, IDH_DLG_MAIN)
{
//{{AFX_DATA_INIT(CMainDlg)
//}}AFX_DATA_INIT
}
void CMainDlg::DoDataExchange(CDataExchange* pDX)
{
CHHDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CMainDlg)
//}}AFX_DATA_MAP
DDX_Check(pDX, IDC_ACTIVEONLY, cfg_bActiveProjOnly);
}
BEGIN_MESSAGE_MAP(CMainDlg, CHHDialog)
//{{AFX_MSG_MAP(CMainDlg)
ON_BN_CLICKED(IDC_GO, OnGo)
ON_BN_CLICKED(IDC_ABOUT, OnAbout)
ON_BN_CLICKED(IDC_OPTIONS, OnOptions)
ON_BN_CLICKED(IDC_ACTIVEONLY, OnActiveonly)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMainDlg message handlers
void CMainDlg::OnGo()
{
proj_stats *pStats;
if ((pStats = CountLines(m_pWWI)) != NULL)
{
// display results
{
CResultsDlg dlg(pStats, m_pWWI);
dlg.DoModal();
delete pStats;
}
}
}
BOOL CMainDlg::OnInitDialog()
{
CHHDialog::OnInitDialog();
return TRUE;
}
void CMainDlg::OnAbout()
{
// ShowHTMLHelp(m_hWnd, IDH_ABOUT, "AboutWnd");
CAboutDialog dlg;
dlg.DoModal();
}
void CMainDlg::OnOptions()
{
COptionsSheet dlg;
dlg.DoModal();
UpdateData(FALSE);
}
void CMainDlg::OnActiveonly()
{
UpdateData();
}
|
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