f_get_obj_visible.srf 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. $PBExportHeader$f_get_obj_visible.srf
  2. global type f_get_obj_visible from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_get_obj_value (string arg_dwname, ref datastore arg_ds, ref string arg_msg)
  6. global function string f_get_obj_visible (datawindow arg_dw, string arg_propertystr, string arg_property, string arg_objname)
  7. global function string f_get_obj_visible (string arg_dwobj, string arg_propertystr, string arg_property, string arg_objname)
  8. end prototypes
  9. global function integer f_get_obj_value (string arg_dwname, ref datastore arg_ds, ref string arg_msg);////取隐藏字段定义
  10. Int rslt = 1
  11. IF arg_dwname = '' THEN RETURN 0
  12. datawindow dw
  13. dw = create datawindow
  14. dw.dataobject = arg_dwname
  15. //设定dw的column
  16. String ls_object, ls_object_col, ls_object_txt, ls_object_txt_text
  17. String ls_mdfstr_visible, ls_mdfstr_x, ls_mdfstr_width, ls_mdfstr_alignment, ls_mdfstr_DftValue
  18. String ls_mdfstr_text
  19. String ls_mdfstr_height,ls_mdfstr_y,ls_mdfstr_Taborder
  20. string ls_AllowVersion
  21. String ls_mdfstr_tmp, ls_mdfstr_value
  22. String ls_dwname,ls_dbname,ls_dftvalue
  23. long ll_objvisible
  24. Long ll_alignment,ll_taborder
  25. Long ll_x, ll_y,ll_width, ll_height,ll_titlex,ll_titley
  26. string ls_objtype, ls_coltype
  27. String ls_modify
  28. String ls_dwobjectstr,ls_type
  29. Long li_start,li_tab_pos
  30. Boolean lb_def = True
  31. long ll_row
  32. ls_dwname = dw.DataObject
  33. ls_AllowVersion = Fill("0",sys_version_int - 1)+"1"+Fill("0",20 - sys_version_int)
  34. SELECT DwObjVisible, DwObjText,
  35. DwObjX, DwObjY, DwObjWidth, DwObjHeight, DwObjAlignment,
  36. DwObjTaborder, DwObjDftValue
  37. INTO :ls_mdfstr_visible,:ls_mdfstr_text,
  38. :ls_mdfstr_x,:ls_mdfstr_y,:ls_mdfstr_width,:ls_mdfstr_height,:ls_mdfstr_alignment,:ls_mdfstr_Taborder,
  39. :ls_mdfstr_DftValue
  40. FROM sys_dwnSyntax_sys
  41. WHERE AllowVersion = :ls_AllowVersion
  42. And DwName = :ls_dwname;
  43. IF sqlca.SQLCode <> 0 THEN
  44. lb_def = False
  45. END IF
  46. ls_dwobjectstr = dw.Describe("Datawindow.Objects") + "~t"
  47. li_start = 1
  48. li_tab_pos = Pos(ls_dwobjectstr, "~t", li_start)
  49. DO WHILE li_tab_pos > 0
  50. ls_object = Mid(ls_dwobjectstr, li_start, (li_tab_pos - li_start) )
  51. IF Pos(ls_object,'_t') > 0 THEN
  52. ls_object_col = Mid(ls_dwobjectstr, li_start, (li_tab_pos - li_start) - 2)
  53. ls_object_txt = ls_object
  54. ls_type = Lower(Left(dw.Describe(ls_object_col+".Type"),4))
  55. IF ls_type = 'comp' Or ls_type = 'colu' THEN
  56. // des_1 = This.Describe( ls_object_col + ".Name")
  57. ls_object_txt_text = dw.Describe(ls_object_txt+ ".Text")
  58. ls_dbname = dw.Describe( ls_object_col + ".dbname")
  59. ls_object_txt_text = f_strip( ls_object_txt_text)
  60. IF ls_object_txt_text <> "!" THEN
  61. //uf_get_value(ls_object_col,"visible",li_ColVisible,)
  62. IF Pos(ls_mdfstr_visible, ls_object_col + ".visible=") > 0 THEN
  63. //查解决方案
  64. ls_mdfstr_tmp = mid(ls_mdfstr_visible , Pos(ls_mdfstr_visible, ls_object_col + ".visible=") + len(ls_object_col + ".visible=") )
  65. IF Pos(ls_mdfstr_tmp,"~t") > 0 THEN
  66. ls_mdfstr_value = Left(ls_mdfstr_tmp, Pos(ls_mdfstr_tmp,"~t") - 1)
  67. ELSE
  68. ls_mdfstr_value = ls_mdfstr_tmp
  69. END IF
  70. //查帐套
  71. IF ls_mdfstr_value = "1" THEN //
  72. END IF
  73. //查用户
  74. IF ls_mdfstr_value = "1" THEN //
  75. END IF
  76. ll_objvisible = long(ls_mdfstr_value)
  77. else
  78. ll_objvisible = Long(dw.Describe(ls_object_col+ ".Visible"))
  79. END IF
  80. // ls_modify += des_1+ ".alignment = "+string(ll_alignment) + "~r"
  81. // ls_modify += des_1+ ".initial = '"+String(ls_initial) + "'~r"
  82. arg_ds.insertrow(0)
  83. arg_ds.object.objname[ll_row] = ls_object_col
  84. arg_ds.object.objtext[ll_row] = ls_object_txt_text
  85. arg_ds.object.objvisible[ll_row] = ll_objvisible
  86. arg_ds.object.objdftvalue[ll_row] = ls_dftvalue
  87. arg_ds.object.objx[ll_row] = ll_x
  88. arg_ds.object.objy[ll_row] = ll_y
  89. arg_ds.object.objwidth[ll_row] = ll_width
  90. arg_ds.object.objheight[ll_row] = ll_height
  91. arg_ds.object.objalignment[ll_row] = ll_alignment
  92. arg_ds.object.objtaborder[ll_row] = ll_taborder
  93. arg_ds.object.objtitlex[ll_row] = ll_titlex
  94. arg_ds.object.objtitley[ll_row] = ll_titley
  95. arg_ds.object.objtype[ll_row] = ls_objtype
  96. arg_ds.object.coltype[ll_row] = ls_coltype
  97. arg_ds.object.dbname[ll_row] = ls_dbname
  98. END IF
  99. END IF
  100. END IF
  101. li_start = li_tab_pos + 1
  102. li_tab_pos = Pos(ls_dwobjectstr, "~t", li_start)
  103. LOOP
  104. RETURN rslt
  105. end function
  106. global function string f_get_obj_visible (datawindow arg_dw, string arg_propertystr, string arg_property, string arg_objname);
  107. Int rslt = 1
  108. string ls_mdfstr
  109. string ls_property
  110. string ls_object_col
  111. string ls_mdfstr_tmp, ls_mdfstr_value
  112. ls_mdfstr = arg_propertystr
  113. ls_property = arg_property
  114. ls_object_col = arg_objname
  115. IF Pos(ls_mdfstr, ls_object_col + "."+ls_property+"=") > 0 THEN
  116. //查解决方案
  117. ls_mdfstr_tmp = mid(ls_mdfstr , Pos(ls_mdfstr, ls_object_col + "."+ls_property+"=") + len(ls_object_col + "."+ls_property+"=") )
  118. IF Pos(ls_mdfstr_tmp,"~t") > 0 THEN
  119. ls_mdfstr_value = Left(ls_mdfstr_tmp, Pos(ls_mdfstr_tmp,"~t") - 1)
  120. ELSE
  121. ls_mdfstr_value = ls_mdfstr_tmp
  122. END IF
  123. return ls_mdfstr_value
  124. else
  125. return arg_dw.Describe(ls_object_col+ "."+ls_property)
  126. END IF
  127. end function
  128. global function string f_get_obj_visible (string arg_dwobj, string arg_propertystr, string arg_property, string arg_objname);
  129. Int rslt = 1
  130. string ls_mdfstr
  131. string ls_property
  132. string ls_object_col
  133. string ls_mdfstr_tmp, ls_mdfstr_value
  134. ls_mdfstr = arg_propertystr
  135. ls_property = arg_property
  136. ls_object_col = arg_objname
  137. IF Pos(ls_mdfstr, ls_object_col + "."+ls_property+"=") > 0 THEN
  138. //查解决方案
  139. ls_mdfstr_tmp = mid(ls_mdfstr , Pos(ls_mdfstr, ls_object_col + "."+ls_property+"=") + len(ls_object_col + "."+ls_property+"=") )
  140. IF Pos(ls_mdfstr_tmp,"~t") > 0 THEN
  141. ls_mdfstr_value = Left(ls_mdfstr_tmp, Pos(ls_mdfstr_tmp,"~t") - 1)
  142. ELSE
  143. ls_mdfstr_value = ls_mdfstr_tmp
  144. END IF
  145. return ls_mdfstr_value
  146. else
  147. // return arg_dw.Describe(ls_object_col+ "."+ls_property)
  148. // datastore ds
  149. // ds = create datastore
  150. // ds.dataobject = arg_dwobj
  151. ls_mdfstr_value = ds_obj_visible.Describe(ls_object_col+ "."+ls_property)
  152. // destroy ds
  153. return ls_mdfstr_value
  154. END IF
  155. end function