Example #1
0
 public dfMarkupBox(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
 {
     this.Element  = element;
     this.Display  = display;
     this.Style    = style;
     this.Baseline = style.FontSize;
 }
Example #2
0
 public dfMarkupBox(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
 {
     this.Element = element;
     this.Display = display;
     this.Style = style;
     this.Baseline = style.FontSize;
 }
Example #3
0
 public dfMarkupBox(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
 {
     this.Position = Vector2.zero;
     this.Size     = Vector2.zero;
     this.Margins  = new dfMarkupBorders(0, 0, 0, 0);
     this.Padding  = new dfMarkupBorders(0, 0, 0, 0);
     this.children = new System.Collections.Generic.List <dfMarkupBox>();
     this.Element  = element;
     this.Display  = display;
     this.Style    = style;
     this.Baseline = style.FontSize;
 }
Example #4
0
 private dfMarkupBox GetContainingBlock()
 {
     for (dfMarkupBox i = this; i != null; i = i.Parent)
     {
         dfMarkupDisplayType display = i.Display;
         if ((display == dfMarkupDisplayType.block || display == dfMarkupDisplayType.inlineBlock || display == dfMarkupDisplayType.listItem || display == dfMarkupDisplayType.table || display == dfMarkupDisplayType.tableRow ? true : display == dfMarkupDisplayType.tableCell))
         {
             return(i);
         }
     }
     return(null);
 }
Example #5
0
    public virtual void AddChild(dfMarkupBox box)
    {
        dfMarkupDisplayType display = box.Display;

        if ((((display == dfMarkupDisplayType.block) || (display == dfMarkupDisplayType.table)) || (display == dfMarkupDisplayType.listItem)) || (display == dfMarkupDisplayType.tableRow))
        {
            this.addBlock(box);
        }
        else
        {
            this.addInline(box);
        }
    }
Example #6
0
 public static dfMarkupBoxText Obtain(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
 {
     if (dfMarkupBoxText.objectPool.Count <= 0)
     {
         return new dfMarkupBoxText(element, display, style);
     }
     dfMarkupBoxText fontSize = dfMarkupBoxText.objectPool.Dequeue();
     fontSize.Element = element;
     fontSize.Display = display;
     fontSize.Style = style;
     fontSize.Position = Vector2.zero;
     fontSize.Size = Vector2.zero;
     fontSize.Baseline = (int)((float)style.FontSize * 1.1f);
     fontSize.Margins = new dfMarkupBorders();
     fontSize.Padding = new dfMarkupBorders();
     return fontSize;
 }
Example #7
0
 public static dfMarkupBoxText Obtain(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
 {
     if (objectPool.Count > 0)
     {
         dfMarkupBoxText text = objectPool.Dequeue();
         text.Element  = element;
         text.Display  = display;
         text.Style    = style;
         text.Position = Vector2.zero;
         text.Size     = Vector2.zero;
         text.Baseline = (int)(style.FontSize * 1.1f);
         text.Margins  = new dfMarkupBorders();
         text.Padding  = new dfMarkupBorders();
         return(text);
     }
     return(new dfMarkupBoxText(element, display, style));
 }
Example #8
0
    public static dfMarkupBoxText Obtain(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style)
    {
        if (dfMarkupBoxText.objectPool.Count <= 0)
        {
            return(new dfMarkupBoxText(element, display, style));
        }
        dfMarkupBoxText fontSize = dfMarkupBoxText.objectPool.Dequeue();

        fontSize.Element  = element;
        fontSize.Display  = display;
        fontSize.Style    = style;
        fontSize.Position = Vector2.zero;
        fontSize.Size     = Vector2.zero;
        fontSize.Baseline = (int)((float)style.FontSize * 1.1f);
        fontSize.Margins  = new dfMarkupBorders();
        fontSize.Padding  = new dfMarkupBorders();
        return(fontSize);
    }
Example #9
0
        public static dfMarkupBoxText Obtain( dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style )
        {

        if( objectPool.Count > 0 )
        {

            var instance = objectPool.Dequeue();

            instance.Element = element;
            instance.Display = display;
            instance.Style = style;

            instance.Position = Vector2.zero;
            instance.Size = Vector2.zero;

            instance.Baseline = (int)( style.FontSize * 1.1f );
            instance.Margins = new dfMarkupBorders();
            instance.Padding = new dfMarkupBorders();

            return instance;

        }

        return new dfMarkupBoxText( element, display, style );

        }
Example #10
0
 public dfMarkupBoxText( dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style )
 : base( element, display, style )
 {
 }
Example #11
0
 public dfMarkupBoxTexture(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style) : base(element, display, style)
 {
     this.renderData = new dfRenderData(0x20);
 }
Example #12
0
 public dfMarkupBoxSprite(dfMarkupElement element, dfMarkupDisplayType display, dfMarkupStyle style) : base(element, display, style)
 {
 }