Ejemplo n.º 1
0
LRESULT CLrcMask::OnNCMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	if (!m_bTrace)
	{
		TRACKMOUSEEVENT tme;
		tme.cbSize = sizeof(tme);
		tme.hwndTrack = this->m_hWnd;
		tme.dwFlags = TME_LEAVE|TME_NONCLIENT;
		tme.dwHoverTime = 10;
		m_bTrace = _TrackMouseEvent(&tme)==0 ? false : true;
	}	
	DuiLib::CDuiRect rect;
	GetWindowRect(&rect);
	DuiLib::CPoint point = DuiLib::CPoint(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
	RECT sizebox;
	sizebox = GetPaintMgr()->GetSizeBox();
	rect.left+= sizebox.left;
	rect.top+=sizebox.top;
	rect.right-=sizebox.right;
	rect.bottom-=sizebox.bottom;
	if (::PtInRect(&rect,point))
	{
		SetCursor(LoadCursor(NULL,MAKEINTRESOURCE(32651)));
	}
	
	m_bMouseOn = true;
//	bHandled = false;
	
	YTrace_(m_bMouseOn?_T("CLrcMask::OnMouseMove:m_bMouseOn=true"):_T("CLrcMask::OnMouseMove:m_bMouseOn=false"));
	return 0;
}
Ejemplo n.º 2
0
void YSongListItemUI::ChangeIcon(int bPlaying /* = em_play */)
{
	static CDuiString sPlayImg = _pItemIco->GetBkImage();
	static CDuiString sPauseImg = _pItemIco->GetUserData();
	if(bPlaying==em_stop)
	{
		_pItemIco->SetVisible(false);
		_pPushLabelIndex->SetVisible(true);
	}
	else if (em_play==bPlaying)
	{
		_pItemIco->SetVisible(true);
		_pItemIco->SetBkImage(sPlayImg);
		_pItemIco->SetUserData(sPauseImg);
		_pPushLabelIndex->SetVisible(false);
	}
	else if(em_pause==bPlaying)
	{
		_pItemIco->SetVisible(true);
		_pItemIco->SetBkImage(sPauseImg);
		_pItemIco->SetUserData(sPlayImg);
		_pPushLabelIndex->SetVisible(false);
	}

	YTrace_(_T("bPlaying=%d\n"),bPlaying);
}
Ejemplo n.º 3
0
 void CLoginWindow::Notify(TNotifyUI& msg)
 {
	 YTrace_(_T("CLoginWindow::Notify class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData());
	 CControlUI* pSender = msg.pSender;

	 if (0 == msg.sType.Compare(kClick))
	 {
		 if (pSender->IsName(_T("close")))
			 Close(0);
		 else if (pSender->IsName(_T("login")))
			 OnLogin();
		 else if (pSender->IsName(_T("sina")))
			 OnSinaLogin();
		 else if (pSender->IsName(_T("QQ")))
			 OnQQLogin();
		 else if (pSender->IsName(_T("ForgetCode")))
			 OnForgetPassword();
		 else if (pSender->IsName(_T("register")))
			 OnReg();
	 }
	 else if(0 == msg.sType.Compare(kReturn))
	 {
		 OnLogin();
	 }
 }
Ejemplo n.º 4
0
void CMediaWin::Notify(TNotifyUI& msg)
{
	YTrace_(_T("class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData());
	if(0 == msg.sType.Compare(kClick))
		return OnClick(msg);
	else if( 0 == msg.sType.Compare(kDBClick))
		FullScreen(! m_bFullScreenMode);
}
Ejemplo n.º 5
0
LRESULT CLrcMask::OnNCMouseLeave(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	m_bTrace = false;
	m_bMouseOn = false;
	YTrace_(m_bMouseOn?_T("CLrcMask::OnMouseLeave:m_bMouseOn=true"):_T("CLrcMask::OnMouseLeave:m_bMouseOn=false"));
	if (m_pDeskLrc&&!m_pDeskLrc->GetMouseLeaveTag())
	{
		m_pDeskLrc->SetBkTag(false|m_pDeskLrc->GetLrcToolBar()->GetMouseLeaveTag());
	}
	SetCursor(LoadCursor(NULL,IDC_ARROW));
//	bHandled = false;
	return 0;
}
Ejemplo n.º 6
0
void YSongListItemUI::DoEvent(TEventUI& event)
{
	YTrace_(_T("doEvent:[type%d][name:%s]\n"),event.Type,event.pSender?event.pSender->GetName().GetData():_T(""));

	if(event.Type==UIEVENT_MOUSELEAVE)
	{
		_pNorButtonMenu->SetVisible(false);
	}
	else 
	{
		_pNorButtonMenu->SetVisible(true);
	}
	__super::DoEvent(event);

}
Ejemplo n.º 7
0
LRESULT CLrcMask::OnMoving(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	YTrace_(_T("CLrcMask::OnMoving"));
	bHandled = FALSE;
	LPRECT pRect = (LPRECT)lParam;
	int nWidth = pRect->right - pRect->left;
	int nHeight = pRect->bottom - pRect->top;
//	m_pDeskLrc->SendMessage(WM_MOVING,0,lParam);
	if(m_pDeskLrc)m_pDeskLrc->SetBkTag(true);
	DuiLib::CDuiRect rc,rcBar,rect;
	SystemParametersInfo(SPI_GETWORKAREA,0,&rect,0);
	GetWindowRect(&rc);
	if(m_pDeskLrc)m_pDeskLrc->GetLrcToolBar()->GetWindowRect(&rcBar);
	int nBarHeight = rcBar.GetHeight();
	int nBarWidth = rcBar.GetWidth();
	if (pRect->left < 0 )
	{
		pRect->left = 0;
		pRect->right = nWidth;
	}
	else if (pRect->left > rect.GetWidth() - nWidth)
	{
		pRect->right = rect.GetWidth();
		pRect->left = rect.GetWidth() - nWidth;
	}

	if (pRect->top < nBarHeight-OVERRECTOFFSET)
	{
		pRect->top = nBarHeight-OVERRECTOFFSET;
		pRect->bottom = pRect->top + nHeight;
	}
	else if (pRect->bottom > rect.GetHeight())
	{
		pRect->bottom =rect.GetHeight();
		pRect->top = pRect->bottom - nHeight;
	}
	if(m_pDeskLrc)m_pDeskLrc->MoveWindow(pRect);
	if(m_pDeskLrc)m_pDeskLrc->GetLrcToolBar()->MoveWindow(pRect->left + (nWidth-nBarWidth)/2,
		pRect->top - nBarHeight+OVERRECTOFFSET,nBarWidth,nBarHeight);
	

	SetCursor(LoadCursor(NULL,MAKEINTRESOURCE(32651)));

	DrawBkMask();
	return 0;
}
Ejemplo n.º 8
0
void YSkinWindow::Notify(TNotifyUI& msg)
{
	CControlUI* pUI = msg.pSender;

	YTrace_(_T("YSkinWindow::Notify class:%s,event:%s,name:%s"),pUI ? pUI->GetClass():_T(""),msg.sType.GetData(),pUI?pUI->GetName().GetData():_T(""));
	if (0 == msg.sType.Compare(kClick))
		OnClick(msg);
	else if(0 == msg.sType.Compare(kSelectChanged))
	{
// 		if (pUI->IsName(_T("tab1")))
// 		{
// 			_pSkinLayout->SelectItem(0);
// 		}
// 		else if (pUI->IsName(_T("tab2")))
// 		{
// 			_pSkinLayout->SelectItem(1);
// 		}
		_pSkinLayout->SelectItem(msg.pSender->GetTag());
	}
}
Ejemplo n.º 9
0
void CShareWin::Notify(TNotifyUI& msg)
{
	YTrace_(_T("class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData());
	if(0 == msg.sType.Compare(kClick))
		return OnClick(msg);
}
Ejemplo n.º 10
0
void CSettingWindow::Notify(TNotifyUI& msg)
{
	YTrace_(_T("class:%s,id:%s,msg:%s"),msg.pSender->GetClass(),msg.pSender->GetName().GetData(),msg.sType.GetData());
	CControlUI* pSender = msg.pSender;
	if(0 == msg.sType.Compare(kSelectChanged))
	{
		if(pSender == ui.ConfigAbout_Option)
			ui.PanelItemTab_TabLayout->SelectItem(AboutPage);
		else if (pSender == ui.ConfigNormal_Option)
			ui.PanelItemTab_TabLayout->SelectItem(NormalPage);
		else if(pSender == ui.ConfigLrcPanel_Option)
			ui.PanelItemTab_TabLayout->SelectItem(LrcPanelPage);
		else if(pSender == ui.ConfigLrcDesk_Option)
			ui.PanelItemTab_TabLayout->SelectItem(LrcDeskPage);
		else if (pSender == ui.ConfigCache_Option)
			ui.PanelItemTab_TabLayout->SelectItem(CachePage);
		else if (pSender == ui.ConfigHotKey_Option)
			ui.PanelItemTab_TabLayout->SelectItem(HotKeyPage);
		else if (pSender == ui.ConfigUpdate_Option)
			ui.PanelItemTab_TabLayout->SelectItem(UpdataPage);
		else if ((pSender == ui.MinTrayIcon_Option)
			|| (pSender == ui.Exit_Option)
			)
		{
			setModify(true);
		}		
	}
	else if (0 == msg.sType.Compare(kItemSelect))
	{
		CLrcPreViewUI* pLrcPreView = static_cast<CLrcPreViewUI*>(GetPaintMgr()->FindControl(_T("lrcPreView")));
		ASSERT(pLrcPreView);
		CConfigMgr::spLrcConfigT pLrcCfg = theConfigMgr->GetLrcConfig();
		if(msg.pSender->IsName(_T("font_name2")))
		{
			pLrcPreView->m_iFontSize = pLrcCfg->GetLrcDeskFontSize();
			pLrcPreView->m_iFontStyle = pLrcCfg->GetLrcDeskFontStyle();
			pLrcPreView->m_sFontName = ui.LrcDeskFontName->GetText();
			pLrcPreView->m_dwFontColor = pLrcCfg->GetLrcDeskUnPlayedColor();
		}
		else if (msg.pSender->IsName(_T("font_style2")))
		{
			pLrcPreView->m_iFontSize = pLrcCfg->GetLrcDeskFontSize();
			pLrcPreView->m_iFontStyle = ui.LrcDeskFontStyle->GetCurSel();
			pLrcPreView->m_sFontName = pLrcCfg->GetLrcDeskFontName();
			pLrcPreView->m_dwFontColor = pLrcCfg->GetLrcDeskUnPlayedColor();
		}
		else if (msg.pSender->IsName(_T("font_size2")))
		{
			pLrcPreView->m_iFontSize = mci::ToUInt(ui.LrcDeskFontSize->GetText());
			pLrcPreView->m_iFontStyle = pLrcCfg->GetLrcDeskFontStyle();
			pLrcPreView->m_sFontName = ui.LrcDeskFontName->GetText();
			pLrcPreView->m_dwFontColor = pLrcCfg->GetLrcDeskUnPlayedColor();
		}
		
		pLrcPreView->Invalidate();
//		setModify(true);
	}
	else if(0 == msg.sType.Compare(kClick))
	{
		if ((pSender == ui.Close_Btn)
			|| (pSender == ui.Cancle_Btn)
			)
			cancle();
		else if (pSender == ui.Ok_Btn)
			ok();
		else if (pSender == ui.Apply_Btn)
			apply();
		else if ((pSender == ui.AutoLogin_CheckBox)
			|| (pSender == ui.AutoPlay_CheckBox)
			|| (pSender == ui.AutoRun_CheckBox)
			|| (pSender == ui.AutoOpenLRC_CheckBox)
			|| (pSender == ui.PlayRoaming_CheckBox)
			|| (pSender == ui.RelateFile_CheckBox)
			|| (pSender == ui.AutoUpdate_CheckBox)
			|| (pSender == ui.LrcDeskKaraok)
			)
		{
			setModify(true);
		}
		else if (pSender == ui.CheckUpdate_Btn)
		{
			//TODO:
		}
		else if (pSender == ui.ChangeDir_Btn)
		{
			CString sSelectedDir;
		/*	CFolderDialog fldDlg (GetHWND(), _T("选择目录"),
				BIF_RETURNONLYFSDIRS|BIF_NEWDIALOGSTYLE );

			if ( IDOK == fldDlg.DoModal())
			{
				sSelectedDir = fldDlg.m_szFolderPath;
				if (sSelectedDir.GetLength()!=0)
				{
					ui.CacheDir_Edit->SetText(sSelectedDir);
					setModify(true);
				}				
			}*/
		}
		else if (pSender == ui.OpenDir_Btn)
		{
			LPCTSTR path = ui.CacheDir_Edit->GetText().GetData();
			ShellExecute(GetHWND(),_T("open"),path,NULL,NULL,SW_SHOWNORMAL);
		}
		else if (pSender == ui.ClearCache_Btn)
		{
			theCacheMgr->ClearAllCatch();
			CString str;
			str.Format(_T("已缓存%dM"), theCacheMgr->GetAllCatchSize()/1024/1024);
			ui.CachedLabel->SetText(str);
		}
		else if ((pSender == ui.ColorPicker_Btn1)
			||(pSender == ui.ColorPicker_Btn2)
			||(pSender == ui.ColorPicker_Btn3)
			||(pSender == ui.ColorPicker_Btn4)
			||(pSender == ui.ColorPicker_Btn5)
			)
		{
			colorBox(pSender);
		}
	}
	else if(0 == msg.sType.Compare(kTextChanged))
	{
		if ((pSender == ui.CacheDir_Edit)
			|| (pSender == ui.MaxCache_Edit)
			|| pSender->IsName(_T("HK_Mode"))
			|| pSender->IsName(_T("HK_Lrc"))
			|| pSender->IsName(_T("HK_PlayPause"))
			|| pSender->IsName(_T("HK_PreSong"))
			|| pSender->IsName(_T("HK_NextSong"))
			|| pSender->IsName(_T("HK_VolUp"))
			|| pSender->IsName(_T("HK_VolDown"))
			)
		{
			setModify(true);
		}
	}
	else if(0 == msg.sType.Compare(kWindowInit))
	{
		CString str;
		str.Format(_T("已缓存%dM"), theCacheMgr->GetAllCatchSize()/1024/1024);
		ui.CachedLabel->SetText(str);
	}
}