<?xml version="1.0"?>
<OriginStorage FileName="D:\OriginPro80\X-Functions\Samples\eventinfo_ex.OXF" Display="652" Label="System: eventinfo_ex"><XFname NodeID="11" Label="Name" DataID="300">eventinfo_ex</XFname><xFdescription NodeID="11" Label="Description" DataID="310"></xFdescription><attachTo NodeID="13" Label="Attach to Origin Object" Combo="None|Auto|Column|Sheet/Layer|Book/Graph" DataID="320">1</attachTo><UsageCtxt NodeID="268435456" Label="Usage Context" DataID="329" Use="1"><LabTalk NodeID="10" Label="Labtalk" DataID="357">0</LabTalk><WksSel NodeID="10" Label="Worksheet Selection" DataID="350">0</WksSel><WksSel NodeID="10" Label="Worksheet Selection Change" DataID="355">0</WksSel><WksSel NodeID="10" Label="Worksheet Selection Tracking" DataID="356">0</WksSel><GrObj NodeID="268435456" Label="Graphic Object Events" DataID="330" Use="1"><InitAnchors NodeID="10" Label="Initialization" DataID="339">1</InitAnchors><Move NodeID="10" Label="Move" DataID="331">1</Move><Moving NodeID="10" Label="Moving" DataID="332">1</Moving><Resize NodeID="10" Label="Resize" DataID="333">1</Resize><Resizing NodeID="10" Label="Resizing" DataID="334">1</Resizing><Delete NodeID="10" Label="Delete" DataID="335">1</Delete><Select NodeID="10" Label="Select" DataID="336">1</Select><Unselect NodeID="10" Label="Unselect" DataID="337">1</Unselect><BtnClick NodeID="10" Label="Button Click" DataID="338">0</BtnClick><Rotate NodeID="10" Label="Rotate" DataID="340">1</Rotate><Rotating NodeID="10" Label="Rotating" DataID="341">1</Rotating><Skew NodeID="10" Label="Skew" DataID="342">1</Skew><Skewing NodeID="10" Label="Skewing" DataID="343">1</Skewing><EditEv NodeID="10" Label="Edit" DataID="344">1</EditEv><Editing NodeID="10" Label="Editing" DataID="345">1</Editing></GrObj><ToXFHeader NodeID="10" Label="Declare in xf.h" DataID="358">0</ToXFHeader><mainmenu NodeID="268435456" Label="Main Menus" DataID="328"><GrAnalys NodeID="10" Label="Graph Analysis" DataID="359">0.</GrAnalys><WksAnalys NodeID="10" Label="Worksheet Analysis" DataID="360">0.</WksAnalys><WksStatistics NodeID="10" Label="Worksheet Statistics" DataID="361">0.</WksStatistics></mainmenu></UsageCtxt><vars NodeID="268435456" Label="Variables" Branch="1" MoveRows="" EditCol="1|1|1"><v1 NodeID="268435456" _XFUNCTION_VAR="1" RepeatID="1" Branch="1"><name NodeID="11" Label="Name" DataID="10">ei</name><description NodeID="11" Label="Description" DataID="20"></description><io NodeID="13" Label="Input/Output" Combo="Input|Output|Input/Output" DataID="30" Handler="120784504">2</io><type NodeID="11" Label="Data Type" Combo="double|string|int|vector|Range|XYRange|XYZRange|matrix|MatrixObject|ButtonInfo|LineInfo|TextInfo|EventInfo|MarkerInfo" DataID="40" Handler="120784504">EventInfo</type><valdata NodeID="11" Enable="1" Label="Data" DataID="50"></valdata><Context NodeID="268435456" Label="Context"/><Data NodeID="268435456" Label="New Output Data" DataID="911" Branch="2048" Use="0" Show="0"><Book NodeID="11" Label="Book" Combo="&lt;active&gt;|&lt;new&gt;|&lt;source&gt;|&lt;existing&gt;..." DataID="903" Handler="87123568">&lt;active&gt;</Book><Sheet NodeID="11" Label="Sheet" Combo="&lt;active&gt;|&lt;new&gt;|&lt;existing&gt;..." DataID="904" Handler="169683616" Enable="1">&lt;active&gt;</Sheet><ColumnName NodeID="11" Label="Column" DataID="912">Default</ColumnName><XColumnName NodeID="11" Label="XColumn" DataID="913">X</XColumnName><YColumnName NodeID="11" Label="YColumn" DataID="914">Y</YColumnName><ZColumnName NodeID="11" Label="ZColumn" DataID="915">Z</ZColumnName></Data></v1></vars><rettype NodeID="11" Label="Return Type" Combo="void|int" DataID="41">void</rettype><header NodeID="45" Label="Header" DataID="323" RowHeightRange="3-15"><![CDATA[#include <origin.h>
]]></header><code NodeID="45" Label="Expression" DataID="325" RowHeightRange="5-20"><![CDATA[GraphObject go;
ei.GetParent(go); // Get GraphicObject to which X-Function is attached from EventInfo object passed
string strName = go.GetName(); // Get name of GraphicObject
int nEvent = ei.GetEvent(); // Get event ID

LT_execute("type -a");
if( OE_INIT_ANCHORS == nEvent ) // Intializing GraphicObject in Origin
	printf("Initialing Graphic Object '%s'\n", strName);
else if( OE_MOVE == nEvent ) // Moved GraphicObject in Origin (after let go with mouse) 
	printf("Moved Graphic Object '%s'\n", strName);
else if( OE_MOVING == nEvent ) // Moving (dragging) GraphicObject in Origin
	printf("Moving Graphic Object '%s'\n", strName);
else if( OE_RESIZE == nEvent ) // Resized GraphicObject in Origin (after let go with mouse)
	printf("Resized Graphic Object '%s'\n", strName);
else if( OE_RESIZING == nEvent ) // Resizing GraphicObject in Origin
	printf("Resizing Graphic Object '%s'\n", strName);
else if( OE_SELECT == nEvent ) // Selected GraphicObject in Origin (after let go with mouse)
	printf("Selected Graphic Object '%s'\n", strName);
else if( OE_UNSELECT == nEvent ) // Unselected GraphicObject in Origin (after let go with mouse)
	printf("Unselected Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_ROTATE == nEvent ) // Rotated GraphicObject in Origin (after let go with mouse)
	printf("Rotated Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_ROTATING == nEvent ) // Rotating GraphicObject in Origin
	printf("Rotating Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_SKEW == nEvent ) // Skewed GraphicObject in Origin (after let go with mouse)
	printf("Skewed Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_SKEWING == nEvent ) // Skewing GraphicObject in Origin
	printf("Skweing Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_EDIT == nEvent ) // Edited GraphicObject in Origin (after let go with mouse)
	printf("Edited Graphic Object '%s'\n", strName);
else if( OE_GRAPHOBJ_EDITING == nEvent ) // Editing GraphicObject in Origin
	printf("Editing Graphic Object '%s'\n", strName);
else if( OE_DELETE == nEvent ) // Deleted GraphicObject in Origin
	printf("Deleted Graphic Object '%s'\n", strName);

if( OE_MOVE == nEvent || OE_RESIZE == nEvent || OE_GRAPHOBJ_ROTATE == nEvent || OE_GRAPHOBJ_SKEW == nEvent || OE_GRAPHOBJ_EDIT == nEvent )
	Selection.Reset(TRUE); // Reset selection so GraphObject isn't selected after move, resize, rotate, skew, edit]]></code></OriginStorage>
