| | |
| | | if (RX_CODE_SELECT_PLC == code) { |
| | | CPLC* pPlc; |
| | | if (pAny->getPtrValue("ptr", (void*&)pPlc)) { |
| | | ASSERT(m_pMainContainer != nullptr); |
| | | if (m_pActiveView == nullptr) { |
| | | m_pActiveView = (CPlcView*)CreatePlcView(pPlc); |
| | | } |
| | | ASSERT(m_pActiveView); |
| | | if (m_pActiveView->GetContext() != (void*)pPlc) { |
| | | m_pActiveView->SetWindowText(pPlc->getName().c_str()); |
| | | m_pActiveView->SetContext(pPlc); |
| | | m_pActiveView->SendMessage(WM_NCPAINT, 0, 0); |
| | | if (pPlc != nullptr) { |
| | | ASSERT(m_pMainContainer != nullptr); |
| | | if (m_pActiveView == nullptr) { |
| | | m_pActiveView = (CPlcView*)CreatePlcView(pPlc); |
| | | } |
| | | ASSERT(m_pActiveView); |
| | | if (m_pActiveView->GetContext() != (void*)pPlc) { |
| | | m_pActiveView->SetWindowText(pPlc->getName().c_str()); |
| | | m_pActiveView->SetContext(pPlc); |
| | | m_pActiveView->SendMessage(WM_NCPAINT, 0, 0); |
| | | } |
| | | } else { |
| | | CloseView(m_pActiveView); |
| | | } |
| | | |
| | | theApp.m_model.setCurrentPlc(pPlc); |