コード例 #1
0
        private void barButtonItem7_ItemClick(object sender, ItemClickEventArgs e)
        {
            var sprite = new DesignSprite()
            {
                Height = 32, Width = 32, Name = "sprite_" + ActiveProject.SpriteDirectory.Count
            };
            TreeListNode node;

            if (treeList1.FocusedNode == null)
            {
                node = treeList1.AppendNode(new object[] { sprite.Name }, treeList1.FocusedNode);
            }
            else
            {
                node = treeList1.AppendNode(new object[] { sprite.Name }, treeList1.FocusedNode.RootNode);
            }

            node.Tag = sprite;
            node.ParentNode.Expanded = true;
            node.ImageIndex          = -1;
            node.SelectImageIndex    = -1;
            node.StateImageIndex     = -1;

            ActiveProject.SpriteDirectory.Add(sprite);

            var newx = new frmSprites();

            newx.ActiveSprite = sprite;
            newx.MdiParent    = this;
            newx.Node         = node;
            newx.TopLevel     = false;
            newx.Show();
        }
コード例 #2
0
 private void treeList1_MouseDoubleClick(object sender, MouseEventArgs e)
 {
     ShowEditor = false;
     treeList1.CloseEditor();
     if (treeList1.FocusedNode != null)
     {
         if (treeList1.FocusedNode.ParentNode != null)
         {
             if (treeList1.FocusedNode.RootNode.Id == 0)
             {
                 var newx = new frmSprites();
                 newx.ActiveSprite = treeList1.FocusedNode.Tag as DesignSprite;
                 newx.MdiParent    = this;
                 newx.Node         = treeList1.FocusedNode;
                 newx.TopLevel     = false;
                 newx.Show();
             }
         }
     }
 }