示例#1
0
文件: Footnote.cs 项目: nholik/Fo.Net
 public static bool LayoutFootnote(Page p, FootnoteBody fb, Area area)
 {
     try
     {
         BodyAreaContainer bac = p.getBody();
         AreaContainer footArea = bac.getFootnoteReferenceArea();
         footArea.setIDReferences(bac.getIDReferences());
         int basePos = footArea.GetCurrentYPosition()
             - footArea.GetHeight();
         int oldHeight = footArea.GetHeight();
         if (area != null)
         {
             footArea.setMaxHeight(area.getMaxHeight() - area.GetHeight()
                 + footArea.GetHeight());
         }
         else
         {
             footArea.setMaxHeight(bac.getMaxHeight()
                 + footArea.GetHeight());
         }
         Status status = fb.Layout(footArea);
         if (status.isIncomplete())
         {
             return false;
         }
         else
         {
             if (area != null)
             {
                 area.setMaxHeight(area.getMaxHeight()
                     - footArea.GetHeight() + oldHeight);
             }
             if (bac.getFootnoteState() == 0)
             {
                 Area ar = bac.getMainReferenceArea();
                 DecreaseMaxHeight(ar, footArea.GetHeight() - oldHeight);
                 footArea.setYPosition(basePos + footArea.GetHeight());
             }
         }
     }
     catch (FonetException)
     {
         return false;
     }
     return true;
 }
示例#2
0
文件: Area.cs 项目: nholik/Fo.Net
 public void removeChild(Area area)
 {
     this.currentHeight -= area.GetHeight();
     this.children.Remove(area);
 }
示例#3
0
文件: Area.cs 项目: lajjne/Fo.Net
 public void removeChild(Area area)
 {
     this.currentHeight -= area.GetHeight();
     this.children.Remove(area);
 }
示例#4
0
        public override Status Layout(Area area)
        {
            if (this.marker == MarkerBreakAfter)
            {
                return new Status(Status.OK);
            }

            if (this.marker == MarkerStart)
            {
                if (!setup)
                {
                    DoSetup(area);
                }
            }
            if (columnWidth > 0)
            {
                this.areaContainer =
                    new AreaContainer(propMgr.GetFontState(area.getFontInfo()),
                                      columnOffset, 0, columnWidth,
                                      area.getContentHeight(), Position.RELATIVE);
                areaContainer.foCreator = this;
                areaContainer.setPage(area.getPage());
                areaContainer.setBorderAndPadding(propMgr.GetBorderAndPadding());
                areaContainer.setBackground(propMgr.GetBackgroundProps());
                areaContainer.SetHeight(area.GetHeight());
                area.addChild(areaContainer);
            }
            return new Status(Status.OK);
        }