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
 LabTalk Forum
 Long Name/Units Style - Rich Text

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
j@y Posted - 07/13/2015 : 01:42:36 AM
Hi all,
Please, is there any way how to enable/disable the 'Rich Text' option for Long Name/Units Style in a specific Worksheet by using either OriginC or LabTalk?
Thanks for your help in advance.
5   L A T E S T    R E P L I E S    (Newest First)
cpyang Posted - 02/14/2017 : 2:32:13 PM
The OC function

wks_set_label_text_control

is documented here:

http://www.originlab.com/doc/OriginC/ref/wks_set_label_text_control

You can easily write up your version and make it callable from LabTalk by placing it in the AutoLoad folder in code builder.

CP
Castiel Posted - 07/20/2015 : 9:19:41 PM
quote:
Originally posted by j@y

PS: The method mentioned earlier is valid for Origin 9.2 (2014/2015) but not for Origin 9.0 and older since theme_utils.* and related files differ! Older versions crash down during compilation or, if compiled, during execution of such a code even if newer version of theme_utils.h or relevant parts are included.
Any idea how to do the same for Origin 9.0 or by using OriginC or LabTalk?
Many thanks!


why not using
bool wks_set_label_text_control(Worksheet& wks, int nLabel, int nStyle)


©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦
j@y Posted - 07/20/2015 : 4:48:22 PM
PS: The method mentioned earlier is valid for Origin 9.2 (2014/2015) but not for Origin 9.0 and older since theme_utils.* and related files differ! Older versions crash down during compilation or, if compiled, during execution of such a code even if newer version of theme_utils.h or relevant parts are included.
Any idea how to do the same for Origin 9.0 or by using OriginC or LabTalk?
Many thanks!
j@y Posted - 07/13/2015 : 05:48:01 AM
Thank you very much, Jason!
jasonzhao Posted - 07/13/2015 : 04:42:24 AM
Hello,

This can be controled by Origin C, please refer to the code below:


#include <..\OriginLab\theme_utils.h>
void test_rich_text()
{
	Worksheet wks = Project.ActiveLayer();
	if ( wks )
	{
		Tree trFmt;
		trFmt = wks.GetFormat(FPB_ALL, FOB_ALL & ~(FOB_LINK_STYLE|FOB_RANGE_STYLE), TRUE, TRUE);
		TreeNode trTextFmt = theme_tree_get_node_by_name_strval(trFmt, STR_NAMESTYLE_LONG_NAME);
		if ( trTextFmt )
		{
			trTextFmt.Style.Control.strVal = "Origin Text Edit";  //this set the column into rich text
			trTextFmt.Style.Control.strVal = "Edit Control";  //this set the column into non rich text
			if ( 0 == wks.UpdateThemeIDs(trFmt.Root) )
			{
				wks.ApplyFormat(STYLE_REPAINT | STYLE_RELATIVE | STYLE_UNDO | STYLE_COMPLETE, trFmt);
				//after set as Rich Text, set long name to column				
			}
		}
	}
}


You can set all columns in worksheet into "rich text" by delete this row:

trTextFmt.Style.Control.strVal = "Edit Control";



Best regards!
Jason
OriginLab Technical Service


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