Iconics genesis64组态软件WPF基础开发(2)

阅读更多

前两天刚刚把组态软件扔到WPF上,今天要继续啊!

 

这个组态软件Iconics Genesis64 完全是基于WIndows规范开发的。API简单的不可思议,。。。但是还是没有找到能够简单写鼠标移动和滚轮缩放的方法。。。不想按Alt键啊!!!!!还有跳转或者事件的监听也木有找到啊!!!


关于操作:

其实就是这个类
GwxConfiguration
下边是API文档里对GwxConfiguration的定义。
This class contains methods/properties used for configuration of display files.
In scripting, an object of this type is accessible via the "ThisConfiguration" global variable. The value of the "ThisConfiguration" variable is the GwxConfiguration object that can be used to edit the currently loaded display file.

 

操作就更简单了。

声明GwxConfiguration:

GwxRuntimeViewControl gwxRuntimeViewControl = new GwxRuntimeViewControl();
       
public GwxConfiguration GwxConfig
{
get
    {
        return gwxRuntimeViewControl.Configuration as GwxConfiguration;
    }
}

 
  

 

 

这样。使用this.GwxConfig.GetObjectByName("XX")就可以得到相应的元素。

 

然后,不论是使用Visble操作(显示/隐藏)或者是用GetCenter得到中心点然后GwxRuntimeViewControlZoomToXXX之类的方法跳转到这个设备就都很方便了。

 

在genesis64中,不管是GwxLayer、GwxGroup或者是任何的界面元素GwxElement(包括方块GwxRectangle等等等),都可以用这个方法得到。当然,你要在软件中给界面元素一个唯一的Name才行。


PS:一定要引用GwxConfigCore.dll这个dll!!!!要不连Ico.Gwx下边连GwxConfiguration类都找不到。

最近有点精神恍惚了。。。。

你可能感兴趣的:(Iconics genesis64组态软件WPF基础开发(2))