📄 orientstockdlg.cpp
字号:
// OrientStockDlg.cpp : implementation file
//
#include "stdafx.h"
#include "OrientStock.h"
#include "OrientStockDlg.h"
#include "QuitDlg.h"
#include "Login.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COrientStockDlg dialog
COrientStockDlg::COrientStockDlg(CWnd* pParent /*=NULL*/)
: CDialog(COrientStockDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(COrientStockDlg)
// 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 COrientStockDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(COrientStockDlg)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
DDX_Control(pDX, IDC_LOGIN, m_btnDengLu);
DDX_Control(pDX, IDC_COMPANY_INFO, m_btnBankInfo);
DDX_Control(pDX, IDC_SYS_CONFIG, m_btnSysConfig);
DDX_Control(pDX, IDC_HELPINFO, m_btnHelpInfo);
DDX_Control(pDX, IDC_QUIT, m_btnQuit);
}
BEGIN_MESSAGE_MAP(COrientStockDlg, CDialog)
//{{AFX_MSG_MAP(COrientStockDlg)
ON_BN_CLICKED(IDC_LOGIN, OnLogin)
ON_BN_CLICKED(IDC_COMPANY_INFO, OnCompanyInfo)
ON_BN_CLICKED(IDC_SYS_CONFIG, OnSysConfig)
ON_BN_CLICKED(IDC_HELP, OnHelp)
ON_BN_CLICKED(IDC_QUIT, OnQuit)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COrientStockDlg message handlers
BOOL COrientStockDlg::OnInitDialog()
{
CDialog::OnInitDialog();
AfxGetMainWnd()->SetWindowText(_T(" 东方证券贴身理财"));
::SetForegroundWindow(AfxGetMainWnd()->m_hWnd);
// 对话框全屏显示
SHFullScreen(AfxGetMainWnd()->m_hWnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON | SHFS_HIDESTARTICON);
// 使用如下语句把对话框右上角的 OK 按钮去掉.
ModifyStyle(AfxGetMainWnd()->m_hWnd, WS_CAPTION, WS_MINIMIZEBOX, SWP_NOSIZE);
SHDoneButton(AfxGetMainWnd()->m_hWnd, SHDB_HIDE);
// These lines is added to set characteristic style bunton
COLORREF crBtnColor;
// Calculate a color effect for hilighting the button
crBtnColor = RGB(0,0,255);//::GetSysColor(COLOR_BTNFACE) + RGB(30, 30, 30);
// Login icon button
m_btnDengLu.SetFont(GetFont());
m_btnDengLu.SetIcon(IDI_LOGIN, CSize(48, 48));
m_btnDengLu.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
m_btnDengLu.SetAlign(CCeButtonST::ST_ALIGN_VERT);
// CompanyInfo icon button
m_btnBankInfo.SetFont(GetFont());
m_btnBankInfo.SetIcon(IDI_COMPANY_INFO, CSize(48, 48));
m_btnBankInfo.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
m_btnBankInfo.SetAlign(CCeButtonST::ST_ALIGN_VERT);
// SysConfig icon button
m_btnSysConfig.SetFont(GetFont());
m_btnSysConfig.SetIcon(IDI_SYS_CONFIG, CSize(48, 48));
m_btnSysConfig.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
m_btnSysConfig.SetAlign(CCeButtonST::ST_ALIGN_VERT);
// HelpInfo icon button
m_btnHelpInfo.SetFont(GetFont());
m_btnHelpInfo.SetIcon(IDI_HELP, CSize(48, 48));
m_btnHelpInfo.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
m_btnHelpInfo.SetAlign(CCeButtonST::ST_ALIGN_VERT);
// Quit icon button
m_btnQuit.SetFont(GetFont());
m_btnQuit.SetIcon(IDI_QUIT, CSize(48, 48));
m_btnQuit.SetColor(CCeButtonST::BTNST_COLOR_BK_IN, crBtnColor);
m_btnQuit.SetAlign(CCeButtonST::ST_ALIGN_VERT);
// 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
CenterWindow(GetDesktopWindow()); // center to the hpc screen
return TRUE; // return TRUE unless you set the focus to a control
}
void COrientStockDlg::OnLogin()
{
// 播放声音
if( ! sndPlaySound(_T("\\orient.wav"),SND_ASYNC) == TRUE )
MessageBox( _T("Sound open error!"),_T("PlaySound"),MB_OK);
CLogin dlg_Login;
if( !dlg_Login.DoModal() == IDOK )
{
AfxGetMainWnd()->SetWindowText(_T(" 东方证券贴身理财"));
::SetForegroundWindow(AfxGetMainWnd()->m_hWnd);
}
}
void COrientStockDlg::OnCompanyInfo()
{
// TODO: Add your control notification handler code here
}
void COrientStockDlg::OnSysConfig()
{
// TODO: Add your control notification handler code here
}
void COrientStockDlg::OnHelp()
{
// TODO: Add your control notification handler code here
}
// 退出应用程序
void COrientStockDlg::OnQuit()
{
// Play sound when BtnQuit clicked
if( !PlaySound( _T("\\quit.wav"), NULL, SND_FILENAME ) == TRUE )
MessageBox( _T("Sound open error!"),_T("PlaySound"),MB_OK);
CQuitDlg dlg;
if(dlg.DoModal() == IDOK)
{
CDialog::OnOK();
}
else
{
AfxGetMainWnd()->SetWindowText(_T(" 东方证券贴身理财"));
::SetForegroundWindow(AfxGetMainWnd()->m_hWnd);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -