assetmodifydlg.cpp

来自「该项目是为PPC(PocketPc)使用者提供方便的理财事务.如,现金的借贷,债」· C++ 代码 · 共 151 行

CPP
151
字号
// AssetModifyDlg.cpp : implementation file
//

#include "stdafx.h"
#include "MoneyAnyWhere.h"
#include "AssetModifyDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CAssetModifyDlg dialog


CAssetModifyDlg::CAssetModifyDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CAssetModifyDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CAssetModifyDlg)
	m_strCategory = _T("");
	m_iAmount = 0;
	m_strAccountName = _T("");
	m_strTarget = _T("");
	//}}AFX_DATA_INIT
}


void CAssetModifyDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CAssetModifyDlg)
	DDX_Control(pDX, IDC_COMBO_CATEGORY, m_ctrComboBox);
	DDX_CBString(pDX, IDC_COMBO_CATEGORY, m_strCategory);
	DDX_Text(pDX, IDC_EDIT_AMOUNT, m_iAmount);
	DDX_Text(pDX, IDC_EDIT_ASSNAME, m_strAccountName);
	DDX_Text(pDX, IDC_EDIT_TARGET, m_strTarget);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CAssetModifyDlg, CDialog)
	//{{AFX_MSG_MAP(CAssetModifyDlg)
	ON_BN_CLICKED(IDC_BTNCANCEL1, OnBtncancel1)
	ON_BN_CLICKED(IDC_BTNHELP1, OnBtnhelp1)
	ON_BN_CLICKED(IDC_BTNMODIFY, OnBtnmodify)
	ON_EN_SETFOCUS(IDC_EDIT_AMOUNT, OnSetfocusEditAmount)
	ON_EN_KILLFOCUS(IDC_EDIT_AMOUNT, OnKillfocusEditAmount)
	ON_EN_SETFOCUS(IDC_EDIT_TARGET, OnSetfocusEditTarget)
	ON_EN_KILLFOCUS(IDC_EDIT_TARGET, OnKillfocusEditTarget)
	ON_WM_PAINT()
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CAssetModifyDlg message handlers

void CAssetModifyDlg::OnBtncancel1() 
{
	CDialog::OnCancel();
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnBtnhelp1() 
{
	AfxMessageBox(L"帮助!");
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnBtnmodify() 
{
	UpdateData(true);
	GetDlgItemText(IDC_DATETIMEPICKER_DATE,m_strTime);
	GetDlgItemText(IDC_DATETIMEPICKER_BACKDATE,m_strBackTime);
	m_strInOrOut = Query(m_strCategory);
	CDialog::OnOK();
	// TODO: Add your control notification handler code here
	
}

BOOL CAssetModifyDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	
	if(!Init())
		return false;
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}


BOOL CAssetModifyDlg::Init()
{
	m_ctrComboBox.InsertString(0,L"借入");
	m_ctrComboBox.InsertString(1,L"借出");
	return TRUE;
}

CString CAssetModifyDlg::Query(CString m_strCategory)
{
	CString str;
	if(m_strCategory == L"借入")
		str = L"in";
	else
		str = L"out";
	return str;
}

void CAssetModifyDlg::OnSetfocusEditAmount() 
{
	SHSipPreference(m_hWnd, SIP_UP);
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnKillfocusEditAmount() 
{
	SHSipPreference(m_hWnd, SIP_DOWN);
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnSetfocusEditTarget() 
{
	SHSipPreference(m_hWnd, SIP_UP);
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnKillfocusEditTarget() 
{
	SHSipPreference(m_hWnd, SIP_DOWN);
	// TODO: Add your control notification handler code here
	
}

void CAssetModifyDlg::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
	CRect	rect;
	this->GetClientRect(&rect);
	CBrush	*pBrush = new CBrush(COLORREF(RGB(227,234,206)));
	dc.FillRect(rect,pBrush);	
	dc.SetBkColor(COLORREF(RGB(227,234,206)));
}

⌨️ 快捷键说明

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