|
of_setborder
|
|
Full name
|
pfc_n_cst_dwsrv_report.of_setborder
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_setborder(border,string,string,boolean)
|
Name
|
Datatype
|
li_Count
|
Integer
|
li_NumObjects
|
Integer
|
li_Undo
|
Integer
|
lnv_String
|
n_cst_string
|
ls_Border
|
String
|
ls_Modify
|
String
|
ls_Objects
|
String[]
|
ls_OldBorder
|
String
|
ls_Return
|
String
|
ls_Undo
|
String
|
public function string of_setborder (border abo_border, string as_name, string as_band, boolean ab_execute);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_SetBorder
//
// Access: public
//
// Arguments:
// abo_Border The border to place around the object added (NoBorder!,
// ShadowBox!, Box!, ResizeBorder!, Underline!, Lowered!
// Raised!).
// as_Name The name of the object to change, "*" will cause all
// objects in the band to be changed.
// as_Band The band in which to change the objects, "*" will call
// the entire datawindow to be changed. This argument is
// ignored if a name is passed in as_Name.
// ab_Execute True - execute the Modify command,
// False - build the command but do not execute it
//
// Returns: String
// The output of the Modify command (the error text or "") if True
// was passed for ab_Execute; the text of the Modify command
// to add the object if False was passed.
//
// Description: Change the border on an object in the datawindow.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 7.0 Fix to allow for expressions in the border attribute
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_Border, ls_OldBorder, ls_Modify, ls_Objects[], ls_Undo, ls_Return
Integer li_NumObjects, li_Count, li_Undo
n_cst_string lnv_String
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 as_Name = "*" Then
// All visible objects in the as_Band band are to be changed
li_NumObjects = of_GetObjects(ls_Objects, "*", as_Band, True)
li_Undo = ii_UndoLevel
For li_Count = 1 To li_NumObjects
// Call this function for each object
ls_Modify = ls_Modify + of_SetBorder(abo_Border, ls_Objects[li_Count], "", False)
Next
// Combine each object's undo statement into one
li_Undo ++
For li_Count = (li_Undo + 1) To ii_UndoLevel
is_Undo[li_Undo] = is_Undo[li_Undo] + " " + is_Undo[li_Count]
Next
ii_UndoLevel = li_Undo
Else
ls_OldBorder = idw_Requestor.Describe(as_Name + ".Border")
If ls_OldBorder = "!" Then
// This is type of object does not have a border
Return ""
End if
// Change border
If ls_Border <> ls_OldBorder Then
ls_Modify = ls_Modify + " " + as_Name + ".Border='" + ls_Border + "'"
ls_Undo = ls_Undo + " " + as_Name + ".Border='" + ls_OldBorder + "'"
ls_Undo = lnv_string.of_GlobalReplace (ls_Undo, "~"", "")
ii_UndoLevel ++
is_Undo[ii_UndoLevel] = ls_Undo
End if
End if
If ab_Execute Then
ls_Return = idw_Requestor.Modify(ls_Modify)
Else
ls_Return = ls_Modify
End if
Return ls_Return
end function