Esempio n. 1
0
 protected internal void UpdateRulers()
 {
     if ((this.owner != null) && (this.rulers != EditRulers.None))
     {
         IEditPage page1 = this.GetPageAt(this.owner.DisplayLines.PointToDisplayPoint(this.owner.Position));
         if (page1 != null)
         {
             Rectangle rectangle1 = page1.BoundsRect;
             Rectangle rectangle2 = page1.ClientRect;
             if ((this.rulers & EditRulers.Horizonal) != EditRulers.None)
             {
                 IEditRuler ruler1 = this.HorzRuler;
                 ruler1.RulerStart = rectangle1.Left - ruler1.Left;
                 ruler1.RulerWidth = rectangle1.Width;
                 ruler1.PageStart  = rectangle2.Left - ruler1.Left;
                 ruler1.PageWidth  = rectangle2.Width;
                 ruler1.MarkWidth  = this.owner.Painter.FontWidth;
                 ruler1.Update();
             }
             if ((this.rulers & EditRulers.Vertical) != EditRulers.None)
             {
                 IEditRuler ruler2 = this.VertRuler;
                 ruler2.RulerStart = rectangle1.Top - ruler2.Top;
                 ruler2.RulerWidth = rectangle1.Height;
                 ruler2.PageStart  = rectangle2.Top - ruler2.Top;
                 ruler2.PageWidth  = rectangle2.Height;
                 ruler2.MarkWidth  = this.owner.Painter.FontWidth;
                 ruler2.Update();
             }
         }
     }
 }
Esempio n. 2
0
 protected internal bool IsMouseOnOutlineButton(int X, int Y, out IOutlineRange Range)
 {
     Range = null;
     if (((this.owner != null) && this.AllowOutlining) && ((this.OutlineOptions & River.Orqa.Editor.OutlineOptions.DrawButtons) != River.Orqa.Editor.OutlineOptions.None))
     {
         Rectangle rectangle1;
         if (this.owner.Pages.PageType == PageType.PageLayout)
         {
             IEditPage page1 = this.owner.Pages.GetPageAtPoint(X, Y);
             rectangle1 = page1.ClientRect;
         }
         else
         {
             rectangle1 = this.owner.ClientRect;
         }
         int num1 = ((Gutter)this.owner.Gutter).GetWidth();
         rectangle1.X     += num1;
         rectangle1.Width -= num1;
         if (rectangle1.Contains(X, Y))
         {
             Point point1 = this.owner.ScreenToDisplay(X, Y);
             point1 = this.displayLines.DisplayPointToPoint(point1.X, point1.Y, false, true, false);
             Range  = this.displayLines.GetOutlineRange(point1);
             if (Range != null)
             {
                 return(!Range.Visible);
             }
         }
     }
     return(false);
 }
        private void ShowTab(IEditPage editPage)
        {
            var pageAsControl = (Control)editPage;

            ContentPanel.Controls.Add(pageAsControl);
            pageAsControl.BackColor = Color.Transparent;
            pageAsControl.Dock      = DockStyle.Fill;

            verticalTabs.Items.Add(editPage);
        }
Esempio n. 4
0
        private void ShowTab(IEditPage editPage)
        {
            Control control = (Control)editPage;

            base.ContentPanel.Controls.Add(control);
            control.BackColor = Color.Transparent;
            control.Dock      = DockStyle.Fill;
            editPage.SetXenObjects(this.xenObject, this.xenObjectCopy);
            base.verticalTabs.Items.Add(editPage);
        }
Esempio n. 5
0
 public void Invalidate(IEditPage Page)
 {
     if (this.updateCount == 0)
     {
         if (Page != null)
         {
             this.owner.Invalidate(((EditPage)Page).PageRect);
         }
         else
         {
             this.owner.Invalidate();
         }
     }
 }
Esempio n. 6
0
 public void Assign(IEditPage Source)
 {
     this.BeginUpdate();
     try
     {
         this.PageKind    = Source.PageKind;
         this.PageSize    = Source.PageSize;
         this.Landscape   = Source.Landscape;
         this.Margins     = Source.Margins;
         this.HorzOffset  = Source.HorzOffset;
         this.VertOffset  = Source.VertOffset;
         this.Header      = Source.Header;
         this.Footer      = Source.Footer;
         this.PaintNumber = Source.PaintNumber;
     }
     finally
     {
         this.EndUpdate();
     }
 }
Esempio n. 7
0
 protected internal void InitDefaultPageSettings(PageSettings PageSettings, bool UpdateSize)
 {
     if (UpdateSize)
     {
         try
         {
             PaperSize size1 = PageSettings.PaperSize;
             this.defaultPageSize = new Size(size1.Width, size1.Height);
             this.defaultPageKind = size1.Kind;
         }
         catch
         {
         }
     }
     else
     {
         this.defaultPageSize = new Size((0x33b * this.caps.Width) / 100, (0x491 * this.caps.Height) / 100);
         this.defaultPageKind = PaperKind.Custom;
     }
     this.defaultMargins   = PageSettings.Margins;
     this.defaultLandscape = PageSettings.Landscape;
     if (this.Count > 0)
     {
         this.BeginUpdate();
         try
         {
             for (int num1 = 0; num1 < this.Count; num1++)
             {
                 IEditPage page1 = this[num1];
                 page1.Margins   = this.defaultMargins;
                 page1.PageKind  = this.defaultPageKind;
                 page1.PageSize  = this.defaultPageSize;
                 page1.Landscape = this.defaultLandscape;
             }
         }
         finally
         {
             this.EndUpdate();
         }
     }
 }
Esempio n. 8
0
 public bool Contains(int X, int Y)
 {
     if (this.owner != null)
     {
         if (this.owner.Pages.PageType == PageType.PageLayout)
         {
             IEditPage page1 = this.owner.Pages.GetPageAtPoint(X, Y);
             if ((page1 == null) || !page1.ClientRect.Contains(X, Y))
             {
                 return(false);
             }
         }
         Point point1 = this.owner.ScreenToDisplay(X, Y);
         Point point2 = ((SyntaxEdit)this.owner).DisplayToScreen(this.Position, point1.Y, true);
         int   num1   = point2.X;
         if (X > (num1 - EditConsts.DefaultRulerHitWidth))
         {
             return(X <= (num1 + EditConsts.DefaultRulerHitWidth));
         }
     }
     return(false);
 }
Esempio n. 9
0
 protected internal void DrawLine(int X, int Y, bool Erase)
 {
     this.drawX = X;
     this.drawY = Y;
     if (this.owner != null)
     {
         Rectangle  rectangle1;
         SyntaxEdit edit1 = (SyntaxEdit)this.owner;
         if (edit1.Pages.PageType == PageType.PageLayout)
         {
             IEditPage page1 = edit1.Pages.GetPageAtPoint(X, Y);
             if (page1 == null)
             {
                 return;
             }
             rectangle1 = page1.ClientRect;
         }
         else
         {
             rectangle1 = edit1.ClientRect;
         }
         if (Erase)
         {
             edit1.Invalidate(new Rectangle(X, rectangle1.Top, 1, rectangle1.Height));
         }
         else
         {
             Graphics graphics1 = edit1.CreateGraphics();
             try
             {
                 graphics1.DrawLine(this.pen, X, rectangle1.Top, X, (int)(rectangle1.Bottom - 1));
             }
             finally
             {
                 graphics1.Dispose();
             }
         }
     }
 }
Esempio n. 10
0
 private void UpdateLineNumberLength()
 {
     if (this.owner != null)
     {
         int num1 = Math.Max((int)((Math.Max(this.owner.DisplayLines.GetCount(), this.owner.Lines.Count) + this.lineNumbersStart) - 1), 0);
         if ((this.options & GutterOptions.PaintLinesBeyondEof) != GutterOptions.None)
         {
             int num2;
             if (this.owner.Pages.PageType == PageType.PageLayout)
             {
                 IEditPage page1 = (this.owner.Pages.Count > 0) ? this.owner.Pages[this.owner.Pages.Count - 1] : this.owner.Pages.DefaultPage;
                 num2 = page1.EndLine;
             }
             else
             {
                 num2 = this.owner.Scrolling.WindowOriginY + this.owner.LinesInHeight();
             }
             Point point1 = this.owner.DisplayLines.DisplayPointToPoint(0, num2);
             num2 = point1.Y;
             num1 = Math.Max(num1, num2);
         }
         this.lineNumberLength = num1.ToString().Length;
     }
 }
Esempio n. 11
0
 public void Paint(ITextPainter Painter, Rectangle Rect)
 {
     if (this.Count != 0)
     {
         int num1 = 0;
         this.transparent = (this.owner != null) && this.owner.Transparent;
         for (int num2 = Math.Max(this.GetPageIndexAtPoint(Rect.Location), 0); num2 < this.Count; num2++)
         {
             IEditPage page1 = this[num2];
             page1.Paint(Painter);
             num1 = page1.BoundsRect.Bottom + 1;
             if (this.displayWhiteSpace)
             {
                 num1 += 2;
             }
             if (num1 >= Rect.Bottom)
             {
                 return;
             }
         }
         if ((this.pageType == River.Orqa.Editor.PageType.PageLayout) && (num1 < Rect.Bottom))
         {
             Rectangle rectangle1 = new Rectangle(Rect.Left, num1, Rect.Width, Rect.Bottom - num1);
             Color     color1     = Painter.BkColor;
             Painter.BkColor = this.BackColor;
             try
             {
                 Painter.FillRectangle(rectangle1);
             }
             finally
             {
                 Painter.BkColor = color1;
             }
         }
     }
 }
Esempio n. 12
0
        private void ShowTab(IEditPage editPage)
        {
            var pageAsControl = (Control)editPage;
            ContentPanel.Controls.Add(pageAsControl);
            pageAsControl.BackColor = Color.Transparent;
            pageAsControl.Dock = DockStyle.Fill;

            editPage.SetXenObjects(xenObject, xenObjectCopy);
            verticalTabs.Items.Add(editPage);
        }
Esempio n. 13
0
 public int Add(IEditPage Page)
 {
     ((EditPage)Page).Pages = this;
     ((EditPage)Page).Index = this.Count;
     return(this.items.Add(Page));
 }
Esempio n. 14
0
 public void Update(IEditPage Page, bool Changed)
 {
     this.UpdatePages(Page.Index, 0x7fffffff, Changed);
 }
Esempio n. 15
0
 public void Update(IEditPage Page)
 {
     this.Update(Page, false);
 }
Esempio n. 16
0
 public void Remove(IEditPage Page)
 {
     ((EditPage)Page).Pages = null;
     this.items.Remove(Page);
 }
Esempio n. 17
0
 public PageHeader(IEditPage Page) : this()
 {
     this.page = Page;
 }