n_xls_row.sru 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. $PBExportHeader$n_xls_row.sru
  2. forward
  3. global type n_xls_row from nonvisualobject
  4. end type
  5. end forward
  6. shared variables
  7. end variables
  8. global type n_xls_row from nonvisualobject
  9. end type
  10. global n_xls_row n_xls_row
  11. type variables
  12. n_xls_cell invo_Cells[] //保存当前行的全部列
  13. UINT ii_Row
  14. UINT ii_MaxCol
  15. PUBLIC n_xls_WorkSheet invo_WorkSheet
  16. end variables
  17. forward prototypes
  18. public subroutine of_setrow (unsignedinteger ai_row)
  19. public subroutine of_priorcell_wraptext (integer ai_endcol)
  20. public subroutine of_set_row (unsignedinteger ai_row, boolean ab_border)
  21. end prototypes
  22. public subroutine of_setrow (unsignedinteger ai_row);uInt li ,lj
  23. ii_Row=ai_Row
  24. lj=UpperBound(invo_Cells)+1
  25. For li=lj To ii_MaxCol
  26. invo_Cells[li]=Create n_xls_Cell
  27. invo_Cells[li].Row=ai_Row
  28. invo_Cells[li].Col=li
  29. invo_Cells[li].invo_WorkSheet = invo_WorkSheet
  30. Next
  31. end subroutine
  32. public subroutine of_priorcell_wraptext (integer ai_endcol);/*----------------------------------
  33. 判断是否有单元的结束列为 ai_EndCol
  34. --------------------------------------------*/
  35. Int li
  36. IF ai_EndCol> ii_MaxCol OR ai_EndCol<=1 Then
  37. Return
  38. END IF
  39. ai_EndCol= ai_EndCol -1
  40. For li=ai_EndCol To 1 Step -1
  41. IF IsValid(invo_Cells[li]) Then
  42. IF Not Invo_Cells[li].ib_Empty Then
  43. IF invo_Cells[li].Col=ai_EndCol or invo_Cells[li].EndCol=ai_EndCol Then
  44. invo_Cells[li].invo_format.ii_text_wrap=1
  45. Return
  46. ELSE
  47. Return
  48. END IF
  49. END IF
  50. END IF
  51. Next
  52. Return
  53. end subroutine
  54. public subroutine of_set_row (unsignedinteger ai_row, boolean ab_border);/*-----------------------------------------------------------
  55. 在设置行的同时,同时设置该行全部单元的边框属性
  56. --------------------------------------------------------------*/
  57. uInt li ,lj
  58. ii_Row=ai_Row
  59. lj=UpperBound(invo_Cells)+1
  60. For li=lj To ii_MaxCol
  61. invo_Cells[li]=Create n_xls_Cell
  62. invo_Cells[li].Row=ai_Row
  63. invo_Cells[li].Col=li
  64. invo_Cells[li].invo_WorkSheet = invo_WorkSheet
  65. IF ab_Border Then
  66. invo_Cells[li].invo_Format.ii_left=1
  67. invo_Cells[li].invo_Format.ii_Right=1
  68. invo_Cells[li].invo_Format.ii_top=1
  69. invo_Cells[li].invo_Format.ii_bottom=1
  70. END IF
  71. Next
  72. end subroutine
  73. on n_xls_row.create
  74. call super::create
  75. TriggerEvent( this, "constructor" )
  76. end on
  77. on n_xls_row.destroy
  78. TriggerEvent( this, "destructor" )
  79. call super::destroy
  80. end on