vg_extendedaction


vge_security.pbl   >   vge_n_cst_vgmanager   >   vg_extendedaction   

Full name vge_n_cst_vgmanager.vg_extendedaction
Access public
Extend of
Return value
Prototype event vg_extendedaction()

Name Datatype
No Data

Name Datatype
i integer
i_colnum integer
ldw_target datawindow
ls_column string
s_modify String
s_objecttype String

event vg_extendedaction;/*_____________________________________________________________________________
Description	:	Adds a new action extends Visual Guard standard actions.
Comment		:	

Arguments	:	apo_target_object : The target object on which the action must be processed.
					as_action 			: string containing the name of the action 
					as_param 			: string containing parameters of action. Each parameter is separated by comma.
Return		:	integer -1 if the action is failed, 2 if the action is unknown, 1 otherwise.
Subject:			VISUAL_GUARD
Historique	:	
					V1.00 - HC - 07/06/2000 - Initial version.
_____________________________________________________________________________*/


integer 	i_colnum, i
String s_modify, s_objecttype
datawindow ldw_target
string ls_column
CHOOSE CASE as_action
	CASE "disable column" // Extend 'disable column' action
		// Verify if the type of the target object is correct for this action
		IF TypeOf (apo_target_object) = datawindow! THEN
			// This action can disable a group of columns. Each column is separated by comma.
			ldw_target = apo_target_object
			DO WHILE as_param <> ""
				ls_column = vg_f_get_token(as_param,",")
				// Make the column's background opaque
				IF ldw_target.Modify (ls_column + ".Background.Mode='1'") <> "" THEN 
					Return -1
				END IF
			LOOP
			Return 1
		ELSE
			Return -1
		END IF
	CASE "enable column" // Extend 'enable column' action
		// Verify if the type of the target object is correct for this action
		IF TypeOf (apo_target_object) = datawindow! THEN
			// This action can disable a group of columns. Each column is separated by comma.
			ldw_target = apo_target_object
			DO WHILE as_param <> ""
				ls_column = vg_f_get_token(as_param,",")
				// Make the column's background transparent
				IF ldw_target.Modify (ls_column + ".Background.Mode='1'") <> "" THEN 
					Return -1
				END IF
			LOOP
			Return 1
		ELSE
			Return -1
		END IF
	CASE	"extended readonly" // Add a specific action
		if TypeOf (apo_target_object) <> datawindow! THEN Return -1

		ldw_target = apo_target_object
		IF ldw_target.Modify ("DataWindow.ReadOnly='Yes'") <> "" THEN 
			Return -1
		END IF
		
		
		i_colnum = Integer(ldw_target.Describe("datawindow.column.count"))
		
		IF i_colnum < 1 THEN Return -1 
		
		FOR i = 1 TO i_colnum
			
			IF Long(ldw_target.describe("#" + String(i) + ".x")) <> 0  THEN
				s_modify = s_modify + " #"+String(i)+".background.mode = '1'"
			END IF
			
		NEXT
		
		IF ldw_target.Modify(s_modify) <> "" THEN 
			Return -1
		END IF

		Return 1
END CHOOSE

// Unknown action 
Return 2


end event

     
Name Owner
No Data

     
Name Owner
powerobject.typeof powerobject
datawindow.describe datawindow
datawindow.modify datawindow
systemfunctions.integer systemfunctions
systemfunctions.long systemfunctions
systemfunctions.string systemfunctions
vg_f_get_token.vg_f_get_token vg_f_get_token

     
Full name
No Data

     
Name Scope
No Data