📄 setpanel.cpp
字号:
// SetPanel.cpp : implementation file
//
#include "stdafx.h"
#include "BlueSky.h"
#include "SetPanel.h"
#include "eci.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SetPanel dialog
SetPanel::SetPanel(CWnd* pParent /*=NULL*/)
: CDialog(SetPanel::IDD, pParent)
{
//{{AFX_DATA_INIT(SetPanel)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void SetPanel::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SetPanel)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SetPanel, CDialog)
//{{AFX_MSG_MAP(SetPanel)
ON_WM_CTLCOLOR()
ON_WM_PAINT()
ON_WM_LBUTTONDBLCLK()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SetPanel message handlers
BOOL SetPanel::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
brush.CreateSolidBrush(RGB(0,120,220));
SetWindowPos(&CWnd::wndNoTopMost,0,0,1024,768,0);
LONG i = (::RegOpenKeyEx(HKEY_LOCAL_MACHINE, "software\\亿时代数码科技有限公司\\蓝天语音软件"
, NULL, KEY_SET_VALUE, &hEsdKey));
if(i != ERROR_SUCCESS)
{
MessageBox("错误", " 无法查询有关注册表信息!", MB_OK);
return FALSE;
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
HBRUSH SetPanel::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;
// TODO: Return a different brush if the default is not desired
return hbr;
}
void SetPanel::OnPaint()
{
CPaintDC dc(this); // device context for painting
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,335,612,645);
CPen pen2(PS_SOLID,1,RGB(200,180,0));
dc.SelectObject(&pen2);
for(int i=0; i<5; i++)
{
dc.MoveTo(412,390+50*i);
dc.LineTo(612,390+50*i);
}
font2.CreatePointFont(160,_T("楷体_GB2312"));
dc.SetTextColor(RGB(255,0,0));
dc.SelectObject(&font2);
CString s1,s2,s3,s4,s5,s6;
switch(SetType)
{
case 1: s1=_T("儿童男声");
s2=_T("儿童女声");
s3=_T("成年男声");
s4=_T("成年女声");
s5=_T("老年男声");
s6=_T("老年女声");
break;
case 2: s1=_T("增大音量");
s2=_T("减小音量");
s3=_T(" ");
s4=_T(" ");
s5=_T(" ");
s6=_T(" ");
break;
case 3: s1=_T("提高语速");
s2=_T("降低语速");
s3=_T(" ");
s4=_T(" ");
s5=_T(" ");
s6=_T(" ");
break;
case 4: s1=_T("连 续");
s2=_T("不 连 续");
s3=_T(" ");
s4=_T(" ");
s5=_T(" ");
s6=_T(" ");
break;
case 5: s1=_T("连 续");
s2=_T("不 连 续");
s3=_T(" ");
s4=_T(" ");
s5=_T(" ");
s6=_T(" ");
break;
}
dc.TextOut(470,355,s1);
dc.TextOut(470,405,s2);
dc.TextOut(470,455,s3);
dc.TextOut(470,505,s4);
dc.TextOut(470,555,s5);
dc.TextOut(470,605,s6);
dc.SelectObject(pOldBrush);
dc.SelectObject(pOldPen);
dc.SelectObject(pOldFont);
// Do not call CDialog::OnPaint() for painting messages
}
void SetPanel::OnLButtonDblClk(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if (point.y<355)
{
switch(SetType)
{
case 1:
Speaker=1;
::RegSetValueEx(hEsdKey, "男女声发音设置", NULL, REG_DWORD,
(CONST BYTE *)&Speaker, 4);
break;
case 2: ;
}
}
if (point.y>355 && point.y<405)
{
}
if (point.y>405 && point.y<455)
{
}
if (point.y>455 && point.y<505)
{
}
if (point.y>505 && point.y<555)
{
}
if (point.y>555 && point.y<605)
{
}
if (point.y>=610)
{
}
CDialog::OnOK();
CDialog::OnLButtonDblClk(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -