⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlgquery.cpp

📁 一个有关数据库方面的代码 流水帐记录、统计、查询等功
💻 CPP
字号:
// DlgQuery.cpp : implementation file
//

#include "stdafx.h"
#include "wastebook.h"
#include "DlgQuery.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CDlgQuery dialog


CDlgQuery::CDlgQuery(CWnd* pParent /*=NULL*/)
	: CDialog(CDlgQuery::IDD, pParent)
{
	//{{AFX_DATA_INIT(CDlgQuery)
	m_Type = _T("");
	m_NumFrom = 0;
	m_NumTo = 0;
	m_TimeFrom = 0;
	m_TimeTo = 0;
	//}}AFX_DATA_INIT
}


void CDlgQuery::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CDlgQuery)
	DDX_Control(pDX, IDC_COMBO_Type, m_ctrlType);
	DDX_CBString(pDX, IDC_COMBO_Type, m_Type);
	DDX_Text(pDX, IDC_EDIT_NumFrom, m_NumFrom);
	DDV_MinMaxInt(pDX, m_NumFrom, -2, 99999999);
	DDX_Text(pDX, IDC_EDIT_NumTo, m_NumTo);
	DDV_MinMaxInt(pDX, m_NumTo, -2, 99999999);
	DDX_DateTimeCtrl(pDX, IDC_TimeFrom, m_TimeFrom);
	DDX_DateTimeCtrl(pDX, IDC_TimeTo, m_TimeTo);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CDlgQuery, CDialog)
	//{{AFX_MSG_MAP(CDlgQuery)
	ON_BN_CLICKED(IDC_CHECK_Type, OnCHECKType)
	ON_BN_CLICKED(IDC_RADIO_Income, OnRADIOIncome)
	ON_BN_CLICKED(IDC_RADIO_Outgo, OnRADIOOutgo)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDlgQuery message handlers

BOOL CDlgQuery::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	bIncome=1;
	m_Form="Income";
	m_Type="";
	m_TimeFrom=CTime(1971,1,1,0,0,0);
	m_TimeTo=CTime(2036,12,31,0,0,0);
	m_NumFrom=-1;
	m_NumTo=9999999;
	UpdateData(0);

	CheckRadioButton(IDC_RADIO_Income,IDC_RADIO_Outgo,IDC_RADIO_Income);
	int l=theApp.InListType.GetCount();
	POSITION pos=theApp.InListType.GetHeadPosition();
	for(int i=0;i<l;i++)
		m_ctrlType.AddString(theApp.InListType.GetNext(pos));

	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void CDlgQuery::OnCHECKType() 
{
	// TODO: Add your control notification handler code here
	m_ctrlType.EnableWindow(1);
	
}

void CDlgQuery::OnRADIOIncome() 
{
	// TODO: Add your control notification handler code here
	if(!bIncome)
	{
		bIncome=1;
		m_Form="Income";
		FormChanged();	
	}
}

void CDlgQuery::OnRADIOOutgo() 
{
	// TODO: Add your control notification handler code here
	if(bIncome)
	{
		bIncome=0;
		m_Form="Outgo";
		FormChanged();
	}
		
}

void CDlgQuery::FormChanged()
{
	m_ctrlType.ResetContent();

	if(bIncome)
	{
		int l=theApp.InListType.GetCount();
		POSITION pos=theApp.InListType.GetHeadPosition();
		for(int i=0;i<l;i++)
			m_ctrlType.AddString(theApp.InListType.GetNext(pos));
	}
	else
	{
		int l=theApp.OutListType.GetCount();
		POSITION pos=theApp.OutListType.GetHeadPosition();
		for(int i=0;i<l;i++)
			m_ctrlType.AddString(theApp.OutListType.GetNext(pos));
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -