quote:
I think what you need is
bool apply_graph_theme(LPCSTR lpcszTheme, PageBase& pg);
Where did you find that piece of code? I can't find it in any documents by searching. Was it the OriginC-Programming Guide? But can't find it there.
Meanwhile I tried to apply this example to my code:
void OriginObject_ApplyFormat_Ex1()
{
GraphPage gp = Project.GraphPages(0);
gp.ApplyFormat("themes\\graph\\<MyThemeName>.OTH");
}
My code:
if (variables.GetSize()==3){
gp.Create("U:\40_Datenauswertung\OriginC\Templates\StackPlot3Var");
for (int i= 0;i <3 ; i++){
GraphLayer gl = gp.Layers(i);
Curve crv(wks, 0, getIndexOf(variables[i]));
int nPlot = gl.AddPlot(crv, IDM_PLOT_LINE); // return plot index
if( nPlot >= 0 )
gl.Rescale();
}
gp.ApplyFormat("themes\\graph\\StackPlot3Var.OTH"); //DOES NOT WORK
}
But this did not apply my theme.
Message I get is 2 times "Found invalid Thumb object in UpdateThumb".
If I call "Ticks All Out.OTH" it applies that theme, but it doesn't work for mine, unless I call it manually per mouse.
Ah, I got it. The theme file has been created in another folder (mentioned above). If i copy it to the "themes\graph" folder, it works.