NSDUILIB_API void SetControlData(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra) { TCHAR controlName[MAX_PATH]; TCHAR controlData[MAX_PATH]; TCHAR dataType[MAX_PATH]; EXDLL_INIT(); ZeroMemory(controlName, MAX_PATH*sizeof(TCHAR)); ZeroMemory(controlData, MAX_PATH*sizeof(TCHAR)); ZeroMemory(dataType, MAX_PATH*sizeof(TCHAR)); popstring( controlName,sizeof(controlName)); popstring( controlData,sizeof(controlData)); popstring( dataType,sizeof(dataType)); CControlUI* pControl = static_cast<CControlUI*>(g_pFrame->GetPaintManager().FindControl( controlName )); if( pControl == NULL ) return; if( _tcsicmp( dataType, _T("text") ) == 0 ) { if( _tcsicmp( controlData, _T("error")) == 0 || _tcsicmp( controlData, _T("")) == 0 ) pControl->SetText( pControl->GetText() ); else pControl->SetText( controlData ); } else if( _tcsicmp( dataType, _T("bkimage") ) == 0 ) { if( _tcsicmp( controlData, _T("error")) == 0 || _tcsicmp( controlData, _T("")) == 0 ) pControl->SetBkImage( pControl->GetBkImage()); else pControl->SetBkImage( controlData ); } else if( _tcsicmp( dataType, _T("link") ) == 0 ) { g_controlLinkInfoMap[controlName] = controlData; } else if( _tcsicmp( dataType, _T("enable") ) == 0 ) { if( _tcsicmp( controlData, _T("true")) == 0 ) pControl->SetEnabled( true ); else if( _tcsicmp( controlData, _T("false")) == 0 ) pControl->SetEnabled( false ); } else if( _tcsicmp( dataType, _T("visible") ) == 0 ) { if( _tcsicmp( controlData, _T("true")) == 0 ) pControl->SetVisible( true ); else if( _tcsicmp( controlData, _T("false")) == 0 ) pControl->SetVisible( false ); } }
void CDuiFrameWnd::ShowPlayWnd( bool bShow ) { CControlUI *pbtnWnd = m_PaintManager.FindControl(_T("wndMedia")); CControlUI *pbtnStop = m_PaintManager.FindControl(_T("btnStop")); CControlUI *pbtnScreen = m_PaintManager.FindControl(_T("btnScreenFull")); CControlUI *pctnURL = m_PaintManager.FindControl(_T("ctnURL")); CControlUI *pctnClient = m_PaintManager.FindControl(_T("ctnClient")); CControlUI *pctnMusic = m_PaintManager.FindControl(_T("ctnMusic")); CControlUI *pctnSlider = m_PaintManager.FindControl(_T("ctnSlider")); if (pbtnWnd && pbtnStop && pbtnScreen && pctnURL && pctnClient && pctnMusic && pctnSlider) { pbtnStop->SetEnabled(bShow); pbtnScreen->SetEnabled(bShow); pctnURL->SetVisible(! bShow); pctnClient->SetVisible(! bShow); pctnSlider->SetVisible(bShow); // 打开文件时 if (bShow) { if (IsMusicFile(m_strPath)) { pbtnWnd->SetVisible(! bShow); pctnMusic->SetVisible(bShow); } else { pbtnWnd->SetVisible(bShow); pctnMusic->SetVisible(! bShow); } } // 关闭文件时 else { pctnMusic->SetVisible(false); pbtnWnd->SetVisible(false); } } }