📄 charttab.cpp
字号:
// ChartTab.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "ChartTab.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChartTab dialog
CChartTab::CChartTab(CWnd* pParent /*=NULL*/)
: CDialog(CChartTab::IDD, pParent)
{
//{{AFX_DATA_INIT(CChartTab)
//}}AFX_DATA_INIT
}
void CChartTab::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChartTab)
DDX_Control(pDX, IDC_CHARTTAB, m_ChartTab);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChartTab, CDialog)
//{{AFX_MSG_MAP(CChartTab)
ON_NOTIFY(TCN_SELCHANGE, IDC_CHARTTAB, OnSelchangeCharttab)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChartTab message handlers
BOOL CChartTab::OnInitDialog()
{
CDialog::OnInitDialog();
CRect rect;
m_ChartTab.InsertItem(0,_T("销售Top 10"));
m_ChartTab.InsertItem(1,_T("营业额视图"));
topten.pConn = pConn;
income.pConn = pConn;
topten.Create(MAKEINTRESOURCE(IDD_TOPTEN),this);
income.Create(MAKEINTRESOURCE(IDD_INCOMCHART),this);
topten.GetClientRect(&rect);
m_ChartTab.AdjustRect(FALSE,&rect);
rect.top+=11;
rect.bottom+=30;
topten.MoveWindow(&rect);
income.GetClientRect(&rect);
m_ChartTab.AdjustRect(FALSE,&rect);
rect.top+=11;
rect.bottom+=30;
income.MoveWindow(&rect);
m_ChartTab.SetCurSel(0);
topten.ShowWindow(SW_SHOW);
return TRUE;
}
void CChartTab::OnSelchangeCharttab(NMHDR* pNMHDR, LRESULT* pResult)
{
HideAllTabWindow();
switch(m_ChartTab.GetCurSel())
{
case 0:
topten.ShowWindow(SW_SHOW);
break;
case 1:
income.ShowWindow(SW_SHOW);
break;
}
*pResult = 0;
}
void CChartTab::HideAllTabWindow()
{
topten.ShowWindow(SW_HIDE);
income.ShowWindow(SW_HIDE);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -