open


pfcdwsrv.pbl   >   pfc_w_restorerow   >   open   

Full name pfc_w_restorerow.open
Access public
Extend of
Return value
Prototype event open()

Name Datatype
No Data

Name Datatype
ll_height long
ll_loop long
ll_rowcount long
ll_rownumbers long[]
ll_width long
ls_rownumbertype string

event open;call super::open;//////////////////////////////////////////////////////////////////////////////
//
//	Object Name:  pfc_w_restorerow
//
//	Description:  Allows deleted rows to be restored to the primary buffer
//
//////////////////////////////////////////////////////////////////////////////
//	
//	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.
//
//////////////////////////////////////////////////////////////////////////////

long	ll_rowcount
long	ll_width
long	ll_height
long	 ll_loop
string ls_rownumbertype
long	ll_rownumbers[]

SetPointer (hourglass!)

ib_disableclosequery = true

// Get the Passed-in PowerObjectParm
inv_restorerowattrib  = Message.PowerObjectParm
idw_parm = inv_restorerowattrib.idw_active
dw_delete.dataobject = inv_restorerowattrib.idw_active.dataobject
dw_delete.Reset()

// Protect columns
dw_delete.inv_rowselect.of_Modify ("protect", "1", "column", "*", true)

// Copy the rows in the delete buffer to the DW control
idw_parm.RowsCopy (1, idw_parm.DeletedCount (), delete!, dw_delete, 1, primary!)
dw_delete.SelectRow (0, False)

// Get the rowcount.
ll_rowcount = dw_delete.RowCount()

// Apply the appropriate filter (length must be greater than 1).
inv_restorerowattrib.is_filter = Trim(inv_restorerowattrib.is_filter)
If Len(inv_restorerowattrib.is_filter) > 1 Then
	// Execute and validate the filter.
	If dw_delete.SetFilter(inv_restorerowattrib.is_filter) <> 1 Then 
		// Set the return code to mean the window was closed due to an invalid filter.
		inv_return.ii_rc = -1
		CloseWithReturn (this, inv_return)
		Return
	End If
	If dw_delete.Filter() <> 1 Then 
		// Set the return code to mean the window was closed due to an invalid filter.
		inv_return.ii_rc = -1
		CloseWithReturn (this, inv_return)
		Return
	End If		
End If

// Apply the appropriate sort (length must be greater than 1).
inv_restorerowattrib.is_sort = Trim(inv_restorerowattrib.is_sort)
If Len(inv_restorerowattrib.is_sort) > 1 Then
	// Execute and validate the sort.
	If dw_delete.SetSort(inv_restorerowattrib.is_sort) <> 1 Then 
		// Set the return code to mean the window was closed due to an invalid sort.
		inv_return.ii_rc = -1
		CloseWithReturn (this, inv_return)
		Return
	End If
	If dw_delete.Sort() <> 1 Then 
		// Set the return code to mean the window was closed due to an invalid sort.
		inv_return.ii_rc = -1
		CloseWithReturn (this, inv_return)
		Return
	End If		
End If	

// Prevent rows from starting highlighted.
dw_delete.SelectRow (0, False)

// Register controls for resize window service
of_SetResize (true)
inv_resize.of_Register (dw_delete, inv_resize.SCALERIGHTBOTTOM)
inv_resize.of_Register (cb_ok, inv_resize.FIXEDRIGHT)
inv_resize.of_Register (cb_cancel, inv_resize.FIXEDRIGHT)
inv_resize.of_Register (cb_invertselection, inv_resize.FIXEDRIGHT)
inv_resize.of_Register (cb_selectall, inv_resize.FIXEDRIGHT)
inv_resize.of_Register (cb_dlghelp, inv_resize.FIXEDRIGHT)

// Resize DW according to DW object passed in
ll_width = dw_delete.inv_rowselect.of_GetWidth()
ll_width = Min (ii_dwmaxwidth, ll_width)
if ll_width = ii_dwmaxwidth then
	dw_delete.hscrollbar = true
end if
ll_width = Max (ii_dwminwidth, ll_width) 

ll_height = dw_delete.inv_rowselect.of_GetHeight()
ll_height = Min (ii_dwmaxheight, ll_height)
ll_height = Max (ii_dwminheight, ll_height)

Resize (this.width + (ll_width - dw_delete.width), &
	this.height + (ll_height - dw_delete.height))

if ll_rowcount > 0 then
	cb_selectall.enabled = true
	cb_invertselection.enabled = true
else
	cb_ok.enabled = false
	cb_invertselection.enabled = false
	cb_selectall.enabled = false
end if

end event

     
Name Owner
No Data

     
Name Owner
window.resize window
datawindow.deletedcount datawindow
datawindow.filter datawindow
datawindow.reset datawindow
datawindow.rowcount datawindow
datawindow.rowscopy datawindow
datawindow.selectrow datawindow
datawindow.setfilter datawindow
datawindow.setsort datawindow
datawindow.sort datawindow
systemfunctions.closewithreturn systemfunctions
systemfunctions.len systemfunctions
systemfunctions.max systemfunctions
systemfunctions.min systemfunctions
systemfunctions.setpointer systemfunctions
systemfunctions.trim systemfunctions
pfc_n_cst_dwsrv.of_modify pfc_n_cst_dwsrv
pfc_n_cst_dwsrv.of_getheight pfc_n_cst_dwsrv
pfc_n_cst_dwsrv.of_getwidth pfc_n_cst_dwsrv
pfc_w_master.of_setresize pfc_w_master
pfc_n_cst_resize.of_register pfc_n_cst_resize
pfc_w_master.open pfc_w_master

     
Full name
pfc_w_restorerow
pfc_w_restorerow.dw_delete
pfc_w_restorerow.cb_ok
pfc_w_restorerow.cb_selectall
pfc_w_restorerow.cb_invertselection
demopfc

     
Name Scope
No Data