Original:http://blog.csdn.net/happymagic/article/details/51077322
@, a column name (in a string variable) that is known to be a column in a DW to get the DWO of this Column object
The method is:
Dwobject Ldwo_use,ldwo_name
Ldwo_use = Dw_1.object
Ldwo_name = Ldwo_use.__get_attribute ("name", FALSE)
This allows you to manually invoke the ItemChanged event of a number of Windows when setting a value with SetItem () to verify that the value is accepted
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
Nested reports in @, non-composite reports cannot be obtained using Getchild, nor can you use describe to get properties and change properties using modify.
You can call the PB not loaded document function to get/change properties, see the example, notice that multiple layers are nested when using loops to get the final object.
Example: A data window control dw_test contains a nested report dw_1,dw_1 a field 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//Take color
Ldwo_obj.__set_attribute ("Color", RGB (192,192,192))//Change color
__get_attribute (), __get_attribute_item (), __invoke_method (), __set_attribute (), __set_attribute_item ()
PowerBuilder--Undisclosed functions