The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Use a design form like a template possible?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
ThomasR Posted - 02/19/2014 : 2:57:42 PM
Origin Ver. 9 and Service Release (Select Help-->About Origin):
Operating System: Win7

Using Origin I made a template and a design form.
Both template and design(form)-file I want to apply using Code in OriginC.

How can I use the design by code?
The template is no problem with
GraphLayer gl;
gl.Create("Line"); (If the template is called Line)

How do I tell the layer to use a design called "myDesign"? Even better, if I could tell the path to that design file.
I don't want to click on the menubar and apply it with my mouse.

Greetings
Thomas
6   L A T E S T    R E P L I E S    (Newest First)
bobey Posted - 03/10/2015 : 12:22:36 AM
Do we just need to save a projec before quit and use it to do another one later?
Castiel Posted - 02/26/2014 : 10:38:35 AM
quote:
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.


At first glance,it should be theme related. So I look over the functions in the workspace: System and sometimes Temporary.


quote:

if (variables.GetSize()==3){
gp.Create("U:\40_Datenauswertung\OriginC\Templates\StackPlot3Var");


BTW, backslash "\" should be "\\".

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
ThomasR Posted - 02/26/2014 : 09:52:25 AM
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.
Castiel Posted - 02/26/2014 : 08:48:15 AM
quote:
Originally posted by ThomasR


Yes perhaps I meant that. It was just to illustrate the general problem. I am referring to the thing called "Design" by Origin itself.
That thing that saves fonts and such.

That files are saved in the folder C:\Users\<myname>\Documents\OriginLab\90\Anwenderdateien\Themes\Graph and called "*.oth". "Anwenderdateien" is sth. like "AppData" in english.

As you can see in the picture, to apply a design, I need to click on it and then on the apply-button. I want to do this by code. This must be possible... I know where the design file is placed and want to trigger a command that uses that file....



I think what you need is
bool apply_graph_theme(LPCSTR lpcszTheme, PageBase& pg);

"*.oth" is kind of xml file: ApplyFormat(an_oth_tree). You can tell this when looking into theme_utils.c in Origin C Workspace->System.


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
ThomasR Posted - 02/26/2014 : 03:44:17 AM
quote:
Originally posted by greg

We do not understand your use of the word "design". What would this be in Origin terminology.

P.S. Your code fragment:

GraphLayer gl;
gl.Create("Line"); (If the template is called Line)

does not compile. Perhaps you meant:

GraphPage gp;
gp.Create("Line"); (If the template is called Line)




Yes perhaps I meant that. It was just to illustrate the general problem. I am referring to the thing called "Design" by Origin itself.
That thing that saves fonts and such.

That files are saved in the folder C:\Users\<myname>\Documents\OriginLab\90\Anwenderdateien\Themes\Graph and called "*.oth". "Anwenderdateien" is sth. like "AppData" in english.

As you can see in the picture, to apply a design, I need to click on it and then on the apply-button. I want to do this by code. This must be possible... I know where the design file is placed and want to trigger a command that uses that file....
greg Posted - 02/25/2014 : 12:45:41 PM
We do not understand your use of the word "design". What would this be in Origin terminology.

P.S. Your code fragment:

GraphLayer gl;
gl.Create("Line"); (If the template is called Line)

does not compile. Perhaps you meant:

GraphPage gp;
gp.Create("Line"); (If the template is called Line)

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000