看看偶做的数据窗口!

tchatcha 2003-07-18 02:26:19
ftp://csdn:csdn@a9.shtip.com.cn/datawindow.bmp
...全文
38 69 打赏 收藏 转发到动态 举报
写回复
用AI写文章
69 条回复
切换为时间正序
请发表友善的回复…
发表回复
Hanson_bati_zhu 2003-07-23
  • 打赏
  • 举报
回复
to:tchatcha
建议你看看我前面推荐的文章,对你会有很大帮助的
tchatcha 2003-07-23
  • 打赏
  • 举报
回复
可以看得出主要是通过动态增加数据窗口对象实现的,所以你可以自己写函数增加图形,线,矩形框,一切数据窗口对象都可以。
你可以把函数的参数当成一个表字段来生成一个表,这样你就可以做出你自己想要的效果图了
tchatcha 2003-07-23
  • 打赏
  • 举报
回复
1.首先自己生成一个外部数据源对象的数据窗口对象,只一个字段就行,如 vidise string
2.按下面语句生成一个全局函数
//--------------------------------------------------------------------//
// Function - addtext
// description:增加文本
// Arguments: datawindow dataview < 数据窗口容器>
// string ps_textname <文本的name>
// string ps_text <文本内容>
// long pl_x,pl_y,pl_width,pl_height
// long pl_fontsize <字体号>
// long pl_color <前景色>
// long pl_backcolor<背景色>
// long pl_format <显示格式>
// boolean pb_ischeck <是否检查>
// Returns: (INTEGER) 1 sucess, -1 failse 0 objectname已经存在
// Author: whyin Date: October, 2001
//--------------------------------------------------------------------//
string ls_moding,ls_move,ls_adjust

////检查名称是否存在
//if pb_ischeck then
// if isobjectexist(dataview,ps_textname) then return 0
//end if

ls_moding = ' create text(band=detail alignment="0" text="'+ps_text+&
'" border="'+string(pl_format)+'" color="'+string(pl_color)+'" x="'+string(pl_x)+'" y="'+string(pl_y)+'" name='+ps_textname+&
' height="'+string(pl_height)+'" width="'+string(pl_width)+'" font.face="宋体" font.height="'+string(pl_fontsize)+'" font.weight="400" '+&
' font.family="2" font.pitch="2" font.charset="134" background.mode="2" '+ &
'background.color="'+string(pl_backcolor)+'" )'
dataview.modify(ls_moding)
return 1

3.做一个窗口,有一个按钮,按钮的clicked事件如下
string ls_namecabin,ls_XYname,ls_name,ls_slottitle
long ll_layers,ll_grids,i,ll_colorcabinreg,ll_colorXY,j,ll_color

dw_1.settransobject(sqlca)
dw_1.insertrow(0)
dw_1.setredraw(false)

ll_layers = 4
ll_grids = 4
ll_colorcabinreg =rgb(125,98,234)
ll_colorXY = rgb(98,125,124)
ll_color= rgb(198,112,56)

for i = 1 to ll_layers + 1
ls_namecabin = "cabiny_" + string(i)
addtext(dw_1,ls_namecabin," ", 80, (80 + (i - 1) * 358 ) , (ll_grids)*138 + 5 ,5,&
-9,0,ll_colorcabinreg,6,false)
next
for i = 1 to ll_layers
ls_XYname = "Y_" +string(i)
addtext(dw_1,ls_XYname,string(i), 0, (218 + (i - 1) * 358 ) , 70 ,70,&
-9,0,ll_colorXY,6,false)
next

//绘纵向
for i = 1 to ll_grids + 1
ls_namecabin = "cabinx_" + string(i)

addtext(dw_1,ls_namecabin," ", (80 + (i - 1) * 138 ),90 ,5 ,(ll_layers ) * 358 -5 ,&
-9,0,ll_colorcabinreg,6,false)
next

for i = 1 to ll_grids
ls_XYname = "X_" +string(i)

addtext(dw_1,ls_XYname,string(i), (128 +(i - 1) * 138 ),0,70 ,70,&
-9,0,ll_colorXY,6,false)
next
for i = 1 to ll_layers
for j = 1 to ll_grids
ls_name='text_'+string(i)+'_'+string(j)
ls_slottitle = string(i)+'_'+string(j)
addtext(dw_1,ls_name,ls_slottitle,(108 + (i - 1)*138), (108 + (j - 1) * 358),90,310,&
-9,0,ll_color,5,false)
next
next
dw_1.setredraw(true)


剩下就是看看效果
linleming 2003-07-23
  • 打赏
  • 举报
回复
谢谢!llm.luori@tom.com
紫炎圣骑 2003-07-23
  • 打赏
  • 举报
回复
我也看不到了!!


顶!
pbtech 2003-07-23
  • 打赏
  • 举报
回复
aty283 2003-07-23
  • 打赏
  • 举报
回复
给我一个 !!!
baishui283@163.net
谢谢 谢谢
也让 小弟 学习 学习
yangjinok 2003-07-23
  • 打赏
  • 举报
回复
gz
wuhanjuan 2003-07-23
  • 打赏
  • 举报
回复
太高了
tchatcha 2003-07-23
  • 打赏
  • 举报
回复
好,中午我给大家一个基本的例子。
Hanson_bati_zhu 2003-07-23
  • 打赏
  • 举报
回复
to:tchatcha
你为什么不把数据窗口内的对象的处理抽象成统一的过程呢?

另外,能否把你的设计思路写一个比较完整的,这样对大家也更有帮助
tchatcha 2003-07-23
  • 打赏
  • 举报
回复
非常感谢 Hanson_bati_zhu(欺世盗名之徒) 兄,这种窗口实现方法就如上面我所说的一样,大家研究研究。
tchatcha 2003-07-23
  • 打赏
  • 举报
回复
建议大家都看看 Hanson_bati_zhu(欺世盗名之徒) 兄提供的贴子

太好了

http://www.sys-con.com/pbdj/article2a.cfm?id=421&count=2034&tot=21&page=1
http://www.sys-con.com/pbdj/article2a.cfm?id=200&count=1722&tot=11&page=1
xisat 2003-07-23
  • 打赏
  • 举报
回复
还好,来的不晚,豁然开朗的感觉
aty283 2003-07-22
  • 打赏
  • 举报
回复
看不到啊
killerdanny 2003-07-22
  • 打赏
  • 举报
回复
hehe!upup!
Hanson_bati_zhu 2003-07-22
  • 打赏
  • 举报
回复
发给我吧
我帮你想办法
hstong@263.net
Hanson_bati_zhu 2003-07-22
  • 打赏
  • 举报
回复
如果大家对这种数据窗口处理方式有兴趣的话
可以看看这两个文章
必然会把你们对数据窗口的理解程度提高很多


http://www.sys-con.com/pbdj/article2a.cfm?id=421&count=2034&tot=21&page=1
http://www.sys-con.com/pbdj/article2a.cfm?id=200&count=1722&tot=11&page=1
Hanson_bati_zhu 2003-07-22
  • 打赏
  • 举报
回复
我把图片转为PNG格式的,才24k,比你给我的哪个3M的爽多了
呵呵
Hanson_bati_zhu 2003-07-22
  • 打赏
  • 举报
回复
看看这个能不能行

http://www.tty.com.cn/forum/uploadImages/20037221733362956.png
加载更多回复(49)

740

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 脚本语言
社区管理员
  • 脚本语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧