Author: | Eric Aling |
Accessed: | |
Download: | (Graphic.zip, 23Kb) |
What does this service do:
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 ) else 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 else super::event rbuttonup(xpos,ypos,row,dwo) end if return 1
In the destructor event for u_dw code:
This.of_SetGraphics(False)
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
NOTE
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!