n_dw2xls_line.sru 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. $PBExportHeader$n_dw2xls_line.sru
  2. forward
  3. global type n_dw2xls_line from nonvisualobject
  4. end type
  5. end forward
  6. global type n_dw2xls_line from nonvisualobject
  7. end type
  8. global n_dw2xls_line n_dw2xls_line
  9. type variables
  10. n_dw2xls_requestor inv_Requestor
  11. String Name
  12. String objType
  13. String VisibleExp
  14. Boolean IsHLine //是否横线, 如果不是,则是纵线
  15. Long PenColor
  16. Long PenWidth
  17. Long PenStyle
  18. Int BorderStyle //对应的XLS边框类型
  19. Long x1, y1, x2 ,y2
  20. String X1_Exp, Y1_EXP ,X2_EXP ,Y2_EXP
  21. Int StartRow =1
  22. Int EndRow =1
  23. Int StartCol
  24. Int EndCol
  25. Int ii_LeftRight // 1 Left 2 Right
  26. Int ii_TopBottom // 1 Top 2 Bottom
  27. Boolean IsClone=False //是否克隆的线条,如果是,则不输出该线条
  28. Boolean Y1Exp_RowHeight //Y1的表达式,是否包括rowheight
  29. Boolean Y2Exp_RowHeight //y2的表达式,是否包括rowheight
  30. Boolean IsSlideup
  31. n_dw2xls_Object inv_SlideupObject //增加对SlideUp属性的支持
  32. end variables
  33. forward prototypes
  34. public subroutine of_setrequestor (readonly n_dw2xls_requestor anv_requestor, readonly string as_type, readonly string as_name, readonly boolean ab_ishline)
  35. public subroutine of_setposition (readonly long ai_x1, readonly long ai_y1, readonly long ai_x2, readonly long ai_y2, readonly string as_x1_exp, readonly string as_y1_exp, readonly string as_x2_exp, readonly string as_y2_exp)
  36. end prototypes
  37. public subroutine of_setrequestor (readonly n_dw2xls_requestor anv_requestor, readonly string as_type, readonly string as_name, readonly boolean ab_ishline);String ls_Units
  38. String ls_Value
  39. n_dw2xls_WinApi lnv_Api
  40. IF Not IsValid(anv_requestor) THen
  41. Return
  42. END IF
  43. inv_Requestor = anv_requestor
  44. objType =Lower(Trim(as_Type))
  45. name = Lower(Trim( as_Name ))
  46. IsHLine = ab_IsHline
  47. lnv_Api =inv_Requestor.OF_GetWinApi()
  48. IF objType="line" Then
  49. PenColor =lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".pen.color" )) )
  50. PenWidth = Long(inv_Requestor.OF_Describe(name+".pen.Width" ))
  51. PenStyle = Long(inv_Requestor.OF_Describe(name+".pen.Style" ))
  52. ELSEIF objType="rectangle" OR objType="roundrectangle" Then
  53. PenColor = lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".Brush.Color" )) )
  54. ls_Value = inv_Requestor.OF_Describe(name+".Brush.Hatch" )
  55. IF PenColor >=16777215 OR ls_Value<>'6' Then
  56. PenColor =lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".pen.color" )) )
  57. PenWidth = Long(inv_Requestor.OF_Describe(name+".pen.Width" ))
  58. PenStyle = Long(inv_Requestor.OF_Describe(name+".pen.Style" ))
  59. ELSE
  60. IF IsHline THen
  61. PenWidth =y2 - y1
  62. ELSE
  63. PenWidth = X2 - X1
  64. END IF
  65. PenStyle = 0
  66. END IF
  67. ELSE
  68. PenWidth = -1
  69. PenStyle =0
  70. PenColor =0
  71. END IF
  72. IF PenWidth<=0 THen
  73. PenWidth =5
  74. ELSE
  75. ls_Units =inv_Requestor.OF_GetUnits()
  76. IF ls_Units="1" THEN
  77. PenWidth = PixelsToUnits(PenWidth,YPixelsToUnits!)
  78. ELSEIF ls_Units='2' Then
  79. PenWidth = PixelsToUnits(lnv_Api.OF_InchToPixels( PenWidth /1000),YPixelsToUnits!)
  80. ELSEIF ls_Units="3" THEN
  81. PenWidth = PixelsToUnits(lnv_Api.OF_CMToPixels( PenWidth /1000),YPixelsToUnits!)
  82. END IF
  83. END IF
  84. IF PenStyle=0 Then
  85. IF PenWidth >5 Then
  86. BorderStyle=lnv_Api.borderstyle_medinm
  87. ELSE
  88. BorderStyle=lnv_Api.borderstyle_thin
  89. END IF
  90. ELSEIF PenStyle=1 Then //DASH
  91. BorderStyle=lnv_Api.borderstyle_dashed
  92. ELSE
  93. BorderStyle=lnv_Api.borderstyle_Dotted
  94. END IF
  95. ls_Value =anv_requestor.OF_Describe(name+".SlideUp")
  96. IF ls_Value='directlyabove' OR ls_Value ="allabove" Then
  97. IsSlideup=true
  98. ELSE
  99. IsSlideup=False
  100. END IF
  101. end subroutine
  102. public subroutine of_setposition (readonly long ai_x1, readonly long ai_y1, readonly long ai_x2, readonly long ai_y2, readonly string as_x1_exp, readonly string as_y1_exp, readonly string as_x2_exp, readonly string as_y2_exp);x1 = ai_x1
  103. y1 = ai_y1
  104. x2 = ai_x2
  105. y2 = ai_y2
  106. X1_EXP = as_x1_exp
  107. y1_exp =as_y1_exp
  108. x2_exp = as_x2_exp
  109. y2_exp =as_y2_exp
  110. IF Pos(Lower(y1_exp),"rowheight(")>0 THen
  111. Y1Exp_RowHeight =TRUE
  112. END IF
  113. IF Pos(Lower(y2_exp),"rowheight(")>0 THen
  114. Y2Exp_RowHeight =TRUE
  115. END IF
  116. end subroutine
  117. on n_dw2xls_line.create
  118. call super::create
  119. TriggerEvent( this, "constructor" )
  120. end on
  121. on n_dw2xls_line.destroy
  122. TriggerEvent( this, "destructor" )
  123. call super::destroy
  124. end on