📄 onfig_dialog.cpp
字号:
// onfig_Dialog.cpp : implementation file
//
#include "stdafx.h"
#include "BlueSky.h"
#include "onfig_Dialog.h"
#include "SetPanel.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// Config_Dialog dialog
Config_Dialog::Config_Dialog(CWnd* pParent /*=NULL*/)
: CDialog(Config_Dialog::IDD, pParent)
{
//{{AFX_DATA_INIT(Config_Dialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void Config_Dialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(Config_Dialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(Config_Dialog, CDialog)
//{{AFX_MSG_MAP(Config_Dialog)
ON_WM_PAINT()
ON_WM_LBUTTONDBLCLK()
ON_WM_CTLCOLOR()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// Config_Dialog message handlers
BOOL Config_Dialog::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
brush.CreateSolidBrush(RGB(0,120,220));
SetWindowPos(&CWnd::wndNoTopMost,0,0,1024,768,0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void Config_Dialog::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: Add your message handler code here
CPen pen(PS_INSIDEFRAME,5,RGB(200,180,0));
CFont font,*pOldFont,font2;
font.CreatePointFont(300,_T("楷体_GB2312"));
pOldFont = dc.SelectObject(&font);
CString s = _T("设 置");
dc.SetBkMode(TRANSPARENT);
dc.SetTextColor(RGB(0,220,0));
dc.TextOut(435,100,s,s.GetLength());
CPen *pOldPen = dc.SelectObject(&pen);
dc.SelectStockObject(NULL_BRUSH);
CBrush brush(RGB(220,230,220));
CBrush *pOldBrush = dc.SelectObject(&brush);
dc.Rectangle(412,300,612,610);
CPen pen2(PS_SOLID,1,RGB(200,180,0));
dc.SelectObject(&pen2);
for(int i=0; i<5; i++)
{
dc.MoveTo(412,355+50*i);
dc.LineTo(612,355+50*i);
}
font2.CreatePointFont(160,_T("楷体_GB2312"));
dc.SetTextColor(RGB(255,0,0));
dc.SelectObject(&font2);
dc.TextOut(470,320,_T("语音类型"));
dc.TextOut(470,370,_T("音量设置"));
dc.TextOut(470,420,_T("音速设置"));
dc.TextOut(470,470,_T("字母发声设置"));
dc.TextOut(470,520,_T("数字发生设置"));
dc.TextOut(470,570,_T("返 回"));
dc.SelectObject(pOldBrush);
dc.SelectObject(pOldPen);
dc.SelectObject(pOldFont);
// Do not call CDialog::OnPaint() for painting messages
}
void Config_Dialog::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (point.y<355) //语音设置
{
SetPanel *Dlg = new SetPanel( this );
Dlg->SetType=1;
if( Dlg->DoModal() == IDOK )
delete Dlg;
}
if (point.y>355 && point.y<405) //音速设置
{
SetPanel *Dlg = new SetPanel( this );
Dlg->SetType=2;
if( Dlg->DoModal() == IDOK )
delete Dlg;
}
if (point.y>405 && point.y<455) //音量设置
{
SetPanel *Dlg = new SetPanel( this );
Dlg->SetType=3;
if( Dlg->DoModal() == IDOK )
delete Dlg;
}
if (point.y>455 && point.y<505) //字母发声设置
{
SetPanel *Dlg = new SetPanel( this );
Dlg->SetType=4;
if( Dlg->DoModal() == IDOK )
delete Dlg;
}
if (point.y>505 && point.y<555) //数字发生设置
{
SetPanel *Dlg = new SetPanel( this );
Dlg->SetType=5;
if( Dlg->DoModal() == IDOK )
delete Dlg;
}
if (point.y>555 && point.y<605)
{
CDialog::OnCancel();
}
if (point.y>=610)
{
}
CDialog::OnLButtonDblClk(nFlags, point);
}
HBRUSH Config_Dialog::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
// TODO: Change any attributes of the DC here
if (pWnd->m_hWnd == m_hWnd)
return brush;
return hbr;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -