of_BuildTextModify


pfcdwsrv.pbl   >   pfc_n_cst_dwsrv_report   >   of_BuildTextModify   

Full name pfc_n_cst_dwsrv_report.of_BuildTextModify
Access protected
Extend of string
Return value string
Prototype protected function string of_BuildTextModify(string,string,string,integer,integer,integer,integer,border,boolean,boolean,boolean,string,integer,fontc

Name Datatype
No Data

Name Datatype
ls_Border String
ls_CharSet String
ls_FontWeight String
ls_Italic String
ls_Modify String
ls_Underline String

protected function string of_BuildTextModify (string as_type, string as_text, string as_band, integer ai_x, integer ai_y, integer ai_height, integer ai_width, border abo_border, boolean ab_bold, boolean ab_italic, boolean ab_underline, string as_fontface, integer ai_fontsize, fontcharset afc_charset, long al_Color, long al_BackColor);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  of_BuildTextModify
//
//	Access:  protected
//
//	Arguments:
//	as_Type						The type of object ("text" or "compute") being added.
//	as_Text						The text to be added.
//	as_Band					The band to add it to.
//	ai_X							The X location of the object being placed.
//	ai_Y							The Y location of the object being placed.
//	ai_Height					The weight of the object.
//	ai_Width					The width of the object.
//	abo_Border				The border to place around the object added (NoBorder!, 
//									ShadowBox!, Box!, ResizeBorder!, Underline!, Lowered!
//									Raised!).
//	ab_Bold						True - Bold, False - Normal.
//	ab_Italic					True - Yes, False - No.
//	ab_Underline				True - Yes, False - No.
//	as_FontFace				The font to use (i.e. "MS Sans Serif")
//	ai_FontSize				The point size of the font.
//	afc_CharSet				The character set to use (Ansi!, DefaultCharSet!, Symbol!, 
//									Shiftjis!, OEM!)
//	al_Color						The foreground color.
//	al_BackColor				The background color.
//
//	Returns:		String
//					The text of the Modify command to add the object.
//
//	Description:	Build the modify syntax to create a text object.
//
//////////////////////////////////////////////////////////////////////////////
//
//	Revision History
//
//	Version
//	5.0   Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
//	Copyright © 1996-1997 Sybase, Inc. and its subsidiaries.  All rights reserved.
//	Any distribution of the PowerBuilder Foundation Classes (PFC)
//	source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////

String	ls_Modify, ls_CharSet, ls_Border, ls_FontWeight, ls_Italic, ls_Underline

// Determine the DataWindow Modify parameters
Choose Case afc_CharSet
	Case Ansi!
		ls_CharSet = "0"
	Case Symbol!
		ls_CharSet = "2"
	Case Shiftjis!
		ls_CharSet = "128"
	Case OEM!
		ls_CharSet = "255"
	Case Else
		ls_CharSet = "1"
End Choose

Choose Case abo_Border
	Case NoBorder!
		ls_Border = "0"
	Case ShadowBox!
		ls_Border = "1"
	Case Box!
		ls_Border = "2"
	Case ResizeBorder!
		ls_Border = "3"
	Case Underline!
		ls_Border = "4"
	Case Lowered!
		ls_Border = "5"
	Case Raised!
		ls_Border = "6"
End Choose

If ab_Bold Then
	ls_FontWeight = "700"
Else
	ls_FontWeight = "400"
End If

If ab_Italic Then
	ls_Italic = "1"
Else
	ls_Italic = "0"
End If

If ab_Underline Then
	ls_Underline = "1"
Else
	ls_Underline = "0"
End If

// Build modify statement
ls_Modify = " create " + as_Type + "(band=" + as_Band

If as_Type = "compute" Then
	ls_Modify = ls_Modify + " expression=~"" + as_Text + "~""
Else
	ls_Modify = ls_Modify + " text='" + as_Text + "'"
End If

ls_Modify = ls_Modify + " x='" + String(ai_X) + "'" + &
			" y='" + String(ai_Y) + "'" + &
			" height='" + String(ai_Height) + "'" + &
			" width='" + String(ai_Width) + "'" + &
			" border='" + ls_Border + "'" + &
			" name=add_obj_" + String(ii_ObjectNum) + &
			" font.face='" + as_FontFace + "'" + &
			" font.charset='" + ls_CharSet + "'" + &
			" font.height='-" + String(ai_FontSize) + "'" + &
			" font.weight='" + ls_FontWeight + "'" + &
			" font.italic='" + ls_Italic + "'" + &
			" font.underline='" + ls_Underline + "'" + &
			" color='" + String(al_Color) + "'"

If IsNull(al_BackColor) Then
	ls_Modify = ls_Modify + " background.mode='1' background.color='536870912')"
Else
	ls_Modify = ls_Modify + " background.color='" + String(al_BackColor) + "')"
End If

Return ls_Modify

end function

     
Name Owner
pfc_n_cst_dwsrv_report.of_AddCompute pfc_n_cst_dwsrv_report
pfc_n_cst_dwsrv_report.of_AddText pfc_n_cst_dwsrv_report

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.string systemfunctions

     
Full name
No Data

     
Name Scope
No Data