WER);
pWnd->SetFocus();
SetCapture();
InputEdit().SetWindowText(ShowString0);
InputEdit().ShowWindow(TRUE);
//将鼠标光标变成小手形状
MyCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
::SetCursor(MyCursor);
VERIFY(m_Play.LoadBitmaps("PLAYU","PLAYD","PLAYF","PLAYX"));
m_bPressedPlay = FALSE;
return;
}
if (m_regionPlay.PtInRegion(point)) //鼠标落在位图按钮之上
{
if (m_bPowerOn) { //如果电源已被开启
m_bPlay = TRUE;
pWnd= GetDlgItem(IDC_BUTTON_PLAY);
pWnd->SetFocus();
SetCapture();
InputEdit().SetWindowText(ShowString0);
InputEdit().ShowWindow(TRUE);
MyCursor = AfxGetApp()->LoadCursor(IDC_MYCURSOR);
::SetCursor(MyCursor);
VERIFY(m_Power.LoadBitmaps("POWERONU","POWEROND","POWERONF"));
}
else { //如果电源已被关闭
ReleaseCapture();
InputEdit().SetWindowText(ShowString0+ShowString2);
InputEdit().ShowWindow(TRUE);
VERIFY(m_Power.LoadBitmaps("POWEROFU","POWEROFD","POWEROFF"));
}
m_bPressedPower= FALSE;
return;
}
//鼠标落在所有的位图按钮之外
ReleaseCapture();
InputEdit().SetWindowText(ShowString1);
InputEdit().ShowWindow(TRUE);
pWnd= GetDlgItem(IDOK);
pWnd->SetFocus();
VERIFY(m_Play.LoadBitmaps("PLAYU","PLAYD","PLAYF","PLAYX"));
if (m_bPowerOn)
VERIFY(m_Power.LoadBitmaps("POWERONU","POWEROND","POWERONF"));
else
VERIFY(m_Power.LoadBitmaps("POWEROFU","POWEROFD","POWEROFF"));
m_bPressedPlay = FALSE;
m_bPressedPower= FALSE;
CDialog::OnMouseMove(nFlags, point);
}
void CBmpDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
CWnd *pWnd;
if (m_bPlay && m_bPowerOn) {
// Change Focus so as to Change the bitmap of m_Play
pWnd= GetDlgItem(IDOK);
pWnd->SetFocus();
VERIFY(m_Play.LoadBitmaps("PLAYD"));
m_Play.UpdateWindow();
m_Play.Invalidate(TRUE);
OnButtonPlay();
m_bPressedPlay = TRUE;
}
if (m_bPower== TRUE) {
// Change Focus so as to Change the bitmap of m_Power
pWnd= GetDlgItem(IDOK);
pWnd->SetFocus();
if (m_bPowerOn)
VERIFY(m_Power.LoadBitmaps("POWEROND"));
else
VERIFY(m_Power.LoadBitmaps("POWEROFD"));
m_Power.UpdateWindow();
m_Power.Invalidate(TRUE);
OnButtonPower();
m_bPressedPower = TRUE;
}
CDialog::OnLButtonDown(nFlags, point);
}
void CBmpDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
CWnd * pWnd;
if (m_bPressedPlay == TRUE) {
pWnd= GetDlgItem(IDOK);
pWnd->SetFocus();
VERIFY(m_Play.LoadBitmaps("PLAYF"));
m_Play.UpdateWindow();
m_Play.Invalidate(TRUE);
m_bPressedPlay = FALSE;
}
if (m_bPressedPower == TRUE) {
pWnd= GetDlgItem(IDOK);
pWnd->SetFocus();
if (m_bPowerOn)
VERIFY(m_Power.LoadBitmaps("POWERONF"));
else
VERIFY(m_Power.LoadBitmaps("POWEROFF"));
m_Power.UpdateWindow();
m_Power.Invalidate(TRUE);
m_bPressedPower = FALSE;
}
CDialog::OnLButtonUp(nFlags, point);
}