void YAddingSong::OnClick(TNotifyUI& msg) { CControlUI* pSender = msg.pSender; if (pSender->IsName(_T("closebtn"))) { Close(0); } }
void PropertyWin::OnClick(TNotifyUI& msg) { CControlUI* pUI = msg.pSender; if(!pUI) return ; if (pUI->IsName(_T("close"))) { Close(IDCANCEL); } else if (pUI->IsName(_T("ok"))) { Close(IDOK); } else if (pUI->IsName(_T("file_pos"))) { theMainWin->OnOpenFolderPath(pUI->GetUserData()); } }
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(); } }
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); } }