?? cba_systemdlg.cpp
字號(hào):
// CBA_SYSTEMDlg.cpp : implementation file
//
#include "stdafx.h"
#include "CBA_SYSTEM.h"
#include "CBA_SYSTEMDlg.h"
#include "StackedWndCtrl.h"
#include "CBADlg.h"
#include "ResultShow.h"
#include "Neural_NetWork.h"
#include "ExceptionDataTest.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CCBADlg *ptempDlg;
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCBA_SYSTEMDlg dialog
CCBA_SYSTEMDlg::CCBA_SYSTEMDlg(CWnd* pParent /*=NULL*/)
: CDialog(CCBA_SYSTEMDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CCBA_SYSTEMDlg)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}
void CCBA_SYSTEMDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCBA_SYSTEMDlg)
DDX_Control(pDX, IDC_BUTTON2, m_modeconfigbt);
DDX_Control(pDX,IDC_BUTTON1,m_datasourceconfigbt);
DDX_Control(pDX,IDC_BUTTON6,m_resultshowbt);
DDX_Control(pDX,IDC_BUTTON3,m_syscheckbt);
DDX_Control(pDX,IDC_BUTTON4,m_dataquerybt);
DDX_Control(pDX,IDC_BUTTON5,m_exitsysbt);
DDX_Control(pDX, IDC_SWC, m_StackedWndCtrl);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCBA_SYSTEMDlg, CDialog)
//{{AFX_MSG_MAP(CCBA_SYSTEMDlg)
ON_WM_SYSCOMMAND()
ON_WM_PAINT()
ON_WM_QUERYDRAGICON()
ON_BN_CLICKED(IDC_BUTTON2, OnModeConfig)
ON_BN_CLICKED(IDC_BUTTON1, OnDataSourceConfig)
ON_BN_CLICKED(IDC_BUTTON6, OnShowResult)
ON_BN_CLICKED(IDC_BUTTON5, OnExitSystem)
ON_BN_CLICKED(IDC_BUTTON3, OnExceptionDataTest)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCBA_SYSTEMDlg message handlers
BOOL CCBA_SYSTEMDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Add "About..." menu item to system menu.
// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
//初始化位圖按鈕
m_modeconfigbt.SetBitmaps(IDB_BITMAP3,RGB(0,0,0));
m_modeconfigbt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_modeconfigbt.DrawBorder();
//----------------------------------------------------------------
m_datasourceconfigbt.SetBitmaps(IDB_BITMAP2,RGB(0,0,0));
m_datasourceconfigbt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_datasourceconfigbt.DrawBorder();
//------------------------------------------------------------------
m_resultshowbt.SetBitmaps(IDB_BITMAP4,RGB(0,0,0));
m_resultshowbt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_resultshowbt.DrawBorder();
//------------------------------------------------------------------
m_syscheckbt.SetBitmaps(IDB_BITMAP6,RGB(0,0,0));
m_syscheckbt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_syscheckbt.DrawBorder();
//---------------------------------------------------------------
m_dataquerybt.SetBitmaps(IDB_BITMAP5,RGB(0,0,0));
m_dataquerybt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_dataquerybt.DrawBorder();
//----------------------------------------------------------------
m_exitsysbt.SetBitmaps(IDB_BITMAP1,RGB(0,0,0));
m_exitsysbt.OffsetColor(CButtonST::BTNST_COLOR_BK_IN,30);
m_exitsysbt.DrawBorder();
//CCBADlg* cba_dlg = new CCBADlg;
ptempDlg->Create(IDD_CBA_DIALOG,&m_StackedWndCtrl);
CDataSourceConfig* dataconfig_dlg = new CDataSourceConfig;
dataconfig_dlg->Create(IDD_DATASOURCE_DIALOG,&m_StackedWndCtrl);
CResultShow *resultshow_dlg = new CResultShow;
resultshow_dlg->Create(IDD_RESULTSHOW_DIALOG,&m_StackedWndCtrl);
CExceptionDataTest *datatest_dlg = new CExceptionDataTest;
datatest_dlg->Create(IDD_EXCEPTIONDATATEST_DLG,&m_StackedWndCtrl);
m_StackedWndCtrl.AddContentPane(ptempDlg);
m_StackedWndCtrl.AddContentPane(dataconfig_dlg);
m_StackedWndCtrl.AddContentPane(resultshow_dlg);
m_StackedWndCtrl.AddContentPane(datatest_dlg);
//m_StackedWndCtrl.ShowContentPane(1);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
}
void CCBA_SYSTEMDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}
// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.
void CCBA_SYSTEMDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;
// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CPaintDC dc(this);
CBitmap bmp;
bmp.LoadBitmap(IDB_BITMAPBK);
BITMAP bmpInfo;
bmp.GetBitmap(&bmpInfo);
CDC mdc;
mdc.CreateCompatibleDC(&dc);
CBitmap *pOldBmp = mdc.SelectObject(&bmp);
dc.BitBlt(0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,&mdc,0,0,SRCCOPY);
dc.SelectObject(*pOldBmp);
CDialog::OnPaint();
}
}
// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CCBA_SYSTEMDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}
void CCBA_SYSTEMDlg::OnModeConfig()
{
// TODO: Add your control notification handler code here
//GetParent()->SendMessage(WM_MODECONFIG_CLICKED,(WPARAM)this->m_hWnd));
m_StackedWndCtrl.ShowContentPane(0);
m_StackedWndCtrl.HideContentPane(1);
m_StackedWndCtrl.HideContentPane(2);
m_StackedWndCtrl.HideContentPane(3);
}
void CCBA_SYSTEMDlg::OnDataSourceConfig()
{
// TODO: Add your control notification handler code here
//RefreshStaticCtrl(IDC_SWC);
m_StackedWndCtrl.ShowContentPane(1);
m_StackedWndCtrl.HideContentPane(0);
m_StackedWndCtrl.HideContentPane(2);
m_StackedWndCtrl.HideContentPane(3);
//m_StackedWndCtrl.RedrawWindow();
//RefreshStaticCtrl(IDC_SWC);
}
void CCBA_SYSTEMDlg::RefreshStaticCtrl(UINT uCtlID)
{
CStatic *pStatic = (CStatic *)GetDlgItem(uCtlID);
CRect rect;
pStatic->GetWindowRect(&rect);
InvalidateRect(&rect);
//pStatic->SetWindowText();
}
void CCBA_SYSTEMDlg::OnShowResult()
{
m_StackedWndCtrl.ShowContentPane(2);
m_StackedWndCtrl.HideContentPane(0);
m_StackedWndCtrl.HideContentPane(1);
m_StackedWndCtrl.HideContentPane(3);
}
void CCBA_SYSTEMDlg::OnExitSystem()
{
// TODO: Add your control notification handler code here
OnCancel();
}
void CCBA_SYSTEMDlg::OnExceptionDataTest()
{
// TODO: Add your control notification handler code here
m_StackedWndCtrl.ShowContentPane(3);
m_StackedWndCtrl.HideContentPane(0);
m_StackedWndCtrl.HideContentPane(1);
m_StackedWndCtrl.HideContentPane(2);
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -