123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154 |
- $PBExportHeader$n_dw2xls_line.sru
- forward
- global type n_dw2xls_line from nonvisualobject
- end type
- end forward
- global type n_dw2xls_line from nonvisualobject
- end type
- global n_dw2xls_line n_dw2xls_line
- type variables
- n_dw2xls_requestor inv_Requestor
- String Name
- String objType
- String VisibleExp
- Boolean IsHLine //是否横线, 如果不是,则是纵线
- Long PenColor
- Long PenWidth
- Long PenStyle
- Int BorderStyle //对应的XLS边框类型
- Long x1, y1, x2 ,y2
- String X1_Exp, Y1_EXP ,X2_EXP ,Y2_EXP
- Int StartRow =1
- Int EndRow =1
- Int StartCol
- Int EndCol
- Int ii_LeftRight // 1 Left 2 Right
- Int ii_TopBottom // 1 Top 2 Bottom
- Boolean IsClone=False //是否克隆的线条,如果是,则不输出该线条
- Boolean Y1Exp_RowHeight //Y1的表达式,是否包括rowheight
- Boolean Y2Exp_RowHeight //y2的表达式,是否包括rowheight
- Boolean IsSlideup
- n_dw2xls_Object inv_SlideupObject //增加对SlideUp属性的支持
- end variables
- forward prototypes
- public subroutine of_setrequestor (readonly n_dw2xls_requestor anv_requestor, readonly string as_type, readonly string as_name, readonly boolean ab_ishline)
- 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)
- end prototypes
- 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
- String ls_Value
- n_dw2xls_WinApi lnv_Api
- IF Not IsValid(anv_requestor) THen
- Return
- END IF
- inv_Requestor = anv_requestor
- objType =Lower(Trim(as_Type))
- name = Lower(Trim( as_Name ))
- IsHLine = ab_IsHline
- lnv_Api =inv_Requestor.OF_GetWinApi()
- IF objType="line" Then
- PenColor =lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".pen.color" )) )
- PenWidth = Long(inv_Requestor.OF_Describe(name+".pen.Width" ))
- PenStyle = Long(inv_Requestor.OF_Describe(name+".pen.Style" ))
-
- ELSEIF objType="rectangle" OR objType="roundrectangle" Then
-
- PenColor = lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".Brush.Color" )) )
- ls_Value = inv_Requestor.OF_Describe(name+".Brush.Hatch" )
-
- IF PenColor >=16777215 OR ls_Value<>'6' Then
- PenColor =lnv_Api.OF_GetColor( Long(inv_Requestor.OF_Describe(name+".pen.color" )) )
- PenWidth = Long(inv_Requestor.OF_Describe(name+".pen.Width" ))
- PenStyle = Long(inv_Requestor.OF_Describe(name+".pen.Style" ))
- ELSE
- IF IsHline THen
- PenWidth =y2 - y1
- ELSE
- PenWidth = X2 - X1
- END IF
- PenStyle = 0
- END IF
- ELSE
- PenWidth = -1
- PenStyle =0
- PenColor =0
- END IF
- IF PenWidth<=0 THen
- PenWidth =5
- ELSE
- ls_Units =inv_Requestor.OF_GetUnits()
- IF ls_Units="1" THEN
- PenWidth = PixelsToUnits(PenWidth,YPixelsToUnits!)
- ELSEIF ls_Units='2' Then
- PenWidth = PixelsToUnits(lnv_Api.OF_InchToPixels( PenWidth /1000),YPixelsToUnits!)
- ELSEIF ls_Units="3" THEN
- PenWidth = PixelsToUnits(lnv_Api.OF_CMToPixels( PenWidth /1000),YPixelsToUnits!)
- END IF
- END IF
- IF PenStyle=0 Then
- IF PenWidth >5 Then
- BorderStyle=lnv_Api.borderstyle_medinm
- ELSE
- BorderStyle=lnv_Api.borderstyle_thin
- END IF
- ELSEIF PenStyle=1 Then //DASH
- BorderStyle=lnv_Api.borderstyle_dashed
- ELSE
- BorderStyle=lnv_Api.borderstyle_Dotted
- END IF
- ls_Value =anv_requestor.OF_Describe(name+".SlideUp")
- IF ls_Value='directlyabove' OR ls_Value ="allabove" Then
- IsSlideup=true
- ELSE
- IsSlideup=False
- END IF
- end subroutine
- 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
- y1 = ai_y1
- x2 = ai_x2
- y2 = ai_y2
- X1_EXP = as_x1_exp
- y1_exp =as_y1_exp
- x2_exp = as_x2_exp
- y2_exp =as_y2_exp
- IF Pos(Lower(y1_exp),"rowheight(")>0 THen
- Y1Exp_RowHeight =TRUE
- END IF
- IF Pos(Lower(y2_exp),"rowheight(")>0 THen
- Y2Exp_RowHeight =TRUE
- END IF
- end subroutine
- on n_dw2xls_line.create
- call super::create
- TriggerEvent( this, "constructor" )
- end on
- on n_dw2xls_line.destroy
- TriggerEvent( this, "destructor" )
- call super::destroy
- end on
|