public ShapeTreeNode(ShapeObject so) { _so = so; }
private void PreparePropertyGridForPathTreeNode(PropertyGridEx.PropertyGridEx pgex, ShapeObject so) { List<PathTreeNode> ptn_list = new List<PathTreeNode>(); PathTreeNode dummy = new PathTreeNode(); dummy.Text = "No path"; dummy.PathObject = null; ptn_list.Add(dummy); foreach (TreeNode tn in avstn.Nodes) { if(tn.GetType() == typeof(PathTreeNode)) { PathTreeNode ptn = (PathTreeNode)tn; ptn_list.Add(ptn); } } ArrayList ary = new ArrayList(ptn_list); int v = 0; if (so.GetPathTreeNode().PathIndex != v) { v = so.GetPathTreeNode().PathIndex; } pgex.Item.Add("Path", ary[v], false, "Path", "Path of the shape", true); pgex.Item[pgex.Item.Count - 1].Choices = new PropertyGridEx.CustomChoices(ary); }
public void AddShape(ShapeObject so, out ShapeTreeNode shptn, out ParentTreeNode partn) { TreeNode selected = treeProject.SelectedNode; if(selected.GetType() == typeof(ParentTreeNode)) { partn = (ParentTreeNode)selected; shptn = new ShapeTreeNode(so); shptn.Text = "Shape"; shptn.ImageIndex = 3; partn.Nodes.Add(shptn); } else { partn = null; shptn = null; } }
private void CompareAndUpdateShapeObject(GridItem changed, object oldvalue, ShapeObject sho) { long S = sho.Start, E = sho.End; if (S.Equals(oldvalue) & changed.Label.Equals("Start time")) { sho.Start = (long)changed.Value; } if (E.Equals(oldvalue) & changed.Label.Equals("End time")) { sho.End = (long)changed.Value; } if (sho.GetAngleX(S).Equals(oldvalue) & changed.Label.Equals("Angle X at start")) { sho.SetAngleX(S, (int)changed.Value); } if (sho.GetAngleX(E).Equals(oldvalue) & changed.Label.Equals("Angle X at end")) { sho.SetAngleX(E, (int)changed.Value); } if (sho.GetAngleY(S).Equals(oldvalue) & changed.Label.Equals("Angle Y at start")) { sho.SetAngleY(S, (int)changed.Value); } if (sho.GetAngleY(E).Equals(oldvalue) & changed.Label.Equals("Angle Y at end")) { sho.SetAngleY(E, (int)changed.Value); } if (sho.GetAngleZ(S).Equals(oldvalue) & changed.Label.Equals("Angle Z at start")) { sho.SetAngleZ(S, (int)changed.Value); } if (sho.GetAngleZ(E).Equals(oldvalue) & changed.Label.Equals("Angle Z at end")) { sho.SetAngleZ(E, (int)changed.Value); } if (sho.GetFrontColor(S).Equals(oldvalue) & changed.Label.Equals("Front color at start")) { sho.SetFrontColor(S, (Color)changed.Value); } if (sho.GetFrontColor(E).Equals(oldvalue) & changed.Label.Equals("Front color at end")) { sho.SetFrontColor(E, (Color)changed.Value); } if (sho.GetBackColor(S).Equals(oldvalue) & changed.Label.Equals("Back color at start")) { sho.SetBackColor(S, (Color)changed.Value); } if (sho.GetBackColor(E).Equals(oldvalue) & changed.Label.Equals("Back color at end")) { sho.SetBackColor(E, (Color)changed.Value); } if (sho.GetBorderColor(S).Equals(oldvalue) & changed.Label.Equals("Border color at start")) { sho.SetBorderColor(S, (Color)changed.Value); } if (sho.GetBorderColor(E).Equals(oldvalue) & changed.Label.Equals("Border color at end")) { sho.SetBorderColor(E, (Color)changed.Value); } if (sho.GetShadowColor(S).Equals(oldvalue) & changed.Label.Equals("Shadow color at start")) { sho.SetShadowColor(S, (Color)changed.Value); } if (sho.GetShadowColor(E).Equals(oldvalue) & changed.Label.Equals("Shadow color at end")) { sho.SetShadowColor(E, (Color)changed.Value); } if (sho.GetRelativePositionX(S).Equals(oldvalue) & changed.Label.Equals("Position X at start")) { sho.SetRelativePositionX(S, (float)changed.Value); } if (sho.GetRelativePositionX(E).Equals(oldvalue) & changed.Label.Equals("Position X at end")) { sho.SetRelativePositionX(E, (float)changed.Value); } if (sho.GetRelativePositionY(S).Equals(oldvalue) & changed.Label.Equals("Position Y at start")) { sho.SetRelativePositionY(S, (float)changed.Value); } if (sho.GetRelativePositionY(E).Equals(oldvalue) & changed.Label.Equals("Position Y at end")) { sho.SetRelativePositionY(E, (float)changed.Value); } if (sho.GetQuakeX(S).Equals(oldvalue) & changed.Label.Equals("Quake X at start")) { sho.SetQuakeX(S, (int)changed.Value); } if (sho.GetQuakeX(E).Equals(oldvalue) & changed.Label.Equals("Quake X at end")) { sho.SetQuakeX(E, (int)changed.Value); } if (sho.GetQuakeY(S).Equals(oldvalue) & changed.Label.Equals("Quake Y at start")) { sho.SetQuakeY(S, (int)changed.Value); } if (sho.GetQuakeY(E).Equals(oldvalue) & changed.Label.Equals("Quake Y at end")) { sho.SetQuakeY(E, (int)changed.Value); } if (sho.GetScaleX(S).Equals(oldvalue) & changed.Label.Equals("Scale X at start")) { sho.SetScaleX(S, (float)changed.Value); } if (sho.GetScaleX(E).Equals(oldvalue) & changed.Label.Equals("Scale X at end")) { sho.SetScaleX(E, (float)changed.Value); } if (sho.GetScaleY(S).Equals(oldvalue) & changed.Label.Equals("Scale Y at start")) { sho.SetScaleY(S, (float)changed.Value); } if (sho.GetScaleY(E).Equals(oldvalue) & changed.Label.Equals("Scale Y at end")) { sho.SetScaleY(E, (float)changed.Value); } if (sho.GetBorderWeight(S).Equals(oldvalue) & changed.Label.Equals("Border weight at start")) { sho.SetBorderWeight(S, (int)changed.Value); } if (sho.GetBorderWeight(E).Equals(oldvalue) & changed.Label.Equals("Border weight at end")) { sho.SetBorderWeight(E, (int)changed.Value); } if (sho.GetShadowDepth(S).Equals(oldvalue) & changed.Label.Equals("Shadow depth at start")) { sho.SetShadowDepth(S, (int)changed.Value); } if (sho.GetShadowDepth(E).Equals(oldvalue) & changed.Label.Equals("Shadow depth at end")) { sho.SetShadowDepth(E, (int)changed.Value); } if (changed.Label.Equals("Path")) { sho.SetPathTreeNode(PathTreeNode.GetFromString(avstn, changed.Value.ToString())); } }
private void tsbShape_Click(object sender, EventArgs e) { if (avso != null && asss != null) { ShapeManagerForm sm = new ShapeManagerForm(); DialogResult dr = sm.ShowDialog(); if(dr == DialogResult.OK) { ShapeObject sho = new ShapeObject(sm.Groups); sho.AddStart(0L); sho.AddEnd(5000L); ShapeTreeNode stn = null; ParentTreeNode ptn = null; mdiTools.AddShape(sho, out stn, out ptn); if(stn != null && ptn != null) { mdiView.View.AddShapeLink(stn, ptn); } } } }