|
open
|
|
Full name
|
pfc_w_find.open
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event open()
|
Name
|
Datatype
|
li_adjust
|
integer
|
li_count
|
integer
|
li_i
|
integer
|
li_origWindowHeight
|
integer
|
li_windowHeightAdjust
|
integer
|
event open;call super::open;//////////////////////////////////////////////////////////////////////////////
//
// Event: open
//
// Arguments: none
//
// Returns: none
//
// Description: This event is used to initialize the window using the
// passed in nvo-structure.
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
// 6.0 Corrected clipping problems when lower controls not visible
// Adjust resizing of window to accomodate help button
//
//////////////////////////////////////////////////////////////////////////////
//
// 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_count=0
integer li_i=0
integer li_adjust=0
integer li_windowHeightAdjust
integer li_origWindowHeight
li_windowHeightAdjust = 50
li_origWindowHeight = this.height
//Make a local copy of attributes.
inv_findattrib = message.powerobjectparm
//Allow window to close without the CloseQuery checks being performed.
ib_disableclosequery = True
//////////////////////////////////////////////////////////////////////////////
// Set the Enabled/Visible attributes for the appropriate controls.
//////////////////////////////////////////////////////////////////////////////
//The Whole Word control.
cbx_wholeword.Visible = inv_findattrib.ib_wholewordvisible
cbx_wholeword.Enabled = inv_findattrib.ib_wholewordenabled
//The Match Case control.
cbx_matchcase.Visible = inv_findattrib.ib_matchcasevisible
cbx_matchcase.Enabled = inv_findattrib.ib_matchcaseenabled
//The lookup controls.
ddlb_findwhere.Visible = inv_findattrib.ib_lookvisible
st_findwhere.Visible = inv_findattrib.ib_lookvisible
ddlb_findwhere.Enabled = inv_findattrib.ib_lookenabled
st_findwhere.Enabled = inv_findattrib.ib_lookenabled
//The direction controls.
ddlb_searchdirection.Visible = inv_findattrib.ib_directionvisible
st_searchdirection.Visible = inv_findattrib.ib_directionvisible
ddlb_searchdirection.Enabled = inv_findattrib.ib_directionenabled
st_searchdirection.Enabled = inv_findattrib.ib_directionenabled
//////////////////////////////////////////////////////////////////////////////
// Initialize controls with the appropriate data.
//////////////////////////////////////////////////////////////////////////////
//Set the lookup values.
If ddlb_findwhere.visible Then
li_count = upperbound(inv_findattrib.is_lookdata)
if li_count >0 THEN
for li_i=1 TO li_count
ddlb_findwhere.additem(inv_findattrib.is_lookdisplay[li_i])
next
end if
If inv_findattrib.ii_lookindex > 0 Then
ddlb_findwhere.SelectItem(inv_findattrib.ii_lookindex)
Else
ddlb_findwhere.SelectItem(1)
End If
End If
//Set text to Find What.
sle_findwhat.text = inv_findattrib.is_find
//Set the WholeWord flag.
If cbx_wholeword.Visible Then
cbx_wholeword.Checked = inv_findattrib.ib_wholeword
End If
//Set the MatchCase flag.
If cbx_matchcase.Visible Then
cbx_matchcase.Checked = inv_findattrib.ib_matchcase
End If
//Set the Direction attribute.
If ddlb_searchdirection.visible Then
If Lower(inv_findattrib.is_direction)= 'up' Then
ddlb_searchdirection.Text = 'Up'
Else
ddlb_searchdirection.Text = 'Down'
End If
End If
//////////////////////////////////////////////////////////////////////////////
// Resize window and Move controls, if appropriate.
//////////////////////////////////////////////////////////////////////////////
//If the lookup controls are not visible, moving of other controls is required.
if ddlb_findwhere.visible = False then
// calculate Y position to adjust.
li_adjust = sle_findwhat.y - ddlb_findwhere.y
// move other controls up.
cbx_matchcase.y = cbx_matchcase.y - li_adjust
cbx_wholeword.y = cbx_wholeword.y - li_adjust
ddlb_searchdirection.y = ddlb_searchdirection.y - li_adjust
sle_findwhat.y = sle_findwhat.y - li_adjust
st_searchdirection.y = st_searchdirection.y - li_adjust
st_searchfor.y = st_searchfor.y - li_adjust
//Resize the window to match the adjustment
this.height = this.height - li_windowHeightAdjust
//Set focus on the appropriate control.
sle_findwhat.SetFocus()
end if
//If the wholeword is not visible, move the matchcase control.
If cbx_wholeword.visible = False and cbx_matchcase.Visible Then
cbx_matchcase.Y = cbx_wholeword.Y
// Only resize window height if not previously resized
if this.height = li_origWindowHeight then
this.height = this.height - li_windowHeightAdjust
end if
End If
//If all bottom conrols are not visible, adjust the size of the window.
If ddlb_searchdirection.Visible=False And cbx_wholeword.visible = False And &
cbx_matchcase.Visible= False Then
// Only resize window height if not previously resized
if this.height = li_origWindowHeight then
this.height = this.height - li_windowHeightAdjust
end if
End If
end event
Name
|
Owner
|
dragobject.setfocus |
dragobject
|
dropdownlistbox.additem |
dropdownlistbox
|
dropdownlistbox.selectitem |
dropdownlistbox
|
systemfunctions.lower |
systemfunctions
|
systemfunctions.upperbound |
systemfunctions
|
pfc_w_master.open |
pfc_w_master
|