|
pfc_preopen
|
|
Full name
|
pfc_w_sqlspy.pfc_preopen
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event pfc_preopen()
|
event pfc_preopen;call super::pfc_preopen;//////////////////////////////////////////////////////////////////////////////
//
// Event: pfc_preopen
//
// (Arguments: None)
//
// (Returns: None)
//
// Description: Handle processing that occurs before the open event.
//
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 5.0.02 Added code to appropriately force or not force this window to always
// be on top.
// 6.0 Added groupbox, close and help buttons. Adjust minimum size & resize
// of window to accomodate controls. Made st_history not visible.
// Removed all code relating to st_history.
//
//////////////////////////////////////////////////////////////////////////////
//
// 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.
//
//////////////////////////////////////////////////////////////////////////////
//Allow window to close without the CloseQuery checks being performed.
ib_disableclosequery = True
// If appropriate force this window to be on top.
of_SetAlwaysOnTop(gnv_app.inv_debug.inv_sqlspy.of_GetAlwaysOnTop())
//Determine what controls should be visible/enabled
If Not gnv_app.inv_debug.inv_sqlspy.of_GetAllowInspect() Then
//Hide all controls that relate to the default functionality.
cbx_batchmode.Visible = False
//Move the History controls to fill up the entire window.
//The window's resize event will then take take of resizing them correctly.
gb_sqlhistory.Move (gb_sqlhistory.X, gb_sqlhistory.Y - 100)
gb_sqlhistory.Resize (gb_sqlhistory.Width, gb_sqlhistory.Height + 100)
mle_history.Move (mle_history.X, mle_history.Y - 100)
mle_history.Resize (mle_history.Width, mle_history.Height + 100)
Else
//Syncronize the visual BatchMode checkbox.
of_updatebatchmode()
End If
//Get the current history
of_updatehistory()
//Start the resize service
of_SetResize(True)
//Set the minimum size of the window
inv_resize.of_SetMinSize( cbx_batchmode.X + cb_clear.Width *3 + 145, &
mle_history.Y + cb_clear.Height *3 + 90)
//Register each control that needs to move or resize after the window resizes
inv_resize.of_Register (cb_clear, inv_resize.FIXEDRIGHTBOTTOM)
inv_resize.of_Register (cb_save, inv_resize.FIXEDRIGHTBOTTOM)
inv_resize.of_Register (cb_print, inv_resize.FIXEDRIGHTBOTTOM)
inv_resize.of_Register (gb_sqlhistory, inv_resize.SCALERIGHTBOTTOM)
inv_resize.of_Register (mle_history, inv_resize.SCALERIGHTBOTTOM)
inv_resize.of_register (cb_close, inv_resize.FIXEDRIGHTBOTTOM)
inv_resize.of_register (cb_dlghelp, inv_resize.FIXEDRIGHTBOTTOM)
//If appropriate, start the Preference service.
If gnv_app.of_IsRegistryAvailable() Then
If Len(gnv_app.of_GetUserKey())> 0 Then
of_SetPreference(True)
End If
Else
If Len(gnv_app.of_GetUserIniFile()) > 0 Then
of_SetPreference(True)
End If
End If
end event