public DrawFrame(DesignPanel tD, int width, int height, Image backImage) { TDPanel = tD; this.SetStyle(ControlStyles.Selectable, true); InitializeComponent(); this.BackColor = Color.FromArgb(192, 192, 192); this.SetStyle(ControlStyles.Selectable, true); this.AutoScroll = false; this.Cursor = Cursors.Arrow; DrawPanel = CreateDrawPanel(tD, width, height, backImage); DrawPanel.TabIndex = 0; DrawPanel.Select(); DrawPanel.BackColor = Color.White; this.Controls.Add(DrawPanel); this.SetLocation(); //事件初始化 this.SizeChanged += new EventHandler(DrawFrame_SizeChanged); this.DfVScrollBar.ValueChanged += new EventHandler(DfVScrollBar_ValueChanged); this.DfHScrollBar.ValueChanged += new EventHandler(DfHScrollBar_ValueChanged); this.DfVScrollBar.SmallChange = 10; this.DfHScrollBar.SmallChange = 10; }
public LockRectCommand(DesignPanel tdPanel, List <Rect> lockedRects) { TDPanel = tdPanel; LockedRects = lockedRects; LockedLines = new List <PartitionLine>(); CommandInfo = "锁定矩形"; }
/// <summary> /// 工厂模式动态创建DrawFrame /// </summary> protected override DrawFrame CreateDrawFrame(DesignPanel tD, int width, int height, Image backImage) { TmpltDrawFrame df = new TmpltDrawFrame(tD, width, height, backImage); df.TmpltDoc = TmpltDoc; return(df); }
public HRuler(DesignPanel tD) { TDPanel = tD; StartPos = 0F; CurPos = 0; InitializeComponent(); }
/// <summary> /// 创建画板 /// </summary> /// <param name="tD"></param> /// <param name="width"></param> /// <param name="height"></param> /// <param name="backImage"></param> /// <returns></returns> protected override DrawPanel CreateDrawPanel(DesignPanel tD, int width, int height, Image backImage) { TmpltDrawPanel drawPanel = new TmpltDrawPanel(tD, width, height, backImage); drawPanel.TmpltDoc = TmpltDoc; return(drawPanel); }
public DisLockRectCommand(DesignPanel tdPanel, List <Rect> unLockedRect) { TDPanel = tdPanel; UnLockedRects = unLockedRect; UnLockedLines = new List <PartitionLine>(); CommandInfo = "解开锁定矩形"; }
public VRuler(DesignPanel tD) { TDPanel = tD; MaximumSize = new Size(Int32.MaxValue, Int32.MaxValue); StartPos = 0F; CurPos = 0; InitializeComponent(); }
public ChangeSnipPerpertyCommand(DesignPanel tdPanel, SnipRect pastedSnipRect, SnipData newData) { PastedSnipRect = pastedSnipRect; NewSnipData = newData; OldSnipData = new SnipData(pastedSnipRect.SnipData); TDPanel = tdPanel; TDPanel.Modified = true; CommandInfo = "更改页面片属性"; }
public PartRectCommand(DesignPanel tdPanel, bool isRow, List <Rect> addedRects, Rect removedRect, List <PartitionLine> newLines) { IsRow = isRow; AddedRects = addedRects; RemovedRects.Add(removedRect); AddedLines = newLines; TDPanel = tdPanel; TDPanel.Modified = true; CommandInfo = "合并矩形"; }
/// <summary> /// 构造函数 /// </summary> /// <param name="tdPanel"></param> /// <param name="selectedRects">将要置为选择状态之矩形</param> /// <param name="disSelectedRects">将取消选择状态之矩形</param> /// <param name="selectedLines">将被选择的直线</param> /// <param name="disSelectedLines">将被取消选择的直线</param> public SelectCommand(DesignPanel tdPanel, List <Rect> selectedRects, List <Rect> disSelectedRects, List <PartitionLine> selectedLines, List <PartitionLine> disSelectedLines) { TDPanel = tdPanel; SelectedRects.AddRange(selectedRects); DisSelectedRects.AddRange(disSelectedRects); SelectedLines.AddRange(selectedLines); DisSelectedLines.AddRange(disSelectedLines); CommandInfo = "更改选择对象"; }
public CilpPanelCommand(DesignPanel tdPanel, Rect rect, Image img) { _width = rect.Width; _height = rect.Height; _x = rect.X; _y = rect.Y; _rect = rect; TDPanel = tdPanel; _listLine = tdPanel.DrawPanel.ListLine; CommandInfo = "切割画板"; _backImg = img; }
public PasteSnipDataCommand(DesignPanel tdPanel, List <Rect> pastedSnipRects, SnipData newData, TmpltXmlDocument doc) { PastedSnipRects = pastedSnipRects; Doc = doc; NewSnipData = newData; dPanel = tdPanel; foreach (Rect rect in PastedSnipRects) { OldSnipDatas[rect] = rect.SnipData; } CommandInfo = "粘贴页面片数据"; }
public AddLineCommand(DesignPanel tdPanel, int start, int end, int position, bool isRow) { Init(); AddedLines.Add(new PartitionLine(start, end, position, isRow)); Start = start; End = end; Position = position; IsRow = isRow; TDPanel = tdPanel; TDPanel.Modified = true; CommandInfo = "插入直线"; }
public AddLineCommand(DesignPanel tdPanel, PartitionLine addedLine) { Init(); AddedLines.Add(addedLine); Start = addedLine.Start; End = addedLine.End; Position = addedLine.Position; IsRow = addedLine.IsRow; TDPanel = tdPanel; TDPanel.Modified = true; CommandInfo = "插入直线"; }
public DeleteLineCommand(DesignPanel tdPanel, PartitionLine line, List <Rect> addedRects, List <Rect> removedRects) { Start = line.Start; End = line.End; Position = line.Position; IsRow = line.IsRow; AddedRects = addedRects; RemovedRects = removedRects; TDPanel = tdPanel; TDPanel.Modified = true; CommandInfo = "删除直线"; }
public TmpltDrawPanel(DesignPanel tDPanel, int width, int height, Image backImage) : base(tDPanel, width, height, backImage) { ResourcesReader.SetObjectResourcesHelper(this); InitializeComponent(); //双缓存 this.DoubleBuffered = true; this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.UserPaint, true); _lockedImg = GetImage("lockedImage"); _selectedImg = GetImage("selectedImage"); _hasSnip = GetImage("hasSnipImage"); _hasContentSnip = GetImage("hasContentSnipImage"); }
public MergeRectCommand(DesignPanel tdPanel) { TDPanel = tdPanel; List <Rect> selectedRects = tdPanel.DrawPanel.ListRect.GetSelectedRects(); Rectangle boundaryRect = CommonFuns.FindRectsBorder(selectedRects); ///保存边界矩形 BoundaryRect = new Rectangle( boundaryRect.X, boundaryRect.Y, boundaryRect.Width, boundaryRect.Height ); CommandInfo = "合并矩形"; }
public MoveLineCommand(DesignPanel tdPanel, PartitionLine movedLine, int movedToPos, PartitionLine firstBorderLine, PartitionLine secondBorderLine) { TDPanel = tdPanel; MovedLine = movedLine; MovedToPos = movedToPos; FirstBorderLine = firstBorderLine; SecondBorderLine = secondBorderLine; ///初始化Rects InitRects(); ///初始化直线数据:NewLines,EndPointLines,StartPointLines InitLines(); TDPanel.Modified = true; CommandInfo = "移动直线"; }
public TmpltVRuler(DesignPanel tD) : base(tD) { //InitContextMenu(); }
/// <summary> /// 动态创建VRuler /// </summary> protected override VRuler CreateVRuler(DesignPanel tD) { return(new TmpltVRuler(tD)); }
internal TmpltDrawFrame(DesignPanel tD, int width, int height, Image backImage) : base(tD, width, height, backImage) { InitializeComponent(); }
protected virtual HRuler CreateHRuler(DesignPanel tD) { return(new HRuler(tD)); }
protected virtual VRuler CreateVRuler(DesignPanel tD) { return(new VRuler(tD)); }
/// <summary> /// 动态创建DrawPanel /// </summary> /// <param name="tD"></param> /// <param name="width"></param> /// <param name="height"></param> /// <returns></returns> protected virtual DrawPanel CreateDrawPanel(DesignPanel tD, int width, int height, Image backImage) { return(new DrawPanel(tD, width, height, backImage)); }
public RectList(DesignPanel tD) { SnipRectList = new SDList <Rect>(); TDPanel = tD; }