码迷,mamicode.com
首页 > 其他好文 > 详细

PowerBuilder -- 未公开函数

时间:2017-01-13 20:57:26      阅读:255      评论:0      收藏:0      [点我收藏+]

标签:blank   attribute   窗口   getchild   end   event   手工   strong   16px   

原文:http://blog.csdn.net/happymagic/article/details/51077322

 

@、已知一个DW中的某列的列名(在字符串变量中),以获得这个列对象的DWO
方法是:
DWObject ldwo_use,ldwo_name
ldwo_use = dw_1.Object
ldwo_name = ldwo_use.__get_attribute("name",FALSE)
这样就可以在用setitem()设置值时,手工调用数窗的itemchanged事件,校验是否接受该值
int li_rtn
li_rtn = dw_1.event itemchanged(dw_1.GetROW(),ldwo_name,‘arg1‘)
if li_rtn = 0 then
       dw_1.SetItem(dw_1.GetROW(),‘name",‘arg1‘)
end if


@、非复合报表中的嵌套报表不可使用getchild取得,也不可使用describe取得属性和使用modify更改属性,
你可以调用PB未载入文档的函数来获取/更改属性,请看示例,注意多层嵌套时使用循环获取最终对象.

例:数据窗口控件dw_test包含嵌套报表dw_1,dw_1有栏位dept_name.
dwobject ldwo_parent,ldwo_obj
string ls_color
ldwo_parent = dw_1.o b j e c t
ldwo_obj = ldwo_parent.__get_attribute("dw_1",false)
ldwo_obj = ldwo_obj.o b j e c t
ldwo_obj = ldwo_obj.__get_attribute("dept_name",false)
ls_color = ldwo_obj.color//取颜色
ldwo_obj.__set_attribute("color",rgb(192,192,192))//更改颜色
__get_attribute()、__get_attribute_item()、__invoke_method()、__set_attribute()、__set_attribute_item()

PowerBuilder -- 未公开函数

标签:blank   attribute   窗口   getchild   end   event   手工   strong   16px   

原文地址:http://www.cnblogs.com/yarightok/p/6283277.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!