forked from OpenXRay/xray-16
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7cefcdf
commit f2a6a3d
Showing
22 changed files
with
1,599 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/editors/xrSdkControls/Controls/Interfaces/ITreeViewSource.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
namespace XRay.SdkControls | ||
{ | ||
public interface ITreeViewSource | ||
{ | ||
TreeView Parent | ||
{ | ||
get; | ||
set; | ||
} | ||
|
||
void Refresh(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
namespace XRay.SdkControls | ||
{ | ||
public enum TreeNodeType | ||
{ | ||
SingleItem, | ||
GroupItem | ||
} | ||
|
||
public class TreeNode : System.Windows.Forms.TreeNode | ||
{ | ||
public TreeNode() {} | ||
|
||
public TreeNode(string name) : base(name) => Name = name; | ||
|
||
public TreeNode(string name, int imageIndex, int selectedImageIndex) | ||
: base(name, imageIndex, selectedImageIndex) => Name = name; | ||
|
||
public TreeNode(string name, int imageIndex, int selectedImageIndex, System.Windows.Forms.TreeNode[] children) | ||
: base(name, imageIndex, selectedImageIndex, children) => Name = name; | ||
|
||
public TreeNode(string name, System.Windows.Forms.TreeNode[] children) | ||
: base(name, children) => Name = name; | ||
|
||
public TreeNodeType NodeType; | ||
|
||
public new bool IsSelected; | ||
public int ImageIndexExpanded; | ||
public int ImageIndexCollapsed; | ||
|
||
public new TreeNode Parent => base.Parent as TreeNode; | ||
|
||
public TreeNode AddNodeSingle(string name, int imageIndex = -1) | ||
{ | ||
TreeNode node = new TreeNode(name) | ||
{ | ||
NodeType = TreeNodeType.SingleItem, | ||
ContextMenuStrip = ContextMenuStrip | ||
}; | ||
|
||
if (imageIndex == -1) | ||
{ | ||
node.ImageIndex = 2; | ||
node.SelectedImageIndex = 2; | ||
} | ||
else | ||
{ | ||
node.ImageIndex = imageIndex; | ||
node.SelectedImageIndex = imageIndex; | ||
} | ||
|
||
Nodes.Add(node); | ||
return node; | ||
} | ||
|
||
public TreeNode AddNodeGroup(string name, int imageIndexExpanded = -1, int imageIndexCollapsed = -1) | ||
{ | ||
TreeNode node = new TreeNode(name) | ||
{ | ||
ImageIndexCollapsed = imageIndexCollapsed, | ||
ImageIndexExpanded = imageIndexExpanded, | ||
Name = name, | ||
NodeType = TreeNodeType.SingleItem, | ||
ContextMenuStrip = ContextMenuStrip | ||
}; | ||
|
||
if (imageIndexCollapsed == -1) | ||
{ | ||
node.ImageIndex = 0; | ||
node.SelectedImageIndex = 0; | ||
} | ||
else | ||
{ | ||
node.ImageIndex = imageIndexCollapsed; | ||
node.SelectedImageIndex = imageIndexCollapsed; | ||
} | ||
|
||
Nodes.Add(node); | ||
return node; | ||
} | ||
} | ||
} |
90 changes: 90 additions & 0 deletions
90
src/editors/xrSdkControls/Controls/TreeView/TreeView.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.