|
of_createvisuals
|
|
Full name
|
pfc_w_statusbar.of_createvisuals
|
Access
|
public
|
Override of
|
integer
|
Return value
|
integer
|
Prototype
|
public function integer of_createvisuals()
|
Name
|
Datatype
|
lgo_withfocus
|
graphicobject
|
li_height
|
integer
|
li_rc
|
integer
|
lnv_string
|
n_cst_string
|
ls_dwdefinition
|
string
|
ls_errorbuffer
|
string
|
ls_replacestring
|
string
|
public function integer of_createvisuals ();//////////////////////////////////////////////////////////////////////////////
//
// Function: of_CreateVisuals
//
// Access: Public
//
// Arguments: None
//
// Returns: Integer
// 1 if it succeeds and -1 if an error occurs.
//
// Description:
// Creates the Visual Object (a dw object) that holds all registerd objects.
// This is called after opening this GUI or anytime the StatusBar userobject
// creates a new entry or destroys a new entry through its of_Register...()
// and of_UnRegister...() functions.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 5.0.03 Restore the focus point to the correct object which may not be the frame.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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
string ls_dwdefinition
string ls_errorbuffer
string ls_replacestring
integer li_height
graphicobject lgo_withfocus
n_cst_string lnv_string
// Check for the required reference.
If IsNull(iw_parentwindow) Or Not IsValid(iw_parentwindow) Then
Return -1
End If
// Keep track of the object with focus.
lgo_withfocus = GetFocus()
// Get the text necessary to build the appropriate datawindow object.
li_rc = iw_parentwindow.inv_statusbar.of_createdwobject( &
ls_dwdefinition, ii_winmaxwidth, li_height)
If li_rc <> 1 Then
Return -1
End If
// Change the Background color of all the objects to be the
// appropriate background color.
ls_replacestring = 'background.color="'+string(il_buttonface)+'"'
ls_dwdefinition = lnv_string.of_GlobalReplace(ls_dwdefinition, &
'background.color="12632256"', ls_replacestring)
// Set it on the DataWindow Control (which set focus on it).
li_rc = dw_statusbar.Create ( ls_dwdefinition, ls_errorbuffer)
If li_rc <> 1 Then
Return -1
End If
// Update the colors of this window and the datawindow objects.
li_rc = of_RefreshColors()
// Set the Height of the Status bar.
this.height = li_height
dw_statusbar.Height = li_height
// Define the Width of the status bar.
dw_statusbar.Width = ii_winmaxwidth
this.Width = ii_winmaxwidth
// Set its position.
of_SetPosition()
// Force an Update of the Pre-Defined Objects.
of_RefreshVisuals()
// Restore the focus point to the previous valid focus point.
of_RestoreFocusPoint(lgo_withfocus)
Return 1
end function