Reordering support on lists

This commit is contained in:
Justin Aquadro 2012-09-01 23:59:53 -04:00
parent 05bf9d6193
commit 803c8bf5a2
11 changed files with 260 additions and 110 deletions

120
MainForm.Designer.cs generated
View file

@ -84,11 +84,11 @@
this.RightToolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.RightToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel(); this.LeftToolStripPanel = new System.Windows.Forms.ToolStripPanel();
this.ContentPanel = new System.Windows.Forms.ToolStripContentPanel(); this.ContentPanel = new System.Windows.Forms.ToolStripContentPanel();
this.statusStrip1 = new System.Windows.Forms.StatusStrip(); this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.testToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.toolStrip1.SuspendLayout(); this.toolStrip1.SuspendLayout();
this.statusStrip1.SuspendLayout(); this.contextMenuStrip1.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// menuStrip1 // menuStrip1
@ -118,26 +118,26 @@
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.fileToolStripMenuItem.Text = "&File"; this.fileToolStripMenuItem.Text = "&File";
// //
// openToolStripMenuItem // _menuItemOpen
// //
this._menuItemOpen.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image"))); this._menuItemOpen.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemOpen.Image")));
this._menuItemOpen.Name = "openToolStripMenuItem"; this._menuItemOpen.Name = "_menuItemOpen";
this._menuItemOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this._menuItemOpen.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this._menuItemOpen.Size = new System.Drawing.Size(223, 22); this._menuItemOpen.Size = new System.Drawing.Size(223, 22);
this._menuItemOpen.Text = "&Open..."; this._menuItemOpen.Text = "&Open...";
// //
// openFolderToolStripMenuItem // _menuItemOpenFolder
// //
this._menuItemOpenFolder.Image = ((System.Drawing.Image)(resources.GetObject("openFolderToolStripMenuItem.Image"))); this._menuItemOpenFolder.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemOpenFolder.Image")));
this._menuItemOpenFolder.Name = "openFolderToolStripMenuItem"; this._menuItemOpenFolder.Name = "_menuItemOpenFolder";
this._menuItemOpenFolder.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) this._menuItemOpenFolder.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift)
| System.Windows.Forms.Keys.O))); | System.Windows.Forms.Keys.O)));
this._menuItemOpenFolder.Size = new System.Drawing.Size(223, 22); this._menuItemOpenFolder.Size = new System.Drawing.Size(223, 22);
this._menuItemOpenFolder.Text = "Open &Folder..."; this._menuItemOpenFolder.Text = "Open &Folder...";
// //
// openMinecraftSaveFolderToolStripMenuItem // _menuItemOpenMinecraftSaveFolder
// //
this._menuItemOpenMinecraftSaveFolder.Name = "openMinecraftSaveFolderToolStripMenuItem"; this._menuItemOpenMinecraftSaveFolder.Name = "_menuItemOpenMinecraftSaveFolder";
this._menuItemOpenMinecraftSaveFolder.Size = new System.Drawing.Size(223, 22); this._menuItemOpenMinecraftSaveFolder.Size = new System.Drawing.Size(223, 22);
this._menuItemOpenMinecraftSaveFolder.Text = "Open &Minecraft Save Folder"; this._menuItemOpenMinecraftSaveFolder.Text = "Open &Minecraft Save Folder";
// //
@ -146,10 +146,10 @@
this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(220, 6); this.toolStripSeparator3.Size = new System.Drawing.Size(220, 6);
// //
// saveToolStripMenuItem // _menuItemSave
// //
this._menuItemSave.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image"))); this._menuItemSave.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemSave.Image")));
this._menuItemSave.Name = "saveToolStripMenuItem"; this._menuItemSave.Name = "_menuItemSave";
this._menuItemSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this._menuItemSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this._menuItemSave.Size = new System.Drawing.Size(223, 22); this._menuItemSave.Size = new System.Drawing.Size(223, 22);
this._menuItemSave.Text = "&Save"; this._menuItemSave.Text = "&Save";
@ -159,10 +159,10 @@
this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(220, 6); this.toolStripSeparator4.Size = new System.Drawing.Size(220, 6);
// //
// exitToolStripMenuItem // _menuItemExit
// //
this._menuItemExit.Image = ((System.Drawing.Image)(resources.GetObject("exitToolStripMenuItem.Image"))); this._menuItemExit.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemExit.Image")));
this._menuItemExit.Name = "exitToolStripMenuItem"; this._menuItemExit.Name = "_menuItemExit";
this._menuItemExit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); this._menuItemExit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4)));
this._menuItemExit.Size = new System.Drawing.Size(223, 22); this._menuItemExit.Size = new System.Drawing.Size(223, 22);
this._menuItemExit.Text = "E&xit"; this._menuItemExit.Text = "E&xit";
@ -181,26 +181,26 @@
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20); this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "&Edit"; this.editToolStripMenuItem.Text = "&Edit";
// //
// cutToolStripMenuItem // _menuItemCut
// //
this._menuItemCut.Image = ((System.Drawing.Image)(resources.GetObject("cutToolStripMenuItem.Image"))); this._menuItemCut.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemCut.Image")));
this._menuItemCut.Name = "cutToolStripMenuItem"; this._menuItemCut.Name = "_menuItemCut";
this._menuItemCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X))); this._menuItemCut.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this._menuItemCut.Size = new System.Drawing.Size(166, 22); this._menuItemCut.Size = new System.Drawing.Size(166, 22);
this._menuItemCut.Text = "Cu&t"; this._menuItemCut.Text = "Cu&t";
// //
// copyToolStripMenuItem // _menuItemCopy
// //
this._menuItemCopy.Image = ((System.Drawing.Image)(resources.GetObject("copyToolStripMenuItem.Image"))); this._menuItemCopy.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemCopy.Image")));
this._menuItemCopy.Name = "copyToolStripMenuItem"; this._menuItemCopy.Name = "_menuItemCopy";
this._menuItemCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C))); this._menuItemCopy.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this._menuItemCopy.Size = new System.Drawing.Size(166, 22); this._menuItemCopy.Size = new System.Drawing.Size(166, 22);
this._menuItemCopy.Text = "&Copy"; this._menuItemCopy.Text = "&Copy";
// //
// pasteToolStripMenuItem // _menuItemPaste
// //
this._menuItemPaste.Image = ((System.Drawing.Image)(resources.GetObject("pasteToolStripMenuItem.Image"))); this._menuItemPaste.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemPaste.Image")));
this._menuItemPaste.Name = "pasteToolStripMenuItem"; this._menuItemPaste.Name = "_menuItemPaste";
this._menuItemPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V))); this._menuItemPaste.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this._menuItemPaste.Size = new System.Drawing.Size(166, 22); this._menuItemPaste.Size = new System.Drawing.Size(166, 22);
this._menuItemPaste.Text = "&Paste"; this._menuItemPaste.Text = "&Paste";
@ -210,26 +210,26 @@
this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Name = "toolStripSeparator7";
this.toolStripSeparator7.Size = new System.Drawing.Size(163, 6); this.toolStripSeparator7.Size = new System.Drawing.Size(163, 6);
// //
// renameToolStripMenuItem // _menuItemRename
// //
this._menuItemRename.Image = ((System.Drawing.Image)(resources.GetObject("renameToolStripMenuItem.Image"))); this._menuItemRename.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemRename.Image")));
this._menuItemRename.Name = "renameToolStripMenuItem"; this._menuItemRename.Name = "_menuItemRename";
this._menuItemRename.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); this._menuItemRename.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R)));
this._menuItemRename.Size = new System.Drawing.Size(166, 22); this._menuItemRename.Size = new System.Drawing.Size(166, 22);
this._menuItemRename.Text = "&Rename"; this._menuItemRename.Text = "&Rename";
// //
// editValueToolStripMenuItem // _menuItemEditValue
// //
this._menuItemEditValue.Image = ((System.Drawing.Image)(resources.GetObject("editValueToolStripMenuItem.Image"))); this._menuItemEditValue.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemEditValue.Image")));
this._menuItemEditValue.Name = "editValueToolStripMenuItem"; this._menuItemEditValue.Name = "_menuItemEditValue";
this._menuItemEditValue.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); this._menuItemEditValue.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this._menuItemEditValue.Size = new System.Drawing.Size(166, 22); this._menuItemEditValue.Size = new System.Drawing.Size(166, 22);
this._menuItemEditValue.Text = "&Edit Value"; this._menuItemEditValue.Text = "&Edit Value";
// //
// deleteToolStripMenuItem // _menuItemDelete
// //
this._menuItemDelete.Image = ((System.Drawing.Image)(resources.GetObject("deleteToolStripMenuItem.Image"))); this._menuItemDelete.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemDelete.Image")));
this._menuItemDelete.Name = "deleteToolStripMenuItem"; this._menuItemDelete.Name = "_menuItemDelete";
this._menuItemDelete.ShortcutKeys = System.Windows.Forms.Keys.Delete; this._menuItemDelete.ShortcutKeys = System.Windows.Forms.Keys.Delete;
this._menuItemDelete.Size = new System.Drawing.Size(166, 22); this._menuItemDelete.Size = new System.Drawing.Size(166, 22);
this._menuItemDelete.Text = "&Delete"; this._menuItemDelete.Text = "&Delete";
@ -243,18 +243,18 @@
this.searchToolStripMenuItem.Size = new System.Drawing.Size(54, 20); this.searchToolStripMenuItem.Size = new System.Drawing.Size(54, 20);
this.searchToolStripMenuItem.Text = "&Search"; this.searchToolStripMenuItem.Text = "&Search";
// //
// findToolStripMenuItem // _menuItemFind
// //
this._menuItemFind.Image = ((System.Drawing.Image)(resources.GetObject("findToolStripMenuItem.Image"))); this._menuItemFind.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemFind.Image")));
this._menuItemFind.Name = "findToolStripMenuItem"; this._menuItemFind.Name = "_menuItemFind";
this._menuItemFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); this._menuItemFind.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F)));
this._menuItemFind.Size = new System.Drawing.Size(146, 22); this._menuItemFind.Size = new System.Drawing.Size(146, 22);
this._menuItemFind.Text = "Find..."; this._menuItemFind.Text = "Find...";
// //
// findNextToolStripMenuItem // _menuItemFindNext
// //
this._menuItemFindNext.Image = ((System.Drawing.Image)(resources.GetObject("findNextToolStripMenuItem.Image"))); this._menuItemFindNext.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemFindNext.Image")));
this._menuItemFindNext.Name = "findNextToolStripMenuItem"; this._menuItemFindNext.Name = "_menuItemFindNext";
this._menuItemFindNext.ShortcutKeys = System.Windows.Forms.Keys.F3; this._menuItemFindNext.ShortcutKeys = System.Windows.Forms.Keys.F3;
this._menuItemFindNext.Size = new System.Drawing.Size(146, 22); this._menuItemFindNext.Size = new System.Drawing.Size(146, 22);
this._menuItemFindNext.Text = "Find Next"; this._menuItemFindNext.Text = "Find Next";
@ -267,10 +267,10 @@
this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20); this.helpToolStripMenuItem.Size = new System.Drawing.Size(44, 20);
this.helpToolStripMenuItem.Text = "&Help"; this.helpToolStripMenuItem.Text = "&Help";
// //
// aboutToolStripMenuItem // _menuItemAbout
// //
this._menuItemAbout.Image = ((System.Drawing.Image)(resources.GetObject("aboutToolStripMenuItem.Image"))); this._menuItemAbout.Image = ((System.Drawing.Image)(resources.GetObject("_menuItemAbout.Image")));
this._menuItemAbout.Name = "aboutToolStripMenuItem"; this._menuItemAbout.Name = "_menuItemAbout";
this._menuItemAbout.ShortcutKeys = System.Windows.Forms.Keys.F1; this._menuItemAbout.ShortcutKeys = System.Windows.Forms.Keys.F1;
this._menuItemAbout.Size = new System.Drawing.Size(126, 22); this._menuItemAbout.Size = new System.Drawing.Size(126, 22);
this._menuItemAbout.Text = "&About"; this._menuItemAbout.Text = "&About";
@ -288,7 +288,7 @@
this._nodeTree.Margin = new System.Windows.Forms.Padding(0); this._nodeTree.Margin = new System.Windows.Forms.Padding(0);
this._nodeTree.Name = "_nodeTree"; this._nodeTree.Name = "_nodeTree";
this._nodeTree.SelectedImageIndex = 0; this._nodeTree.SelectedImageIndex = 0;
this._nodeTree.Size = new System.Drawing.Size(619, 350); this._nodeTree.Size = new System.Drawing.Size(619, 374);
this._nodeTree.TabIndex = 0; this._nodeTree.TabIndex = 0;
// //
// imageList1 // imageList1
@ -592,22 +592,18 @@
// //
this.ContentPanel.Size = new System.Drawing.Size(562, 376); this.ContentPanel.Size = new System.Drawing.Size(562, 376);
// //
// statusStrip1 // contextMenuStrip1
// //
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripStatusLabel1}); this.testToolStripMenuItem});
this.statusStrip1.Location = new System.Drawing.Point(0, 401); this.contextMenuStrip1.Name = "contextMenuStrip1";
this.statusStrip1.Margin = new System.Windows.Forms.Padding(0, 2, 0, 0); this.contextMenuStrip1.Size = new System.Drawing.Size(97, 26);
this.statusStrip1.Name = "statusStrip1";
this.statusStrip1.Size = new System.Drawing.Size(619, 22);
this.statusStrip1.TabIndex = 1;
this.statusStrip1.Text = "statusStrip1";
// //
// toolStripStatusLabel1 // testToolStripMenuItem
// //
this.toolStripStatusLabel1.Name = "toolStripStatusLabel1"; this.testToolStripMenuItem.Name = "testToolStripMenuItem";
this.toolStripStatusLabel1.Size = new System.Drawing.Size(604, 17); this.testToolStripMenuItem.Size = new System.Drawing.Size(96, 22);
this.toolStripStatusLabel1.Spring = true; this.testToolStripMenuItem.Text = "Test";
// //
// MainForm // MainForm
// //
@ -615,7 +611,6 @@
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(619, 423); this.ClientSize = new System.Drawing.Size(619, 423);
this.Controls.Add(this.statusStrip1);
this.Controls.Add(this.toolStrip1); this.Controls.Add(this.toolStrip1);
this.Controls.Add(this._nodeTree); this.Controls.Add(this._nodeTree);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
@ -627,8 +622,7 @@
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.toolStrip1.ResumeLayout(false); this.toolStrip1.ResumeLayout(false);
this.toolStrip1.PerformLayout(); this.toolStrip1.PerformLayout();
this.statusStrip1.ResumeLayout(false); this.contextMenuStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -678,8 +672,6 @@
private System.Windows.Forms.ToolStripPanel RightToolStripPanel; private System.Windows.Forms.ToolStripPanel RightToolStripPanel;
private System.Windows.Forms.ToolStripPanel LeftToolStripPanel; private System.Windows.Forms.ToolStripPanel LeftToolStripPanel;
private System.Windows.Forms.ToolStripContentPanel ContentPanel; private System.Windows.Forms.ToolStripContentPanel ContentPanel;
private System.Windows.Forms.StatusStrip statusStrip1;
private System.Windows.Forms.ToolStripStatusLabel toolStripStatusLabel1;
private System.Windows.Forms.ToolStripButton _buttonAddTagIntArray; private System.Windows.Forms.ToolStripButton _buttonAddTagIntArray;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem _menuItemCut; private System.Windows.Forms.ToolStripMenuItem _menuItemCut;
@ -693,6 +685,8 @@
private System.Windows.Forms.ToolStripButton _buttonCopy; private System.Windows.Forms.ToolStripButton _buttonCopy;
private System.Windows.Forms.ToolStripButton _buttonPaste; private System.Windows.Forms.ToolStripButton _buttonPaste;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenuItem testToolStripMenuItem;
} }
} }

View file

@ -45,6 +45,7 @@ namespace NBTExplorer
_nodeTree.AfterCollapse += _nodeTree_AfterCollapse; _nodeTree.AfterCollapse += _nodeTree_AfterCollapse;
_nodeTree.AfterSelect += _nodeTree_AfterSelect; _nodeTree.AfterSelect += _nodeTree_AfterSelect;
_nodeTree.NodeMouseDoubleClick += _nodeTree_NodeMouseDoubleClick; _nodeTree.NodeMouseDoubleClick += _nodeTree_NodeMouseDoubleClick;
_nodeTree.NodeMouseClick += _nodeTree_NodeMouseClick;
_nodeTree.DragEnter += _nodeTree_DragEnter; _nodeTree.DragEnter += _nodeTree_DragEnter;
_nodeTree.DragDrop += _nodeTree_DragDrop; _nodeTree.DragDrop += _nodeTree_DragDrop;
@ -192,6 +193,7 @@ namespace NBTExplorer
frontNode.ImageIndex = _iconRegistry.Lookup(node.GetType()); frontNode.ImageIndex = _iconRegistry.Lookup(node.GetType());
frontNode.SelectedImageIndex = frontNode.ImageIndex; frontNode.SelectedImageIndex = frontNode.ImageIndex;
frontNode.Tag = node; frontNode.Tag = node;
frontNode.ContextMenuStrip = BuildNodeContextMenu(node);
if (node.HasUnexpandedChildren) if (node.HasUnexpandedChildren)
frontNode.Nodes.Add(new TreeNode()); frontNode.Nodes.Add(new TreeNode());
@ -199,6 +201,46 @@ namespace NBTExplorer
return frontNode; return frontNode;
} }
private ContextMenuStrip BuildNodeContextMenu (DataNode node)
{
if (node == null)
return null;
ContextMenuStrip menu = new ContextMenuStrip();
if (node.CanReoderNode) {
ToolStripMenuItem itemUp = new ToolStripMenuItem("Move &Up", Properties.Resources.ArrowUp, _contextMoveUp_Click);
ToolStripMenuItem itemDn = new ToolStripMenuItem("Move &Down", Properties.Resources.ArrowDown, _contextMoveDown_Click);
itemUp.Enabled = node.CanMoveNodeUp;
itemDn.Enabled = node.CanMoveNodeDown;
menu.Items.Add(itemUp);
menu.Items.Add(itemDn);
}
return (menu.Items.Count > 0) ? menu : null;
}
private void _contextMoveUp_Click (object sender, EventArgs e)
{
TreeNode frontNode = _nodeTree.SelectedNode;
if (frontNode == null)
return;
DataNode node = frontNode.Tag as DataNode;
if (node == null || !node.CanMoveNodeUp)
return;
node.ChangeRelativePosition(-1);
RefreshChildNodes(frontNode.Parent, node.Parent);
}
private void _contextMoveDown_Click (object sender, EventArgs e)
{
}
private void ExpandNode (TreeNode node) private void ExpandNode (TreeNode node)
{ {
if (node == null || !(node.Tag is DataNode)) if (node == null || !(node.Tag is DataNode))
@ -257,7 +299,18 @@ namespace NBTExplorer
currentNodes.Add(child.Tag as DataNode, child); currentNodes.Add(child.Tag as DataNode, child);
} }
node.Nodes.Clear();
foreach (DataNode child in dataNode.Nodes) { foreach (DataNode child in dataNode.Nodes) {
if (!currentNodes.ContainsKey(child))
node.Nodes.Add(CreateUnexpandedNode(child));
else
node.Nodes.Add(currentNodes[child]);
}
foreach (TreeNode child in node.Nodes)
child.ContextMenuStrip = BuildNodeContextMenu(child.Tag as DataNode);
/*foreach (DataNode child in dataNode.Nodes) {
if (!currentNodes.ContainsKey(child)) if (!currentNodes.ContainsKey(child))
node.Nodes.Add(CreateUnexpandedNode(child)); node.Nodes.Add(CreateUnexpandedNode(child));
else else
@ -266,7 +319,7 @@ namespace NBTExplorer
foreach (TreeNode child in currentNodes.Values) { foreach (TreeNode child in currentNodes.Values) {
node.Nodes.Remove(child); node.Nodes.Remove(child);
} }*/
if (node.Nodes.Count == 0 && dataNode.HasUnexpandedChildren) { if (node.Nodes.Count == 0 && dataNode.HasUnexpandedChildren) {
ExpandNode(node); ExpandNode(node);
@ -629,6 +682,12 @@ namespace NBTExplorer
EditNode(e.Node); EditNode(e.Node);
} }
private void _nodeTree_NodeMouseClick (object sender, TreeNodeMouseClickEventArgs e)
{
if (e.Button == MouseButtons.Right)
_nodeTree.SelectedNode = e.Node;
}
private void _nodeTree_DragDrop (object sender, DragEventArgs e) private void _nodeTree_DragDrop (object sender, DragEventArgs e)
{ {
OpenPaths((string[])e.Data.GetData(DataFormats.FileDrop)); OpenPaths((string[])e.Data.GetData(DataFormats.FileDrop));

View file

@ -112,16 +112,16 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value> <value>17, 17</value>
</metadata> </metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="openToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACkklEQVQ4T43SX0hTURzA8d9b YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACkklEQVQ4T43SX0hTURzA8d9b
@ -139,7 +139,7 @@
gg== gg==
</value> </value>
</data> </data>
<data name="openFolderToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemOpenFolder.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAI/SURBVDhPjdJPSJNxGAfw5xYd6+hZJIhCkm5d8hBeIq/9 YQUAAAAJcEhZcwAADrwAAA68AZW8ckkAAAI/SURBVDhPjdJPSJNxGAfw5xYd6+hZJIhCkm5d8hBeIq/9
@ -155,7 +155,7 @@
8h/ayQIkRwIF8QAAAABJRU5ErkJggg== 8h/ayQIkRwIF8QAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="saveToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemSave.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAABwklEQVQ4T6XOT0iTcRzH8e+e YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAABwklEQVQ4T6XOT0iTcRzH8e+e
@ -169,7 +169,7 @@
L1tJUV/SlAd3xCblH+s4aw2T/BzJAAAAAElFTkSuQmCC L1tJUV/SlAd3xCblH+s4aw2T/BzJAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="exitToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemExit.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAB/UlEQVQ4T41SS0tVURjdEwc5 YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAB/UlEQVQ4T41SS0tVURjdEwc5
@ -184,7 +184,7 @@
OFkM9KlfL99lseAvRjbC0XMbRtAAAAAASUVORK5CYII= OFkM9KlfL99lseAvRjbC0XMbRtAAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="cutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemCut.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACCUlEQVQ4T6VSPWgTYRh+v/0Q YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACCUlEQVQ4T6VSPWgTYRh+v/0Q
@ -199,7 +199,7 @@
D3GK4zgfBQ4DB4ED+ziEeQQ4lvL6LPgNwitoieNYTCsAAAAASUVORK5CYII= D3GK4zgfBQ4DB4ED+ziEeQQ4lvL6LPgNwitoieNYTCsAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="copyToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAB70lEQVQ4T42SPUubYRSGz+Kg YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAB70lEQVQ4T42SPUubYRSGz+Kg
@ -214,7 +214,7 @@
gsnRJ2HiAAAAAElFTkSuQmCC gsnRJ2HiAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="pasteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemPaste.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACc0lEQVQ4T43SW0hUURQG4PWS YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACc0lEQVQ4T43SW0hUURQG4PWS
@ -231,7 +231,7 @@
CBL/g/dyjRT1G7y5F+bDPK+HAAAAAElFTkSuQmCC CBL/g/dyjRT1G7y5F+bDPK+HAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="renameToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemRename.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAt0lEQVQ4T6VSSwoCMQxNTzBL YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAAt0lEQVQ4T6VSSwoCMQxNTzBL
@ -241,7 +241,7 @@
TkSuQmCC TkSuQmCC
</value> </value>
</data> </data>
<data name="editValueToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemEditValue.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADaWlUWHRYTUw6Y29tLmFkb2Jl YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAADaWlUWHRYTUw6Y29tLmFkb2Jl
@ -271,7 +271,7 @@
Q2Xb0J1nxd38XsIUM5uZjcwGZj2zjlnDrF4IyWsQfwCLISjKZ5nx7AAAAABJRU5ErkJggg== Q2Xb0J1nxd38XsIUM5uZjcwGZj2zjlnDrF4IyWsQfwCLISjKZ5nx7AAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="deleteToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemDelete.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAABfUlEQVQ4T6WTu0vDUBTGz1+g YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAABfUlEQVQ4T6WTu0vDUBTGz1+g
@ -284,7 +284,7 @@
yd/5G8s+qAWdGU8YAAAAAElFTkSuQmCC yd/5G8s+qAWdGU8YAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="findToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemFind.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACDElEQVQ4T42SzWoaURTHRxER YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACDElEQVQ4T42SzWoaURTHRxER
@ -299,7 +299,7 @@
NX+l/xHGiv/JWz3cK/mJEPGGePufcC33+P8AbaoESlToQpYAAAAASUVORK5CYII= NX+l/xHGiv/JWz3cK/mJEPGGePufcC33+P8AbaoESlToQpYAAAAASUVORK5CYII=
</value> </value>
</data> </data>
<data name="findNextToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemFindNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACZElEQVQ4T4WSXWhSYRjHj8Ns YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAACZElEQVQ4T4WSXWhSYRjHj8Ns
@ -316,7 +316,7 @@
WupUAAAAAElFTkSuQmCC WupUAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="aboutToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_menuItemAbout.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAC5klEQVQ4T12OX0iTURjGD4kM YQUAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAC5klEQVQ4T12OX0iTURjGD4kM
@ -335,7 +335,7 @@
QtiJ+A2+oxJO8d3MEAAAAABJRU5ErkJggg== QtiJ+A2+oxJO8d3MEAAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="imageList1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>237, 17</value> <value>237, 17</value>
</metadata> </metadata>
<data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="imageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
@ -343,7 +343,7 @@
AAEAAAD/////AQAAAA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rgFcAYQBrgFcAYQBrgFcAYQBrgFcAYQBrgGWAakBvAMAAs8BywK5
@ -567,7 +567,7 @@
AcABDwHAAQ8L AcABDwHAAQ8L
</value> </value>
</data> </data>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value> <value>132, 17</value>
</metadata> </metadata>
<data name="_buttonOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_buttonOpen.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -620,14 +620,14 @@
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHBSURBVDhPrVI9SAJhGH5vlygi+jFIBJEb4pwECQTBRaRB YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAHBSURBVDhPrVI9SAJhGH5vlygi+jFIBJEb4pwECQTBRaRB
aQmbrFmkwOQmMQLnGowiaIsapJaIhHAQghAu4pakRSgkbomgqCC/3ufDCxWThoSH93ufv/tOJfqPTzwe aQmbrFmkwOQWwQicazCKoC1qkFoiEsJBCEK4iFuSFqGQuKWGioL8ep8PL1RMGhIe3u99/u47leg/PvF4
n4/FYtpfuuCDv8ubTCZ1IBqNDiyBbnu7Cjwej24YhkgkEnooFOpbAh46fPD33lYDaZqm4CvqPp+vqwQ7 fD4Wi2l/6YIP/i5vMpnUgWg0OrAEuu3tKvB4PLphGCKRSOihUKhvCXjo8MHfe1sNpGmagq+o+3y+rhLs
eOjtcN+HaF6vV6/X6yISiehslCZM7OChMzXwNWVJo9EQwWBQdzqdC5jY/xKWrzXHT1BVVW82myIcDl9U 4KG3w30fonm9Xr1er4tIJKKzUZowsYOHztTA15QljUZDBINB3el0LmBi/0tYvtYcP0FVVb3ZbIpwOHxR
KhWBHfyvv9ITkeORaPFBUbYYxyVFKW+4XKZlWaLqcJg3vIOHDh/8P2UmL/eKsmkFArW3VOr5PZdriUJB qVQEdvC//kpPRI5HosUHRdliHJcUpbzhcpmWZYmqw2He8A4eOnzw/5SZvNwryqYVCNTeUqnn91yuJQoF
3KbT4pLoFWcAPHT44EdOlhhESw2/34DpxO2+2yaqfeXz4oznOVEREzt46PDBj5wsqCrKfmf4I5MRp2xm cZtOi0uiV5wB8NDhgx85WWIQLTX8fgOmE7f7bpuo9pXPizOe50RFTOzgocMHP3KyoKoo+53hj0xGnLKZ
SAMmdvCdJcjJghJR+SWTaUH8zGbFIc8ju739otjBQ4cPfuSkvEO0e61pTdzigMX1nrD9ZYGHDh/8yEnN IQ2Y2MF3liAnC0pE5ZdMpgXxM5sVhzyP7Pb2i2IHDx0++JGT8g7R7rWmNXGLAxbXe8L2lwUeOnzwIyc1
SxQqEu0xcbVMtMbULP4/jBmGkzHNcDPUFaJV+OBHzi6f4oONST6PM0YZw4yhNkZ4jjEmOrzI0DcBiOxD L1GoSLTHxNUy0RpTs/j/MGYYTsY0w81QV4hW4YMfObt8ig82Jvk8zhhlDDOG2hjhOcaY6PAiQ9/1tew7
XRtgPgAAAABJRU5ErkJggg== AaBXEgAAAABJRU5ErkJggg==
</value> </value>
</data> </data>
<data name="_buttonCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_buttonCopy.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
@ -820,31 +820,31 @@
iVBORw0KGgoAAAANSUhEUg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uTAeJQWD9AANkAMZwg/E4kAsRSIG6QHppQwAAHQM3UJ+qMqfAAAAAElFTkSuQmCC PTAD5FKNGee1uTAeJQWD9AANkAMZwg/E4kAsRSIG6QHppQwAAG603UBJm0MXAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<data name="_buttonFindNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="_buttonFindNext.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPhVJdaJJRGFbRLhSnOGRQ3dQggroTYjoQTQ3X YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAJQSURBVDhPhVJdaJJRGFbRLhSnOGQwuqlBBHUnxHQgmhqu
KMX/zc/l0qWJ/z9JZtgocdBdEWNdBEFBF9vNGI3ASpK6iEV2EQxGQfRD0W0X0S6ezvvht32tUR88nPe8 UYr/m5/LpUsT9fM3yQwbJQ66K2KsiyAo6GK7GaMRWElSF9HILoLBKIh+KLrtItrF03k/dPtaoz54OO95
z/M+5/3ecyQS0SeVSmcZFmkV5yn+F7elZaKlarUKtVrd3mlAOeJIs5Pj94y4qtfrX9ntdtDKcFsQUizm n+d9zvu950gkok8qlc4xLNEqzlP8L25by0TLlUoFarW6tduAcsSRZjcn7BlxVa/Xr9vtdtDKcLsvpFjM
SPuXCUsuN5tNlEol5HIl6HS6nhjEVasXkM3mqYvl3QxWGo0GIhEOXm8YBoMB+XyeB8XExWIxeDwBMljZ kfYvE5ZcaTQaKBaL4PkidDpdVwziKpULyGZz1MXKXgar9XodkQgHrzc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fh/2Hdq4Y7iRPNcr2bgN3SrJ86cZttBAAAAAElFTkSuQmCC
</value> </value>
</data> </data>
<metadata name="statusStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="contextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>527, 17</value> <value>347, 17</value>
</metadata> </metadata>
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View file

@ -146,6 +146,21 @@ namespace NBTExplorer.Model
get { return (Capabilities & NodeCapabilities.Search) != NodeCapabilities.None; } get { return (Capabilities & NodeCapabilities.Search) != NodeCapabilities.None; }
} }
public virtual bool CanReoderNode
{
get { return (Capabilities & NodeCapabilities.Reorder) != NodeCapabilities.None; }
}
public virtual bool CanMoveNodeUp
{
get { return false; }
}
public virtual bool CanMoveNodeDown
{
get { return false; }
}
public virtual bool CanCreateTag (TagType type) public virtual bool CanCreateTag (TagType type)
{ {
return false; return false;
@ -190,6 +205,11 @@ namespace NBTExplorer.Model
return false; return false;
} }
public virtual bool ChangeRelativePosition (int offset)
{
return false;
}
#endregion #endregion
} }
} }

View file

@ -14,5 +14,6 @@ namespace NBTExplorer.Model
Delete = 0x20, Delete = 0x20,
CreateTag = 0x40, CreateTag = 0x40,
Search = 0x80, Search = 0x80,
Reorder = 0x100,
} }
} }

View file

@ -57,6 +57,7 @@ namespace NBTExplorer.Model
| NodeCapabilities.Delete | NodeCapabilities.Delete
| NodeCapabilities.PasteInto | NodeCapabilities.PasteInto
| (TagParent.IsNamedContainer ? NodeCapabilities.Rename : NodeCapabilities.None) | (TagParent.IsNamedContainer ? NodeCapabilities.Rename : NodeCapabilities.None)
| (TagParent.IsOrderedContainer ? NodeCapabilities.Reorder : NodeCapabilities.None)
| NodeCapabilities.Search; | NodeCapabilities.Search;
} }
} }
@ -158,7 +159,28 @@ namespace NBTExplorer.Model
| NodeCapabilities.Cut | NodeCapabilities.Cut
| NodeCapabilities.Delete | NodeCapabilities.Delete
| NodeCapabilities.Edit | NodeCapabilities.Edit
| (TagParent.IsNamedContainer ? NodeCapabilities.Rename : NodeCapabilities.None); | (TagParent.IsNamedContainer ? NodeCapabilities.Rename : NodeCapabilities.None)
| (TagParent.IsOrderedContainer ? NodeCapabilities.Reorder : NodeCapabilities.None);
}
}
public override bool CanMoveNodeUp
{
get
{
if (TagParent.IsOrderedContainer)
return TagParent.OrderedTagContainer.GetTagIndex(Tag) > 0;
return false;
}
}
public override bool CanMoveNodeDown
{
get
{
if (TagParent.IsOrderedContainer)
return TagParent.OrderedTagContainer.GetTagIndex(Tag) < (TagParent.TagCount - 1);
return false;
} }
} }
@ -238,6 +260,27 @@ namespace NBTExplorer.Model
return false; return false;
} }
public override bool ChangeRelativePosition (int offset)
{
if (CanReoderNode) {
int curIndex = TagParent.OrderedTagContainer.GetTagIndex(Tag);
int newIndex = curIndex + offset;
if (newIndex < 0 || newIndex >= TagParent.OrderedTagContainer.TagCount)
return false;
TagParent.OrderedTagContainer.DeleteTag(Tag);
TagParent.OrderedTagContainer.InsertTag(Tag, newIndex);
DataNode parent = Parent;
parent.Nodes.Remove(this);
parent.Nodes.Insert(newIndex, this);
return true;
}
return false;
}
protected bool EditScalarValue (TagNode tag) protected bool EditScalarValue (TagNode tag)
{ {
EditValue form = new EditValue(tag); EditValue form = new EditValue(tag);

View file

@ -119,13 +119,23 @@
<Compile Include="Model\NodeCapabilities.cs" /> <Compile Include="Model\NodeCapabilities.cs" />
<Compile Include="Model\RegionChunkDataNode.cs" /> <Compile Include="Model\RegionChunkDataNode.cs" />
<Compile Include="Model\RegionFileDataNode.cs" /> <Compile Include="Model\RegionFileDataNode.cs" />
<Compile Include="Model\TagByteArrayDataNode.cs" />
<Compile Include="Model\TagByteDataNode.cs" />
<Compile Include="Model\TagCompoundDataNode.cs" /> <Compile Include="Model\TagCompoundDataNode.cs" />
<Compile Include="Model\TagContainerInterface.cs" /> <Compile Include="Model\TagContainerInterface.cs" />
<Compile Include="Model\TagDataNode.cs" /> <Compile Include="Model\TagDataNode.cs" />
<Compile Include="Model\TagDoubleDataNode.cs" />
<Compile Include="Model\TagFloatDataNode.cs" />
<Compile Include="Model\TagIntArrayDataNode.cs" />
<Compile Include="Model\TagIntDataNode.cs" />
<Compile Include="Model\TagListDataNode.cs" /> <Compile Include="Model\TagListDataNode.cs" />
<Compile Include="Model\TagLongDataNode.cs" />
<Compile Include="Model\TagShortDataNode.cs" />
<Compile Include="Model\TagStringDataNode.cs" />
<Compile Include="NbtClipboardData.cs" /> <Compile Include="NbtClipboardData.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SearchWorker.cs" />
<Compile Include="TagKey.cs" /> <Compile Include="TagKey.cs" />
<Compile Include="Vendor\Be.Windows.Forms.HexBox\BuiltInContextMenu.cs"> <Compile Include="Vendor\Be.Windows.Forms.HexBox\BuiltInContextMenu.cs">
<SubType>Component</SubType> <SubType>Component</SubType>
@ -196,6 +206,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="dead_bush.ico" /> <Content Include="dead_bush.ico" />
<None Include="Resources\arrow-090.png" />
<None Include="Resources\arrow-270.png" />
<Content Include="Vendor\Be.Windows.Forms.HexBox\HexBox.bmp" /> <Content Include="Vendor\Be.Windows.Forms.HexBox\HexBox.bmp" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />

View file

@ -59,5 +59,19 @@ namespace NBTExplorer.Properties {
resourceCulture = value; resourceCulture = value;
} }
} }
internal static System.Drawing.Bitmap ArrowDown {
get {
object obj = ResourceManager.GetObject("ArrowDown", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
internal static System.Drawing.Bitmap ArrowUp {
get {
object obj = ResourceManager.GetObject("ArrowUp", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
} }
} }

View file

@ -112,9 +112,16 @@
<value>2.0</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ArrowDown" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-270.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ArrowUp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\arrow-090.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root> </root>

BIN
Resources/arrow-090.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 618 B

BIN
Resources/arrow-270.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B