Hello,
Please refer to the function below, which set the format of the long name into Rich Text and set long name=2theta for col(B):
#include <..\OriginLab\theme_utils.h>
void test_set_greek_in_longname()
{
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";
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
string strLongName = "2\g(q)";
Column colB(wks, 1);
if ( colB )
{
colB.SetLongName(strLongName);
out_str("Please check Long Name of column B");
}
}
}
}
}
Best regards!
Jason
OriginLab Technical Service