/*---------------------------------------------------------------------------------------------- Construct the view constructor. Pass the RecordSpec of the view it is for, which allows it to find its block specs. ENHANCE JohnT: This is a rather low level object to know about the application and its list of views. Should we just pass in the list of block specs? ----------------------------------------------------------------------------------------------*/ CleCustDocVc::CleCustDocVc(UserViewSpec * puvs, AfLpInfo * plpi, CleMainWnd * pcmw) : VwCustDocVc(puvs, plpi, 0, kflidCmPossibilityList_Possibilities) { ITsStrFactoryPtr qtsf; qtsf.CreateInstance(CLSID_TsStrFactory); StrUni stu; stu.Load(kstidSpaces0); CheckHr(qtsf->MakeStringRgch(stu.Chars(), stu.Length(), m_qlpi->GetDbInfo()->UserWs(), &m_qtssMissing)); ITsPropsBldrPtr qtpb; qtpb.CreateInstance(CLSID_TsPropsBldr); // Border thickness below about 1/96 inch, a single pixel on a typical display. CheckHr(qtpb->SetIntPropValues(ktptBorderTop, ktpvMilliPoint, kdzmpInch / 96)); // About a line (say 12 point) of white space above and below the border. CheckHr(qtpb->SetIntPropValues(ktptPadTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptMarginTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMain)); CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainLast)); qtpb.CreateInstance(CLSID_TsPropsBldr); CheckHr(qtpb->SetIntPropValues(ktptMarginTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainFirst)); qtpb.CreateInstance(CLSID_TsPropsBldr); // Border thickness below about 1/96 inch, a single pixel on a typical display. CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptMarginBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpMainFlat)); // And make the one for subentries. qtpb.CreateInstance(CLSID_TsPropsBldr); CheckHr(qtpb->SetIntPropValues(ktptPadTop, ktpvMilliPoint, 12000)); CheckHr(qtpb->SetIntPropValues(ktptBorderTop, ktpvMilliPoint, 0)); CheckHr(qtpb->SetIntPropValues(ktptMarginBottom, ktpvMilliPoint, 0)); // The value below is sort of a default for one level of indentation; it will be // adjusted for lower levels. CheckHr(qtpb->SetIntPropValues(ktptPadLeading, ktpvMilliPoint, kdzmpInch * 3 / 10)); CheckHr(qtpb->GetTextProps(&m_qttpSub)); CheckHr(qtpb->SetIntPropValues(ktptBorderBottom, ktpvMilliPoint, kdzmpInch / 96)); CheckHr(qtpb->SetIntPropValues(ktptPadBottom, ktpvMilliPoint, 12000)); CheckHr(qtpb->GetTextProps(&m_qttpSubLast)); m_qRecVc.Attach(NewObj CleRecVc); m_qcmw.Attach(pcmw); AddRefObj(pcmw); PossListInfoPtr qpli; m_qlpi->LoadPossList(pcmw->GetHvoPssl(), pcmw->AnalysisEnc(), &qpli); m_hvoPssl = qpli->GetPsslId(); }
/*---------------------------------------------------------------------------------------------- Complete initialization of the property by storing the appropriate items, names, and lists. @param pssl The id for the People possibility list we are showing in this field. @param hvoOwner The owner of the RnRoledPartic we are displaying in this field. @param flid The flid in hvoOwner owning the RnRoledPartic we are displaying. @param pssRole The id of the CmPossibility from the Role list that we are using to display the label. (May be NULL for the unspecified item). @param fHier True if item names include parent items in the hierarchy. @param pnt Indicates whether we show name, abbr, or both for each item. ----------------------------------------------------------------------------------------------*/ void RnDeFeRoleParts::Init(HVO pssl, HVO hvoOwner, int flid, HVO pssRole, bool fHier, PossNameType pnt) { Assert(m_flid); // Don't call this until Initialize has been called. Assert(pssl); Assert(hvoOwner); Assert(flid); Assert((uint)pnt < (uint)kpntLim); // Save the list id. m_vpssl.Push(pssl); m_fHier = fHier; m_pnt = pnt; m_hvoOwner = hvoOwner; m_flidOwner = flid; m_pssRole = pssRole; // Set the proper m_wsMagic value for the People possibility list. m_wsMagic = kwsVernAnals; // Set up a notifier for the people list. PossListInfoPtr qpli; GetLpInfo()->LoadPossList(pssl, m_wsMagic, &qpli); AssertPtr(qpli); qpli->AddNotify(this); // Set up a notifier for the role list. if (pssRole) { GetLpInfo()->LoadPossListForItem(pssRole, m_wsMagic, &qpli); AssertPtr(qpli); qpli->AddNotify(this); m_psslRole = qpli->GetPsslId(); } // Create the display cache. m_qvcd.CreateInstance(CLSID_VwCacheDa); // Create the view constructor. m_qtgvc.Attach(NewObj TagsVc(m_qfsp->m_stuSty.Chars(), m_chrp.clrBack)); // Set the writing system info (especially for Right-To-Left handling). ILgWritingSystemFactoryPtr qwsf; GetLpInfo()->GetDbInfo()->GetLgWritingSystemFactory(&qwsf); m_qtgvc->SetWritingSystemInfo(m_ws, qwsf); // Add information to the display cache. FillDisplayCache(); }