01-22-2007 01:52 PM
01-22-2007 02:43 PM - edited 01-22-2007 02:43 PM
Message Edited by Jonathan N on 01-22-2007 02:43 PM
01-22-2007 02:48 PM
01-22-2007 04:01 PM
01-23-2007 02:14 AM
01-23-2007 07:48 AM - edited 01-23-2007 07:48 AM
Message Edited by DLazarski on 01-23-2007 07:57 AM
01-23-2007 09:16 AM - edited 01-23-2007 09:16 AM
Message Edited by DLazarski on 01-23-2007 09:19 AM
01-23-2007 09:52 AM - edited 01-23-2007 09:52 AM
Hello DLazarkski,
the attributes ATTR_XCOORD_AT_ORIGIN and ATTR_YCOORD_AT_ORIGIN allow you to change the (0, 0) point of the canvas. By default, the (0, 0) point is the left upper point of your canvas. If you use these attributes and then use the CanvasClear function with your area set to VAL_ENTIRE_OBJECT, you might indeed get weird results. VAL_ENTIRE_OBJECT is defined in the header file "userint.h":
#define VAL_ENTIRE_OBJECT MakeRect(0,0,VAL_TO_EDGE, VAL_TO_EDGE)
As you can see in this definition, the 'top' and 'left' members of the Rect structure are both set to 0. If you have changed this (0, 0)-point using the ATTR_XCOORD_AT_ORIGIN and ATTR_YCOORD_AT_ORIGIN attributes, only one quadrant of your canvas will be cleared. Instead of using VAL_ENTIRE_OBJECT to clear the canvas, you should use the MakeRect macro to define a rectangle that covers the entire canvas. I think the code below should work (not sure though):
GetCtrlAttribute (panel, GRAPH_CANVAS, ATTR_XCOORD_AT_ORIGIN, &origin.x);
GetCtrlAttribute (panel, GRAPH_CANVAS, ATTR_YCOORD_AT_ORIGIN, &origin.y);
CanvasClear (panel, GRAPH_CANVAS, MakeRect (-origin.y, -origin.x, VAL_TO_EDGE, VAL_TO_EDGE));
Hope this helps...
Message Edited by Wim S on 01-23-2007 04:54 PM
01-23-2007 10:03 AM