Make your own free website on

PFC Graphics datawindow service (18 aug 1998)

Back Up Next

Author: Eric Aling
Download: Download (, 23Kb)

What does this service do:

  1. With this datawindow service, when the datawindow contains a graph object ( or fuly is a graph object ), you can change it's type via the RightMouseButton (RMB), if enabled,
  2. Secondly, via RMB, you can change the color of the object inside a graph, if enabled,
  3. It automatically explodes pie pieces, if enabled.

All stuff is included in the zip file. Here is a description if you want to merge it into your existing u_dw. To make this work, you need to modify the u_dw datawindow userobject. Add an instance variable:

n_cst_dwsrv_graphics inv_graphics

Create an objectfunction "integer of_SetGraphics(boolean ab_switch)" to start/stop the service:

if ab_switch then
	inv_graphics = create n_cst_dwsrv_graphics
	inv_graphics.of_SetRequestor ( this )
	if isvalid(inv_graphics) then
		destroy inv_graphics
	end if
end if
return 1

Override the rbuttonup event and code the following:

// overridden

face="Courier">// RMB support for graphs
if dwo.type = "graph" then
	if isvalid ( inv_Graphics ) then
		inv_Graphics.Event ue_rbuttonup(xpos,ypos,row,dwo)
	end if
	super::event rbuttonup(xpos,ypos,row,dwo)
end if

return 1

In the destructor event for u_dw code:


In the clicked event for u_dw code:

if dwo.type = "graph" then
	if IsValid(inv_Graphics) then
		inv_Graphics.Event ue_explode(xpos,ypos,row,dwo)
	end if
end if

Now, to enable the datawindow service, call the following function(s) in your datawindow contructor event:

this.of_SetGraphics(true)					// Enable the graphics service
this.inv_Graphics.of_SetGraphName("gr_test")	// Set the graphsname, default "gr_1" is used
this.inv_Graphics.of_SetRMBType(True)		// Enable change type via RMB
this.inv_Graphics.of_SetRMBColor(True)		// Enable change color via RMB
this.inv_Graphics.of_SetDrillDown(True)		// Enable pie piece explode

The n_cst_dwnsrv_graphics service makes use of another extension for changing the object's color. This is done in the of_ChooseColor function. At this moment, it is commented out and default a green color will be assigned. You can change this function so that your own color chooser can be used. If you have downloaded the of_ChooseColor platform extension, you just have to uncomment to code mentoined to make it work.

Good luck!

Back Up Next