[PB] specifies the tooltip attribute value uf_setcell_tooltip of a column in a row.

Source: Internet
Author: User
01. /* release 02. function: Specifies the tooltip attribute value 03 for a column in a row. 04. parameter: 05. dw data window name 06. args_col [] column name or column number 07. args_info [] row number and corresponding prompt information array 08. 09. return Value: none. 11. 12. note: 1. because two-dimensional arrays cannot be dynamically declared, they are replaced by one-dimensional arrays and processed by programs. 13. therefore, the data transmitted to the info array must be in the following format: 14. 15. {'row number 1', 'prompt content', 'row number 2', 'prompt content'} 16. 17. 2. currently, the expression is not set in the field. 18. 19. -------------------------------------------------------------------------------- */20. // reference :"~ Tcase (getrow () when 1 then ~ "Hello ~ "Else case (getrow () when 3 then ~ "Ggg ~ "Else ~ "~ ")" 21. // if no value is input, 22.IF UpperBound (args_col) <= 0 THEN 23 is returned. RETURN 24.END IF 25. 26. integer I, j 27. string ls_colname, ls_properties, ls_old_value = "" 28. string ls_head, ls_mid, ls_tail, ls_condition 29. string ls_value, ls_color 30. // ------------------------ 31. string ls_sign 32. boolean lb_sign 33. // ------------------------ 34. 35.FOR I = 1 TO UpperBound (args_col) 36. // retrieve the column number 37. IF IsNumber (ar Gs_col [I]) THEN 38. ls_colname = "#" + String (args_col [I]) 39. ELSE 40. ls_colname = args_col [I] 41. end if 42. 43. // modify attributes (here you can expand attributes by yourself) 44. // choose case args_properties 45. // CASE "text" 46. // ls_properties = "color" 47. // 48. // CASE "background" 49. // dw. modify (ls_colname + ". background. mode = '0' ") 50. // ls_properties = "background. color "51. // 52. // end choose 53. dw. modify (ls_colname + ". Tooltip. enabled = true ") 54. dw. modify (ls_colname + ". tooltip. isbubble = '1' ") 55. // if len (ls_old_value) = 0 then 56. // dw. modify (ls_colname + ". tooltip. tip = ''") 57. // end if 58. ls_properties = "tooltip. tip "59. 60. // The column expression 61. ls_old_value = dw. describe (ls_colname + ". "+ ls_properties) 62. if ls_old_value = '? 'Then 63. ls_old_value = ''64. end if 65. // ================================================ ============================ modify 66. // If the retrieved value contains ("), it indicates there is an expression or an initial value, 67. // when recreating the expression, there are two "which cannot be done, so remove them. 68. IF Pos (ls_old_value, '"') <> 0 THEN 69. ls_old_value = Right (ls_old_value, Len (ls_old_value)-Pos (ls_old_value ,"~ T ") 70. ls_old_value = Left (ls_old_value, Len (ls_old_value)-Pos (ls_old_value ,"~ T ")-1) // remove the last quotation mark 71. end if 72. // ================================================ ===================================73. // messagebox ("2", ls_old_value) 74. // determine the line 75 based on what. // choose case args_type 76. // CASE "value" 77. // ls_head = "'0 ~ Tcase ("+ ls_colname +" "78. // 79. // CASE" row "80. // ls_head =" '0 ~ Tcase (getrow () "81. // end choose 82. ls_head = "'~ Tcase (getrow () "83. 84. FOR j = 1 TO UpperBound (args_info) STEP 2 85. ls_value = args_info [j] // The row number or change the cell value to 86. ls_color = args_info [j + 1] // get the prompt 87. 88. ls_mid = ls_mid + 'when' + ls_value + 'then "'+ ls_color +'" '89. NEXT 90. if len (ls_old_value) = 0 then 91. ls_tail = 'else "'+ ls_old_value +'" '+ ")'" // The end is 92. else 93. ls_tail = "else" + ls_old_value + ") '" // end with 94. end if 95. // combine them into 96 conditions in the expression. ls_condition = ls_colname + ". "+ ls_properties +" = "97. ls_condition = ls_condition + ls_head + ls_mid + ls_tail 98. // messagebox ("abc", ls_condition) 99. // execute 100. dw. modify (ls_condition) 101. 102. NEXT

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.