|
pfc_propertyapply
|
|
Full name
|
pfc_u_tabpg_dwproperty_srvsort.pfc_propertyapply
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event pfc_propertyapply()
|
Name
|
Datatype
|
lb_current
|
boolean
|
lb_desired
|
boolean
|
li_cnt
|
integer
|
li_excludecount
|
integer
|
li_index
|
integer
|
li_rc
|
integer
|
li_stylecurrent
|
integer
|
li_styledesired
|
integer
|
li_upper
|
integer
|
ls_excludecols
|
string[]
|
ls_headersuffixcurrent
|
string
|
ls_headersuffixdesired
|
string
|
event pfc_propertyapply;call super::pfc_propertyapply;//////////////////////////////////////////////////////////////////////////////
//
// Function: pfc_PropertyApply
//
// Access: Public
//
// Arguments: None
//
// Returns: Integer
// 1 if it succeeds.
// -1 if an error occurs.
//
// Description:
// Apply the requested changes.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 6.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.
//
//////////////////////////////////////////////////////////////////////////////
integer li_upper
integer li_cnt
integer li_rc
integer li_stylecurrent, li_styledesired
integer li_index
integer li_excludecount=0
string ls_excludecols[]
string ls_headersuffixcurrent, ls_headersuffixdesired
boolean lb_current, lb_desired
// Validate references.
If IsNull(idw_requestor) or Not IsValid(idw_requestor) Then
Return -1
End If
If IsNull(idw_requestor.inv_sort) or Not IsValid(idw_requestor.inv_sort) Then
Return -1
End If
// -- Style. --
li_stylecurrent = idw_requestor.inv_sort.of_GetStyle()
li_styledesired = ii_style - 1
// If the desired value differs from the current value, set the new style.
If li_styledesired >= 0 And li_stylecurrent <> li_styledesired Then
li_rc = idw_requestor.inv_sort.of_SetStyle(li_styledesired)
End If
// -- Column header. --
lb_current = idw_requestor.inv_sort.of_GetColumnHeader()
lb_desired = cbx_columnheader.Checked
// If the desired value differs from the current value.
If lb_current<> lb_desired Then
li_rc = idw_requestor.inv_sort.of_SetColumnHeader(lb_desired)
End If
// -- Header suffix. --
ls_headersuffixcurrent = idw_requestor.inv_sort.of_GetDefaultHeaderSuffix()
ls_headersuffixdesired = sle_headersuffix.Text
// If the desired value differs from the current value.
If ls_headersuffixcurrent<> ls_headersuffixdesired Then
li_rc = idw_requestor.inv_sort.of_SetDefaultHeaderSuffix(ls_headersuffixdesired)
End If
// -- Visible Only. --
lb_current = idw_requestor.inv_sort.of_GetVisibleOnly()
lb_desired = cbx_visibleonly.Checked
// If the desired value differs from the current value.
If lb_current<> lb_desired Then
li_rc = idw_requestor.inv_sort.of_SetVisibleOnly(lb_desired)
End If
// -- Display Values. --
lb_current = idw_requestor.inv_sort.of_GetUseDisplay()
lb_desired = cbx_usedisplayvalue.Checked
// If the desired value differs from the current value.
If lb_current <> lb_desired Then
li_rc = idw_requestor.inv_sort.of_SetUseDisplay(lb_desired)
End If
// -- Exclude Columns. --
// Get the number of items in the ListBox.
li_upper = lb_excludecols.TotalItems( )
For li_cnt = 1 to li_upper
// Is the item selected?
If lb_excludecols.State(li_cnt) = 1 THEN
li_excludecount ++
ls_excludecols[li_excludecount] = lb_excludecols.text(li_cnt)
End If
Next
li_rc = idw_requestor.inv_sort.of_SetExclude(ls_excludecols)
Return 1
end event