|
selectionchanging
|
|
Full name
|
pfc_u_tab_dwproperty_srv.selectionchanging
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event selectionchanging()
|
Name
|
Datatype
|
la_rc
|
Any
|
li_cnt
|
Integer
|
li_rc
|
Integer
|
li_upper
|
Integer
|
ls_syntax
|
String
|
ls_tabpagesyntax
|
String
|
ls_text
|
String
|
event selectionchanging;call super::selectionchanging;//////////////////////////////////////////////////////////////////////////////
//
// Event: selectionchanging
//
// Arguments:
// oldindex The old tabpage index.
// newindex The new tabpage index.
//
// Returns: Integer
// 1 = successful
// -1 = Error
//
// Description:
// Perform validation prior to allow changing of tab pages.
// If the new tabpage is the Syntax tabpage, set the appropriate script on it.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_rc
Any la_rc
Integer li_upper
Integer li_cnt
String ls_text
String ls_syntax
String ls_tabpagesyntax
// Validate the NewIndex TabPage.
If newindex > 0 And newindex <=UpperBound(iuo_tappage) Then
If IsNull(iuo_tappage[newindex]) Or Not IsValid(iuo_tappage[newindex]) Then
Return
End If
Else
Return
End If
// Validate the OldIndex TabPage
If oldindex > 0 Then
If IsValid(iuo_tappage[oldindex]) Then
la_rc = iuo_tappage[oldindex].Dynamic Event pfc_PropertyValidation()
If ClassName(la_rc) = 'integer' or ClassName(la_rc)='long' Then
// The pfc_PropertyValidation was found, validate the return code.
If la_rc < 0 Then Return 1
End If
End If
End If
// Get the TabPage text.
ls_text = Lower(iuo_tappage[newindex].Text)
If Pos(ls_text, 'syntax') > 0 Then
// Loop through all the tab pages.
li_upper = Upperbound(iuo_tappage)
For li_cnt = 1 to li_upper
la_rc = iuo_tappage[li_cnt].Dynamic Event pfc_PropertySyntax()
If ClassName(la_rc) = 'string' Then
// The pfc_PropertySyntax was found, validate the return code.
ls_tabpagesyntax = la_rc
If IsNull(ls_tabpagesyntax) Then ls_tabpagesyntax = ''
If Len(ls_syntax) > 0 And Len(ls_tabpagesyntax) > 0 Then
ls_syntax += '~r~n'
End If
ls_syntax += ls_tabpagesyntax
End If
Next
If IsNull(ls_syntax) Then ls_syntax = ''
iuo_tappage[newindex].Dynamic of_SetSyntax(ls_syntax)
End If
end event