Example #1
0
 private Point GetDockLocation(VObject obj, DockStyle dock, float loc)
 {
     dynamic obounds = obj.bounds;
       if (obj is VLine) {
     // Dock an Linien
     switch (dock) {
       case DockStyle.Top:
       case DockStyle.Left:
     return obounds.Location;
       case DockStyle.Right:
       case DockStyle.Bottom:
     return obounds.Location + obounds.Size;
     }
       } else {
     //Dock an normalen Objekten
     switch (dock) {
       case DockStyle.Top:
     return new Point(obounds.Left + obounds.Width * loc, obounds.Top);
       case DockStyle.Bottom:
     return new Point(obounds.Left + obounds.Width * loc, obounds.Bottom);
       case DockStyle.Left:
     return new Point(obounds.Left, obounds.Top + obounds.Height * loc);
       case DockStyle.Right:
     return new Point(obounds.Right, obounds.Top + obounds.Height * loc);
     }
       }
 }
Example #2
0
 public void showProperties(VObject obj, bool force)
 {
     if (force == true) {
         frm_paletteFile.Show();
         frm_paletteFile.Activate();
     } else if (force == false & frm_paletteFile.Visible == false) {
         return;
     }
     // frm_paletteFile.MyCanvas = Me
     frm_paletteFile.RefreshItemList();
     frm_paletteFile.SelectedObject = obj;
 }
Example #3
0
 internal void OnContentChanged(VObject inElement)
 {
     if (ContentChanged != null) {
         ContentChanged(inElement);
     }
 }
Example #4
0
 public void showProperties(VObject obj)
 {
     showProperties(obj, false);
 }
Example #5
0
 public void SelectObject(VObject obj)
 {
     for (int i = 0; i <= p_objects.Count - 1; i++) {
         p_objects[i].isSelected = false;
     }
     obj.isSelected = true;
     OnSelectionChanged();
     Invalidate();
 }
Example #6
0
 public void removeObject(VObject obj)
 {
     p_objects.Remove(obj);
     if (obj.isSelected)
         OnSelectionChanged();
     obj.Parent = null;
     Invalidate();
     OnContentChanged(null);
 }
Example #7
0
        public void MoveObjectZ(VObject obj, bool dirUp, bool toEnd)
        {
            int curIdx = p_objects.IndexOf(obj);
            if (curIdx == 0 & dirUp == false)
                return;
            if (curIdx == p_objects.Count - 1 & dirUp == true)
                return;

            p_objects.RemoveAt(curIdx);
            if (toEnd) {
                if (dirUp) {
                    p_objects.Add(obj);
                } else {
                    p_objects.Insert(0, obj);
                }
            } else {
                if (dirUp) {
                    p_objects.Insert(curIdx + 1, obj);
                } else {
                    p_objects.Insert(curIdx - 1, obj);
                }
            }

            Invalidate();
            OnContentChanged(obj);
        }
Example #8
0
 public void addObject(VObject obj)
 {
     p_objects.Add(obj);
     obj.Parent = this;
     Invalidate();
     OnContentChanged(obj);
 }