private void IndentMove(RulerIndent Indent, Point Pt) { int num1 = this.vertical ? Pt.Y : Pt.X; if (Indent.Orientation == IndentOrientation.Near) { num1 = Math.Min(num1, (int)((this.pageStart + this.pageWidth) - EditConsts.DefaultRulerMinWidth)); num1 = Math.Max((int)(num1 - this.rulerStart), EditConsts.DefaultRulerIndentSize); Indent.Indent = this.GetDiscreteInterval(num1, Indent.Indent); this.pageWidth += ((this.pageStart - this.rulerStart) - Indent.Indent); this.pageStart = this.rulerStart + Indent.Indent; } else { num1 = Math.Max(num1, (int)(this.pageStart + EditConsts.DefaultRulerMinWidth)); num1 = Math.Max((int)((this.rulerStart + this.rulerWidth) - num1), EditConsts.DefaultRulerIndentSize); Indent.Indent = this.GetDiscreteInterval(num1, Indent.Indent); this.pageWidth = (this.rulerWidth - Indent.Indent) - (this.pageStart - this.rulerStart); } num1 = this.GetIndentPos(Indent); if (this.drawX != num1) { if (this.drawX != -1) { this.DrawLine(this.drawX, true); } this.DrawLine(num1, false); } base.Invalidate(); }
private void IndentUp(RulerIndent Indent) { Indent.Dragging = false; if (this.drawX != -1) { this.DrawLine(this.drawX, true); } }
private int GetIndentPos(RulerIndent Ind) { if (Ind.Orientation == IndentOrientation.Near) { return(this.rulerStart + Ind.Indent); } return((this.rulerStart + this.rulerWidth) - Ind.Indent); }
protected virtual void RulerChanged(object sender, EventArgs e) { if ((this.owner != null) && (sender is IEditRuler)) { int num1; int num2; if (this.owner.Selection.IsEmpty()) { num1 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(this.owner.Position)); num2 = num1; } else { Rectangle rectangle1 = this.owner.Selection.SelectionRect; num1 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(rectangle1.Location)); num2 = this.GetPageIndexAt(this.owner.DisplayLines.PointToDisplayPoint(rectangle1.Right, rectangle1.Bottom)); } this.BeginUpdate(); try { IEditRuler ruler1 = (IEditRuler)sender; RulerIndent indent1 = ((RulerEventArgs)e).Object as RulerIndent; for (int num3 = Math.Max(num1, 0); num3 <= num2; num3++) { EditPage page1 = this[num3] as EditPage; if (ruler1.Vertical) { if (indent1.Orientation == IndentOrientation.Near) { page1.TopIndent = indent1.Indent; } else { page1.BottomIndent = indent1.Indent; } } else if (indent1.Orientation == IndentOrientation.Near) { page1.LeftIndent = indent1.Indent; } else { page1.RightIndent = indent1.Indent; } } } finally { this.EndUpdate(); } } }
private Rectangle GetIndentRect(RulerIndent Indent) { Rectangle rectangle1 = Rectangle.Empty; if (this.vertical) { if (Indent.Orientation == IndentOrientation.Near) { return(new Rectangle(6, this.rulerStart, 0x10, Indent.Indent)); } return(new Rectangle(6, this.pageWidth + this.pageStart, 0x10, Indent.Indent)); } if (Indent.Orientation == IndentOrientation.Near) { return(new Rectangle(this.rulerStart, 6, Indent.Indent, 0x10)); } return(new Rectangle(this.pageWidth + this.pageStart, 6, Indent.Indent, 0x10)); }
private Rectangle GetIndentHitRect(RulerIndent Indent) { Rectangle rectangle1 = Rectangle.Empty; if (this.vertical) { if (Indent.Orientation == IndentOrientation.Near) { return(new Rectangle(6, (this.rulerStart + Indent.Indent) - EditConsts.DefaultRulerHitWidth, 0x10, EditConsts.DefaultRulerHitWidth * 2)); } return(new Rectangle(6, (this.pageStart + this.pageWidth) - EditConsts.DefaultRulerHitWidth, 0x10, EditConsts.DefaultRulerHitWidth * 2)); } if (Indent.Orientation == IndentOrientation.Near) { return(new Rectangle((this.rulerStart + Indent.Indent) - EditConsts.DefaultRulerHitWidth, 6, EditConsts.DefaultRulerHitWidth * 2, 0x10)); } return(new Rectangle((this.pageStart + this.pageWidth) - EditConsts.DefaultRulerHitWidth, 6, EditConsts.DefaultRulerHitWidth * 2, 0x10)); }
private void IndentDown(RulerIndent Indent) { Indent.Dragging = true; }