|
open
|
|
Full name
|
pfc_w_replace.open
|
Access
|
public
|
Extend of
|
|
Return value
|
|
Prototype
|
event open()
|
Name
|
Datatype
|
li_adjust
|
integer
|
li_count
|
integer
|
li_i
|
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 Window height does not change due 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
integer li_i
integer li_adjust
//Make a local copy of attribute nvo-structure
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 text to replace with.
sle_replace.text = inv_findattrib.is_replacewith
//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 Controls up
cbx_matchcase.y = cbx_matchcase.y - li_adjust
cbx_wholeword.y = cbx_wholeword.y - li_adjust
st_searchdirection.y = st_searchdirection.y - li_adjust
ddlb_searchdirection.y = ddlb_searchdirection.y - li_adjust
st_replace.y = st_replace.y - li_adjust
sle_replace.y = sle_replace.y - li_adjust
st_findwhat.y = st_findwhat.y - li_adjust
sle_findwhat.y = sle_findwhat.y - li_adjust
//Set focus on the appropriate control.
sle_findwhat.setfocus()
end if
//If the wholeword is not visible, move the matchase control.
If cbx_wholeword.visible = False and cbx_matchcase.Visible Then
cbx_matchcase.Y = cbx_wholeword.Y
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
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
|