UpdateThemeIDs
This method allows a tree with no theme ID to be used in ApplyFormat.
int UpdateThemeIDs( TreeNode & trNode, LPCTSTR lpcszName = NULL, LPCTSTR lpcszValue = NULL )
0 for no error.
EX1
void OriginObject_UpdateThemeIDs_Ex1(string strName = "Rect") { GraphLayer gl = Project.ActiveLayer(); GraphObject gg = gl.GraphObjects(strName); if(gg) { Tree tr; tr.Root.Fill.Color.nVal = -4; // this value corresponds to transparent, or NONE in dialog tr.Root.Fill.Pattern.Style.nVal = 6; tr.Root.Fill.Pattern.UseBorderColor.nVal = 0;// independent color for fill pattern lines tr.Root.Fill.Pattern.PatternColor.nVal = 6; // yellow tr.Root.Fill.Pattern.Width.dVal = 0.1; // fill pattern line width tr.Root.Fill = tr.Root.Border; int nErr = gg.UpdateThemeIDs(tr.Root); if(0 == nErr) gg.ApplyFormat(tr, true, true); } }
The ApplyFormat method takes a tree with proper theme ID to make internal assignments to set various properties in an object. For an Origin C programmer, it is more friendly to deal with tag names then with theme IDs. With this method, one can construct a tree with simple a.b.c notation and call this function to prepare the tree by adding theme IDs acording to internal theme rules.
OriginObject::ApplyFormat
origin.h