📄 dialogfinanceout.cpp
字号:
// DialogFinanceOut.cpp : implementation file
//
#include "stdafx.h"
#include "HomeFinanceManager.h"
#include "DialogFinanceOut.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogFinanceOut dialog
CDialogFinanceOut::CDialogFinanceOut(CWnd* pParent /*=NULL*/)
: CDialog(CDialogFinanceOut::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogFinanceOut)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_bInitialTab = false;
m_pActiveDlg = NULL;
}
void CDialogFinanceOut::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogFinanceOut)
DDX_Control(pDX, IDC_TAB_FINANCEOUT, m_tabFinanceOut);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogFinanceOut, CDialog)
//{{AFX_MSG_MAP(CDialogFinanceOut)
ON_WM_SIZE()
ON_NOTIFY(TCN_SELCHANGE, IDC_TAB_FINANCEOUT, OnSelchangeTabFinanceout)
ON_WM_SHOWWINDOW()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogFinanceOut message handlers
void CDialogFinanceOut::ShowTabFinanceOut()
{
if(!m_bInitialTab && m_tabFinanceOut)
{
TCITEM Item;
Item.mask = TCIF_TEXT;
Item.pszText = "查询支出";
m_tabFinanceOut.InsertItem(0, &Item);
Item.pszText = "添加新项";
m_tabFinanceOut.InsertItem(1, &Item);
}
if(m_tabFinanceOut)
{
RECT rcClient;
this->GetClientRect(&rcClient);
m_tabFinanceOut.MoveWindow(&rcClient);
}
}
//----------------------------------------------------------------------------
void CDialogFinanceOut::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
ShowTabFinanceOut();
}
//----------------------------------------------------------------------------
void CDialogFinanceOut::ShowFinanceOutQuery()
{
if(!m_DialogFinanceOutQuery)
{
m_DialogFinanceOutQuery.Create(IDD_FINANCEOUT_QUERY, &m_tabFinanceOut);
}
if(m_pActiveDlg)
{
m_pActiveDlg->ShowWindow(SW_HIDE);
}
m_pActiveDlg = &m_DialogFinanceOutQuery;
ShowActiveWnd();
}
//----------------------------------------------------------------------------
void CDialogFinanceOut::ShowFinanceOutAdd()
{
if(!m_DialogFinanceOutAdd)
{
m_DialogFinanceOutAdd.Create(IDD_FINANCEOUT_ADD, &m_tabFinanceOut);
}
if(m_pActiveDlg)
{
m_pActiveDlg->ShowWindow(SW_HIDE);
}
m_pActiveDlg = &m_DialogFinanceOutAdd;
ShowActiveWnd();
}
//----------------------------------------------------------------------------
void CDialogFinanceOut::ShowActiveWnd()
{
if(m_pActiveDlg)
{
RECT rcClient;
m_tabFinanceOut.GetClientRect(&rcClient);
rcClient.top += 30;
m_pActiveDlg->ShowWindow(SW_SHOW);
m_pActiveDlg->MoveWindow(&rcClient);
}
}
void CDialogFinanceOut::OnSelchangeTabFinanceout(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int iSel = m_tabFinanceOut.GetCurSel();
if(0 == iSel)
{
ShowFinanceOutQuery();
}
if(1 == iSel)
{
ShowFinanceOutAdd();
}
*pResult = 0;
}
void CDialogFinanceOut::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialog::OnShowWindow(bShow, nStatus);
// TODO: Add your message handler code here
ShowFinanceOutQuery();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -