Exemplo n.º 1
0
        /// <summary>
        /// Allocate a tag
        /// </summary>
        /// <param name="aTag">a tag</param>
        /// <param name="aWidth">widthLimit</param>
        /// <param name="aHeight">height</param>
        /// <param name="anExtraInfo">extrainfo to be stored</param>
        /// <returns>relative position where the tag should be drawn</returns>
        internal RectangleF AllocateSpace(HtmlTag aTag, float aWidth, float aHeight, Int32 anExtraInfo)
        {
            if (!(CanAllocateSpace(aWidth)))
            {
                NewLine();
            }
            lineInfo[currentLine].UpdateHeight(aHeight);
            allocList.Add(aTag, hAlignType.Unknown, currentX, currentY, aWidth, aHeight, currentLine, anExtraInfo);

            lineInfo[currentLine].lineWidth += aWidth;
            currentX += aWidth + 1;
            if (maxWidth < currentX)
            {
                maxWidth = currentX;
            }

            return(allocList[allocList.Count - 1].allocatedRect);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Return a list of allocatedItem in current line
        /// </summary>
        public AllocatedList TagList()
        {
            AllocatedList retVal = new AllocatedList();

            foreach (anAllocatedItem item in spaceAlloc.allocList)
            {
                if (item.currentLine == lineNumber)
                {
                    retVal.Add(item);
                }
            }
            return(retVal);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Allocate a tag to any spot in the current space allocator
        /// Used for tag with Css
        /// </summary>
        /// <param name="aTag">a tag</param>
        /// <param name="aLeft">left</param>
        /// <param name="aTop">top</param>
        /// <param name="aWidth">widthLimit</param>
        /// <param name="aHeight">height</param>
        /// <param name="anExtraInfo">extrainfo to be stored</param>
        /// <returns>relative position where the tag should be drawn<</returns>
        internal RectangleF AllocateFloat(HtmlTag aTag, Int32 aLeft, Int32 aTop, float aWidth, float aHeight, Int32 anExtraInfo)
        {
            floatList.Add(aTag, hAlignType.Unknown, aLeft, aTop, aWidth, aHeight, -1, anExtraInfo);
            if (maxWidth < aLeft + aWidth)
            {
                maxWidth = aLeft + aWidth;
            }
            if (maxHeight < aTop + aHeight)
            {
                maxHeight = aTop + aHeight;
            }

            return(floatList[allocList.Count - 1].allocatedRect);
        }