public bool clear() { bool result = (list.Count >= 1); list.Clear(); activeChild = null; return(result); }
public void UpdateActiveObject(Point p) { try { int i = graphicList.wichSelect(p); if (i != -1) { activeObject = graphicList[i]; } Refresh(); } catch { } }
private void OnContexMenu(MouseEventArgs e) { try { Point p = new Point(e.X, e.Y); int n = graphicList.Count; drawBase o = null; for (int i = 0; i < n; i++) { if (graphicList[i].HitTest(p) == 0) { o = graphicList[i]; break; } } if (o != null) { if (!o.Select) { graphicList.UnSelectAll(); } o.Select = true; } else { graphicList.UnSelectAll(); } // Refresh(); cm = new System.Windows.Forms.ContextMenuStrip(); int mItems = owener.ContextParent.DropDownItems.Count; for (int i = mItems - 1; i >= 0; i--) { cm.Items.Insert(0, owener.ContextParent.DropDownItems[i]); } cm.Show(this, p); cm.Closed += delegate(object sender, ToolStripDropDownClosedEventArgs args) { if (cm != null) // precaution { mItems = cm.Items.Count; for (int k = mItems - 1; k >= 0; k--) { owener.ContextParent.DropDownItems.Insert(0, cm.Items[k]); } } }; } catch { } }
public void DoPaste() { if (lableCopy != null) { this.graphicList.add(lableCopy); this.activeObject = this.graphicList[this.graphicList.Count - 1]; this.graphicList[this.graphicList.Count - 1].X += 10; this.graphicList[this.graphicList.Count - 1].Y += 10; this.graphicList[this.graphicList.Count - 1].Select = true; lableCopy = null; lableCopy = (drawBase)this.activeObject.Clone(); this.Refresh(); } }
public void Initialize(frmMain0 owener) { try { SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); this.owener = owener; graphicList = owener.UserSetting.GList; //Doc_Manager.drawAreaIsActive = true; activeObject = null; owener.UserSetting.showGrid = false; owener.UserSetting.arondLine = true; } catch { } }
public void MoveNext() { int i = activeIndex(); if (i >= 0 && i + 1 < list.Count) { UnSelectAll(); list[i + 1].Select = true; activeChild = list[i + 1]; } else { UnSelectAll(); list[0].Select = true; activeChild = list[0]; } }
public void DoCopy() { lableCopy = (drawBase)activeObject.Clone(); }
public void add(drawBase o) { UnSelectAll(); list.Add(o); activeChild = o; }
public void moveToBack(drawBase o) { list.Insert(0, o); }
public graphicList() { list = new List <drawBase>(); activeChild = new labelObject(); }