void CCellView::OnDraw(CDC* pDC) { CTreeCtrl &Tree=CConfigTool::GetControlView()->GetTreeCtrl(); CConfigToolDoc* pDoc=CConfigTool::GetConfigToolDoc(); if(pDoc->ItemCount()>0) { CRect rect; Tree.GetItemRect(Tree.GetRootItem(),rect,TRUE); m_nFirstVisibleItem=rect.top; CRect rcClient; GetClientRect(rcClient); CPen *pOldPen=pDC->SelectObject(&m_GrayPen); CFont *pOldFont=pDC->SelectObject(CConfigTool::GetControlView()->GetFont()); pDC->SetBkMode(TRANSPARENT); CRect rcClip; pDC->GetClipBox(rcClip); CPtrArray arItems; int dy=CConfigTool::GetControlView()->GetItemHeight(); int cy=0; for(HTREEITEM h=Tree.GetFirstVisibleItem();h;h=Tree.GetNextVisibleItem(h)) { if(cy>rcClip.bottom){ break; } CRect rcEdit(0,cy,rcClient.right,cy+dy); cy+=dy; pDC->MoveTo(rcClient.left,rcEdit.top); pDC->LineTo(rcClient.right,rcEdit.top); CConfigItem &ti=TI(h); if(h!=m_hInCell){ switch(ti.Type()){ case CConfigItem::Enum: // Using combobox rcEdit.left+=2; rcEdit.top+=2; // fall through case CConfigItem::Integer: case CConfigItem::Double: case CConfigItem::String: // Using editbox rcEdit.top+=2; rcEdit.left+=3; { CString str(ti.StringValue()); // cell contents is greyed if the option is not both active and modifiable // or if a booldata item is not enabled const CdlValuable valuable = ti.GetCdlValuable(); // check for a package explicitly because is_modifiable() returns true for a package pDC->SetTextColor (GetSysColor ((! valuable) || (valuable->is_modifiable () && valuable->is_active () && ((! ti.HasBool ()) || ti.IsEnabled ()) && ! ti.IsPackage ()) ? COLOR_WINDOWTEXT : COLOR_GRAYTEXT)); pDC->TextOut(rcEdit.left,rcEdit.top,str); } break; default: break; } } } pDC->MoveTo(rcClient.left,cy); pDC->LineTo(rcClient.right,cy); pDC->SelectObject(pOldPen); pDC->SelectObject(pOldFont); } }
LRESULT CDlgMain::OnAwProcessAttached( WPARAM,LPARAM ) { Sleep(100); ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached begin >>>>>>>>>>> %s", "\r\n" ); if ( m_pWeb == NULL ) { ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached %s", "异常,m_pWeb为空\r\n" ); return 0; } if ( !::IsWindow( m_pWeb->GetSafeHwnd() ) ) { ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached %s", "异常,m_pWeb不是窗口\r\n" ); return 0; } //if ( theApp.m_pStartEvent->GetExData() == NULL ) //{ // ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached %s", "异常,theApp.m_pStartEvent->m_pData为空\r\n" ); // return 0; //} if ( g_aw.m_sExData.IsEmpty() ) { ZTools::WriteZToolsLog( "CDlgMain::OnAwProcessAttached g_aw.m_sExData 为空" ); return 0; } CRect rcEdit(0,0,1,1); g_pDummyInput = new CEdit(); g_pDummyInput->Create(WS_CHILD|WS_VISIBLE, rcEdit, this, 39999); g_pDummyInput->SetFocus(); CString strUrl; //switch ( theApp.m_pStartEvent->GetModuleFlag() ) //{ //case CPeraWebPageMgr::FW_RUNFLOW: // strUrl = ((CWPERunFlowStart*)theApp.m_pStartEvent->GetExData())->m_strUrl; // break; //case CPeraWebPageMgr::FW_VIEW_RUNFLOW: // strUrl = ((CCxWPENavigate*)theApp.m_pStartEvent->GetExData())->m_strUrl; // break; //case CPeraWebPageMgr::FW_TAB_VIEW: // strUrl = ((CCxWPENavigate*)theApp.m_pStartEvent->GetExData())->m_strUrl; // break; //default: // break; //} CAttachWindowExData exData; if ( exData.Parse( g_aw.m_sExData ) ) { strUrl = exData.m_sUrl; } else { ZTools::WriteZToolsLog( "CDlgMain::OnAwProcessAttached CAttachWindowExData 解析失败" ); } ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached m_pWeb->Navigate Url: %s\r\n", strUrl ); m_pWeb->Navigate( (LPCTSTR)strUrl ); ZTools::WriteZToolsFormatLog( "CDlgMain::OnAwProcessAttached end <<<<<<<<<<<<<<: %s\r\n", "\r\n" ); return 0; }
/*---------------------------------------------------------------------------------------------- Something has changed in the possibility list. ----------------------------------------------------------------------------------------------*/ void RnDeFeRoleParts::ListChanged(int nAction, HVO hvoPssl, HVO hvoSrc, HVO hvoDst, int ipssSrc, int ipssDst) { if (hvoPssl != m_psslRole) { // Process changes for people lists. SuperClass::ListChanged(nAction, hvoPssl, hvoSrc, hvoDst, ipssSrc, ipssDst); return; } // If someone deleted the role we are interested in we need to clean up. if (hvoSrc == m_pssRole && nAction == kplnaDelete) { // Remove the notifier for the role list. Assert(m_psslRole); PossListInfoPtr qpli; GetLpInfo()->LoadPossList(m_psslRole, m_wsMagic, &qpli); AssertPtr(qpli); qpli->RemoveNotify(this); m_psslRole = 0; m_pssRole = 0; } // At this point we are not getting kplnaMerged at all since we are just deleting all // fields and recreating new ones. But at some point down the road we may want to switch // to where we don't delete and recreate. This would be the right action to take then. if (hvoSrc == m_pssRole && nAction == kplnaMerged) { // Switch to the new role. m_pssRole = hvoDst; } // Now reset the label in case we changed. // Use Participants for the unspecified editor label. ITsStringPtr qtssName; int wsUser = GetLpInfo()->GetDbInfo()->UserWs(); AfUtil::GetResourceTss(kstidTlsOptParticipants, wsUser, &qtssName); ITsStringPtr qtssHelp = m_qfsp->m_qtssHelp; ITsStrFactoryPtr qtsf; qtsf.CreateInstance(CLSID_TsStrFactory); if (m_pssRole) { PossItemInfo * ppii; GetLpInfo()->GetPossListAndItem(m_pssRole, wsUser, &ppii, NULL); StrUni stuName; // the Role's name ppii->GetName(stuName, m_pnt); qtsf->MakeStringRgch(stuName.Chars(), stuName.Length(), wsUser, &qtssName); ITsIncStrBldrPtr qtisb; qtisb.CreateInstance(CLSID_TsIncStrBldr); // Add the first substring. qtisb->AppendTsString(m_qfsp->m_qtssHelp); // Add the second substring. StrUni stuTemp; stuTemp.Load(kstidRnRoledPartic_HelpA); qtisb->AppendRgch(stuTemp.Chars(), stuTemp.Length()); // Turn bold on. qtisb->SetIntPropValues(ktptBold, ktpvEnum, kttvForceOn); // Add the Role's name qtisb->AppendRgch(stuName.Chars(), stuName.Length()); // Turn bold off. qtisb->SetIntPropValues(ktptBold, ktpvEnum, kttvOff); // Add the third substring. stuTemp.Load(kstidRnRoledPartic_HelpB); qtisb->AppendRgch(stuTemp.Chars(), stuTemp.Length()); // Get the completed TsString. qtisb->GetString(&qtssHelp); } m_qtssLabel = qtssName; m_qtssHelp = qtssHelp; // Force the label to redraw. Rect rcLabel; ::GetClientRect(m_qadsc->Hwnd(),&rcLabel); Rect rcEdit(m_rcClip); if (m_hwnd) { // We have an open edit box, so get the correct coordinates for the client window. ::GetClientRect(m_hwnd, &rcEdit); ::MapWindowPoints(m_hwnd, m_qadsc->Hwnd(), (POINT *)&rcEdit, 2); } rcLabel.top = rcEdit.top; rcLabel.bottom = rcEdit.bottom; rcLabel.right = m_qadsc->GetTreeWidth(); ::InvalidateRect(m_qadsc->Hwnd(), &rcLabel, false); }