Ejemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        public float EndPosition()
        {
            CurrentStateType tagState = ownerTag.state;

            return(tagState.endPosition - tagState.padding[(Int32)fourSide._left] -
                   tagState.padding[(Int32)fourSide._right]
                   - tagState.margin[(Int32)fourSide._left] - tagState.margin[(Int32)fourSide._right]);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Return max allocatable widthLimit.
        /// </summary>
        public float WidthLimit()
        {
            CurrentStateType tagState = ownerTag.state;

            return(tagState.endPosition - tagState.startPosition -
                   tagState.GetBorderSpace(fourSide._left, true) -
                   tagState.GetBorderSpace(fourSide._right, true));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Create a copy of current CurrentStateType object
        /// </summary>
        public CurrentStateType Clone()
        {
            CurrentStateType state = new CurrentStateType(parentHtml, origWidthLimit);

            state.origWidthLimit = this.origWidthLimit;
            state.stateChanged   = false;
            state.stateTagList   = new TagList();
            foreach (HtmlTag aTag in this.stateTagList)
            {
                state.stateTagList.Add(aTag);
            }
            state.state = this.state;

            state.font          = (Font)(this.font.Clone());
            state.visible       = this.visible;
            state.isHeader      = this.isHeader;
            state.isScript      = this.isScript;
            state.subScript     = this.subScript;
            state.supScript     = this.supScript;
            state.bkColor       = this.bkColor;
            state.fntColor      = this.fntColor;
            state.linkColor     = this.linkColor;
            state.activeColor   = this.activeColor;
            state.visitedColor  = this.visitedColor;
            state.URLColor      = this.URLColor;
            state.startPosition = this.startPosition;
            state.endPosition   = this.endPosition;
            state.margin        = (Int32[])this.margin.Clone();
            state.padding       = (Int32[])this.padding.Clone();

            state.borderWidth   = (Int32[])this.borderWidth.Clone();
            state.borderStyle   = (borderStyleType[])this.borderStyle.Clone();
            state.borderColor   = (Color[])this.borderColor.Clone();
            state.borderSpacing = this.borderSpacing;

            state.height        = this.height;
            state.width         = this.width;
            state.position      = this.position;
            state.positionStyle = this.positionStyle;

            state.textTransform = this.textTransform;
            state.cursor        = this.cursor;
            state.bulletType    = this.bulletType;
            state.title         = this.title;
            state.targetURL     = this.targetURL;
            state.hAlign        = this.hAlign;
            state.vAlign        = this.vAlign;

            state.formName   = this.formName;
            state.formAction = this.formAction;
            state.formMethod = this.formMethod;


            return(state);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Update the specified state object, will run UpdateState() of every tag in stateTagList
 /// </summary>
 public static void UpdateState(ref CurrentStateType curState)
 {
     if (!(curState.stateChanged))
     {
         return;
     }
     curState.InitState();
     foreach (HtmlTag aTag in curState.stateTagList)
     {
         aTag.UpdateState(ref curState);
     }
     curState.stateChanged = false;
 }
Ejemplo n.º 5
0
        public static void DebugUnit()
        {
            RegionTag        rTag   = new RegionTag(null, "Debug", null, 0, 0);
            CurrentStateType cState = new CurrentStateType(new MiniHtml(), 100);

            rTag.Update(ref cState);
            SpaceAllocator spaceAlloc = new SpaceAllocator(rTag);
            HtmlTag        aTag       = new HtmlTag(); aTag.name = "abc";

            spaceAlloc.AllocateSpace(aTag, 20, 15, -1);
            aTag = new HtmlTag(); aTag.name = "cde";
            spaceAlloc.AllocateSpace(aTag, 70, 15, -1);
            aTag = new HtmlTag(); aTag.name = "xyz";
            spaceAlloc.AllocateSpace(aTag, 50, 15, -1);
            spaceAlloc.allocList.PrintItems();
            spaceAlloc.floatList.PrintItems();
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Move to next line and reset currentX
        /// </summary>
        /// <returns>Current line number</returns>
        public Int32 NewLine()
        {
            CurrentStateType tagState = ownerTag.state;

            return(NewLine(tagState.startPosition));
        }
Ejemplo n.º 7
0
        /// <summary>
        /// update masterTag and it's childTags
        /// </summary>
        public void Update()
        {
            CurrentStateType curState = new CurrentStateType(parentHtml, parentHtml.widthLimit);

            masterTag.Update(ref curState);
        }