Exemplo n.º 1
0
        void DisplayIterCtxt(IPhIterationContext iterCtxt, int numLines, IVwEnv vwenv)
        {
            int superOffset = 0;

            if (numLines == 1)
            {
                // if the inner context is a single line, then make the min value a subscript and the max value a superscript.
                // I tried to use the Views subscript and superscript properties, but they added extra space so that it would
                // have the same line height of a normal character, which is not what I wanted, so I compute the size myself
                int fontHeight     = GetFontHeight(m_cache.DefaultUserWs);
                int superSubHeight = (fontHeight * 2) / 3;
                vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, superSubHeight);
                vwenv.set_IntProperty((int)FwTextPropType.ktptLineHeight, (int)FwTextPropVar.ktpvMilliPoint, -superSubHeight);
                superOffset = superSubHeight / 2;
            }
            else
            {
                vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing, (int)FwTextPropVar.ktpvMilliPoint, PILE_MARGIN);
            }
            vwenv.OpenInnerPile();
            if (numLines == 1)
            {
                vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, superOffset);
            }
            vwenv.OpenParagraph();
            vwenv.AddProp((int)PhIterationContext.PhIterationContextTags.kflidMaximum, this, kfragIterCtxtMax);
            vwenv.CloseParagraph();
            AddExtraLines(numLines - 2, vwenv);
            vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, 0);
            vwenv.OpenParagraph();
            vwenv.AddIntProp((int)PhIterationContext.PhIterationContextTags.kflidMinimum);
            vwenv.CloseParagraph();
            vwenv.CloseInnerPile();
        }
Exemplo n.º 2
0
		void DisplayIterCtxt(IPhIterationContext iterCtxt, int numLines, IVwEnv vwenv)
		{
			int superOffset = 0;
			if (numLines == 1)
			{
				// if the inner context is a single line, then make the min value a subscript and the max value a superscript.
				// I tried to use the Views subscript and superscript properties, but they added extra space so that it would
				// have the same line height of a normal character, which is not what I wanted, so I compute the size myself
				int fontHeight = GetFontHeight(m_cache.DefaultUserWs);
				int superSubHeight = (fontHeight * 2) / 3;
				vwenv.set_IntProperty((int)FwTextPropType.ktptFontSize, (int)FwTextPropVar.ktpvMilliPoint, superSubHeight);
				vwenv.set_IntProperty((int)FwTextPropType.ktptLineHeight, (int)FwTextPropVar.ktpvMilliPoint, -superSubHeight);
				superOffset = superSubHeight / 2;
			}
			else
			{
				vwenv.set_IntProperty((int)FwTextPropType.ktptMarginTrailing, (int)FwTextPropVar.ktpvMilliPoint, PILE_MARGIN);
			}
			vwenv.OpenInnerPile();
			if (numLines == 1)
				vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, superOffset);
			vwenv.OpenParagraph();
			vwenv.AddProp(PhIterationContextTags.kflidMaximum, this, kfragIterCtxtMax);
			vwenv.CloseParagraph();
			AddExtraLines(numLines - 2, vwenv);
			vwenv.set_IntProperty((int)FwTextPropType.ktptOffset, (int)FwTextPropVar.ktpvMilliPoint, 0);
			vwenv.OpenParagraph();
			vwenv.AddIntProp(PhIterationContextTags.kflidMinimum);
			vwenv.CloseParagraph();
			vwenv.CloseInnerPile();
		}