예제 #1
0
        public bool clear()
        {
            bool result = (list.Count >= 1);

            list.Clear();
            activeChild = null;
            return(result);
        }
예제 #2
0
 public void UpdateActiveObject(Point p)
 {
     try
     {
         int i = graphicList.wichSelect(p);
         if (i != -1)
         {
             activeObject = graphicList[i];
         }
         Refresh();
     }
     catch { }
 }
예제 #3
0
        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 { }
        }
예제 #4
0
 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();
     }
 }
예제 #5
0
        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 { }
        }
예제 #6
0
        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];
            }
        }
예제 #7
0
 public void DoCopy()
 {
     lableCopy = (drawBase)activeObject.Clone();
 }
예제 #8
0
 public void add(drawBase o)
 {
     UnSelectAll();
     list.Add(o);
     activeChild = o;
 }
예제 #9
0
 public void moveToBack(drawBase o)
 {
     list.Insert(0, o);
 }
예제 #10
0
 public graphicList()
 {
     list        = new List <drawBase>();
     activeChild = new labelObject();
 }