pfc_undoedit


pfcapsrv.pbl   >   pfc_n_cst_lvsrv_datasource   >   pfc_undoedit   

Full name pfc_n_cst_lvsrv_datasource.pfc_undoedit
Access public
Extend of integer
Return value integer
Prototype event integer pfc_undoedit()

Name Datatype
No Data

Name Datatype
lds_DataStore n_ds
ll_Row long
ll_undohandle long
llvi_Item listviewitem
ls_undotext string

event pfc_UndoEdit;call super::pfc_UndoEdit;//////////////////////////////////////////////////////////////////////////////
//	Event:			pfc_UndoEdit
//	Arguments:		None
//	Returns:			integer
//	 					1 = success; last change was undone
//	 					0 = nothing to undo
//						-1 = error
//	Description:	Restore the previous value the label had before it was changed
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						6.0   Initial version
//////////////////////////////////////////////////////////////////////////////
//	Copyright © 1996-1999 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_Row, ll_undohandle
string				ls_undotext
n_ds					lds_DataStore
listviewitem		llvi_Item

// Check reference variables
if IsNull(ilv_requestor) or not IsValid(ilv_requestor) then return -1

// Do not undo if undo is not set
if not ib_Undo then return -1

// Check to see if we have something to undo
if il_UndoEditHandle < 1 then return 0

ll_undohandle = il_UndoEditHandle
ls_undotext = is_UndoEditLabelText
	
// Reset the undo values here.  if an error occurs do not want undo hanging around
il_UndoEditHandle = 0
is_UndoEditLabelText = ""
is_UndoType = ""

// Get the listview item
if ilv_requestor.GetItem(ll_undohandle, llvi_Item) < 1 then return -1

// Get the row in the DataStore
if of_GetDataRow(ll_undohandle, lds_DataStore, ll_Row) = -1 then return -1

// Change the value of the label column
lds_DataStore.SetItem(ll_Row, inv_Attrib.is_LabelColumn, ls_undotext)

// Reset the label on the treeivew item
llvi_Item.Label = ls_undotext
if ilv_requestor.SetItem(ll_undohandle, llvi_item) < 1 then return -1

return 1
end event

     
Name Owner
pfc_n_cst_lvsrv_datasource.pfc_undo pfc_n_cst_lvsrv_datasource

     
Name Owner
listview.getitem listview
listview.setitem listview
datastore.setitem datastore
systemfunctions.isnull systemfunctions
systemfunctions.isvalid systemfunctions
pfc_n_cst_lvsrv_datasource.of_GetDataRow pfc_n_cst_lvsrv_datasource

     
Full name
No Data

     
Name Scope
No Data