Change worksheet label text style control.
bool wks_set_label_text_control( Worksheet & wks, int nLabel, int nStyle )
Returns true on success and false on failure.
EX1
void wks_set_label_text_control_ex1() { WorksheetPage pg; pg.Create("Origin"); if ( !pg ) { out_str("Failed to create new worksheet!"); return; } string buf = "C:\\abc.txt"; // C:\abc.txt Worksheet wks = pg.Layers(); if ( !wks_set_label_text_control(wks, RCLT_COMMENT, WKS_LABEL_TEXT_CONTROL_EDIT) ) { out_str("Failed to change worksheet label text style control!"); return; } wks.Columns(0).SetComments(buf); // .. see result of column A comments, it will be : // +------------+ // | C:\abc.txt | // +------------+ }
EX2
void Grid_SetUserDefinedLabelNames_ex() { Worksheet wks = Project.ActiveLayer(); if(wks) { Worksheet wks; wks.Create("Origin", CREATE_VISIBLE); wks.AddCol(); Grid gg; gg.Attach(wks); // attach the grid to the worksheet vector<string> vsUDLs = {"Decay Rate"}; gg.SetUserDefinedLabelNames(vsUDLs); // Add two user defined labels. vector<int> vnTypes; gg.GetShowLabels(vnTypes, TRUE); // Get the current showing column label list vnTypes.Add(RCLT_UDL); // update the showing column label list gg.SetShowLabels(vnTypes); // Set the showing column labels wks.GetPage().Refresh(); wks_set_label_text_control(wks, RCLT_LONG_NAME, WKS_LABEL_TEXT_CONTROL_ORIGIN_TEXT); wks_set_label_text_control(wks, RCLT_UNIT, WKS_LABEL_TEXT_CONTROL_ORIGIN_TEXT); wks_set_label_text_control(wks, RCLT_COMMENT, WKS_LABEL_TEXT_CONTROL_ORIGIN_TEXT); wks_set_label_text_control(wks, RCLT_UDL, WKS_LABEL_TEXT_CONTROL_ORIGIN_TEXT); StringArray LongNames= {"H\-(2)", "Si", "N\-(2)"}; StringArray UnitNames= {"\g(m)mol/s", "\g(m)mol/s", "\g(m)mol/s"}; StringArray CommentNames= {"H\-(2)O", "SiO\-(2)", "NO"}; StringArray UDPNames= {"e\+(-t)", "e\+(-2t)", "e\+(-3t)"}; for( int ii = 0 ; ii < 3 ; ii++ ) { wks.Columns(ii).SetExtendedLabel(LongNames[ii], RCLT_LONG_NAME); wks.Columns(ii).SetExtendedLabel(UnitNames[ii], RCLT_UNIT); wks.Columns(ii).SetExtendedLabel(CommentNames[ii], RCLT_COMMENT); wks.Columns(ii).SetExtendedLabel(UDPNames[ii], RCLT_UDL); } } }
Column::SetExtendedLabel Grid::SetUserDefinedLabelNames Grid::GetShowLabels Grid::SetShowLabels
origin.h