/// <summary> /// Gets the font height of the specified writing system for the normal style. /// </summary> /// <param name="ws">The ws.</param> /// <returns></returns> int GetFontHeight(int ws) { IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(m_mediator); return(FontHeightAdjuster.GetFontHeightForStyle("Normal", stylesheet, ws, m_cache.LanguageWritingSystemFactoryAccessor)); }
/// <summary> /// Gets the font height of the specified writing system for the normal style. /// </summary> protected int GetFontHeight(int ws) { IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromPropertyTable(m_propertyTable); return(FontHeightAdjuster.GetFontHeightForStyle("Normal", stylesheet, ws, m_cache.LanguageWritingSystemFactoryAccessor)); }
/// <summary> /// Override method to add suitable control. /// </summary> public override void FinishInit() { CheckDisposed(); Debug.Assert(m_cache != null); base.FinishInit(); //We need to set the Font so the height of this slice will be //set appropriately to fit the text. IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromPropertyTable(m_propertyTable); int fontHeight = FontHeightAdjuster.GetFontHeightForStyle( "Normal", stylesheet, m_cache.DefaultVernWs, m_cache.LanguageWritingSystemFactoryAccessor); Font = new Font(m_cache.ServiceLocator.WritingSystems.DefaultVernacularWritingSystem.DefaultFontName, fontHeight / 1000f); }
/// <summary> /// Override method to add suitable control. /// </summary> public override void FinishInit() { CheckDisposed(); Debug.Assert(m_cache != null); Debug.Assert(m_configurationNode != null); base.FinishInit(); m_fieldName = XmlUtils.GetManditoryAttributeValue(m_configurationNode, "field"); string className = m_cache.MetaDataCacheAccessor.GetClassName((uint)m_obj.ClassID); m_flid = AutoDataTreeMenuHandler.ContextMenuHelper.GetFlid(m_cache.MetaDataCacheAccessor, className, m_fieldName); AdhocCoProhibAtomicLauncher launcher = new AdhocCoProhibAtomicLauncher(); launcher.Initialize(m_cache, m_obj, m_flid, m_fieldName, null, Mediator, DisplayNameProperty, BestWsName); // We don't want to be visible until later, since otherwise we get a temporary // display in the wrong place with the wrong size that serves only to annoy the // user. See LT-1518 "The drawing of the DataTree for Lexicon/Advanced Edit draws // some initial invalid controls." Becoming visible when we set the width and // height seems to delay things enough to avoid this visual clutter. launcher.Visible = false; Control = launcher; //We need to set the Font so the height of this slice will be //set appropriately to fit the text. IVwStylesheet stylesheet = FontHeightAdjuster.StyleSheetFromMediator(Mediator); int fontHeight = FontHeightAdjuster.GetFontHeightForStyle( "Normal", stylesheet, m_cache.LangProject.DefaultVernacularWritingSystem, m_cache.LanguageWritingSystemFactoryAccessor); this.Font = new System.Drawing.Font(m_cache.LangProject.DefaultVernacularWritingSystemFont, fontHeight / 1000); }