DebugST / STNodeEditor

一款基于.Net WinForm的节点编辑器 纯GDI+绘制 使用方式非常简洁 提供了丰富的属性以及事件 可以非常方便的完成节点之间数据的交互及通知 大量的虚函数供开发者重写具有很高的自由性
MIT License
610 stars 187 forks source link

希望可以添加动态节点的支持 #8

Open kkle1994 opened 1 year ago

kkle1994 commented 1 year ago

在很多场景里,节点一般都不是固定的,如果可以支持动态节点就更好了。 我自己也在尝试改STNodeTreeView相关的代码,但是因为工作时间比较紧张,不知道能不能做成泛用性好些的代码,只是一个小小的建议。感谢你的工作 : )

kkle1994 commented 1 year ago

我现在的做法是做了一个template类,每次node在OnCreate的时候,从template里读取,唯一的问题是需要在TreeView做一个新的Add,然后在view里面做一个Dictionary结构记录:Node类、Template实例,还在开发当中,不过我的template是为了项目特化的,但是可以稍微改下就能用。只会我会考虑fork一下开个新的branch分享一下(如果有时间的话)

DebugST commented 1 year ago

在很多场景里,节点一般都不是固定的,如果可以支持动态节点就更好了。 我自己也在尝试改STNodeTreeView相关的代码,但是因为工作时间比较紧张,不知道能不能做成泛用性好些的代码,只是一个小小的建议。感谢你的工作 : )

我有些不是很明白是什么意思。。动态更新?。。自带的TreeView是可以支持添加NodeType的啊。。所以我有点懵。。而且TreeView的结构 目前也是一个目录的结构只要给节点一个路径就可以了。

kkle1994 commented 1 year ago

我这边目前的需求是从Go语言里读到一些struct,之后在这个控件里作为node来显示,这个是动态的意思。大概就是要根据一个模板批量创建node的类型,他的Class不是固定的,而且需要在Tree里面分开显示,比如一个“Condition”的模板,会有几十个需要对应的Node的Class,而且要根据Golang里面的代码动态变化一些内容,之后分开显示到tree里面这样。

bloxofcodes commented 1 year ago

Hello I'm looking also on this solution of dynamic nodes, but from me the structure will come from .json file? din you already implement the dynamic approach you want to do? @kkle1994

kkle1994 commented 11 months ago

Hello I'm looking also on this solution of dynamic nodes, but from me the structure will come from .json file? din you already implement the dynamic approach you want to do? @kkle1994

I've used another library to replace this, hope this can help you