作图控件北京图王的Visual Graph在PB中的应用

本文档详细介绍了如何在PowerBuilder 11.5中使用北京图王的Visual Graph控件,提供了创建测试窗口w_test的代码示例,包括控件注册、事件处理等,帮助开发者了解如何调用和操作该图形控件。
摘要由CSDN通过智能技术生成

在网上找了半天都没有发现用Powerbuilder调用Visual Graph控件的例子,就是北京图王公司的网站上都没有pb的例子。现在做了一个,供大家参考。

这是一个测试窗口w_test的代码,用PB11.5写的,在导入到PBL库之前先注册Visual Graph控件。

forward
global type w_test from window
end type
type cb_5 from commandbutton within w_test
end type
type cb_3 from commandbutton within w_test
end type
type vgctrl2 from olecustomcontrol within w_test
end type
type cb_4 from commandbutton within w_test
end type
type cb_2 from commandbutton within w_test
end type
type cb_1 from commandbutton within w_test
end type
type vgctrl1 from olecustomcontrol within w_test
end type
end forward

global type w_test from window
integer width = 2770
integer height = 1728
boolean titlebar = true
string title = "Untitled"
boolean controlmenu = true
boolean minbox = true
boolean maxbox = true
boolean resizable = true
long backcolor = 67108864
string icon = "AppIcon!"
boolean center = true
cb_5 cb_5
cb_3 cb_3
vgctrl2 vgctrl2
cb_4 cb_4
cb_2 cb_2
cb_1 cb_1
vgctrl1 vgctrl1
end type
global w_test w_test

on w_test.create
this.cb_5=create cb_5
this.cb_3=create cb_3
this.vgctrl2=create vgctrl2
this.cb_4=create cb_4
this.cb_2=create cb_2
this.cb_1=create cb_1
this.vgctrl1=create vgctrl1
this.Control[]={this.cb_5,&
this.cb_3,&
this.vgctrl2,&
this.cb_4,&
this.cb_2,&
this.cb_1,&
this.vgctrl1}
end on

on w_test.destroy
destroy(this.cb_5)
destroy(this.cb_3)
destroy(this.vgctrl2)
destroy(this.cb_4)
destroy(this.cb_2)
destroy(this.cb_1)
destroy(this.vgctrl1)
end on

event open;vgctrl1.object.design(gs_hlp_path+"test.tbl")
vgctrl2.object.run(gs_hlp_path+"电脑设备.tbl")
end event

type cb_5 from commandbutton within w_test
integer x = 1591
integer y = 1408
integer width = 457
integer height = 112
integer taborder = 40
integer textsize = -10
integer weight = 400
fontcharset fontcharset = ansi!
fontpitch fontpitch = variable!
fontfamily fontfamily = swiss!
string facename = "Arial"
string text = "保护

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
一、Visual Graph重要文件 1.bin\ide.exe是绘图软件,您在此可以设计图库、绘制图形文件,这个软件的所有界面都是可以修改的。 2.bin\vg.dll是ActiveX控件,在许多编程语言使用,使用步骤如下: a)运行bin\registeractivex.bat注册控件到您的计算机,如果失败,以管理员身份运行cmd.exe,然后再运行regsvr32.exe bin\vg.dll注册(请不要把v.dll拷贝到windows\system32目录下)。 b)进入编程语言,在工具栏上安装COM组件Visual Graph ActiveX control(Visual Graph不能运行在WEB服务端,如果开发ASP.net,工具栏看不到这个) c)把控件拖动到画面 d)在窗口的Load事件(或Show)事件编写如下代码: vgctrl1.Design( "" )设计一个新图形文件 vgctrl1.Run( "" )运行一个新图形文件 vgctrl1.Design( vgctrl1.DefaultPath + "..\demo\电力\秦山核电站.tbl" )设计秦山核电站这张电力接线图 vgctrl1.Run( vgctrl1.DefaultPath + "..\demo\电力\秦山核电站.tbl" )是秦山核电站这张电力接线图的运行状态 接下来就可以通过程序对画面上的各种图形对象进行编程了,具体请参考入门手册 http://www.visual-graph.com/rumen.htm 3.bin\vg.chm是帮助系统 4.source目录下是csharp2010、delphi7.0、vb6.0、vc6.0使用Visual Graph ActiveX的示例 5.web目录下是互联网应用使用的cab文件打包批处理程序 6.lib目录下是若干例子图库 7.demo目录下是若干图形文件的示例 二、发布Visual Graph ActiveX时必需要包含的文件 1 : bin\vg.dll ActiveX控件 2 : bin\funcs.dll 外部函数库 3 : bin\kernel.dll 技术核心库 4 : bin\units.dll 基础图形库 5 : bin\consts.bas 启动脚本,在此可以定义一些非常重要的全局常量 6 : bin\arrows.tbl 自定义线条箭头库 7 : bin\cursors.tbl 光标库,没有这个,鼠标移动时将看不见 8 : bin\hintwindow.tbl 提示窗口,当鼠标移动到某对象时显示的那种提示窗口 9 : bin\library.tbl 基础图形的画法,包含线条的各种画法 10: bin\page.tbl 打印设置对话盒 11: bin\controls.tbl 打印设置窗口使用的控件库,包括按钮、下拉列表框、选择框等等 12: bin\patterns.tbl 图案文件 三、如果在互联网(IE)使用,需要把用到的文件打包成CAB文件,可参考web\makecab.bat里面的内容,自行增加要打包的文件,然后运行这个批处理程序,打包后的CAB文件的使用方法参见web\design.htm,自行打包的CAB文件在IE里会被拦截,请调低IE的安全等级,允许ActiveX在IE使用和运行脚本。如果想不被IE拦截,请使用我公司网站上提供的http://www.visual-graph.com/activex/vg.cab,或者自行向数字签名公司购买签名服务。
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值