2.2.4.5.47 Column::SetExtendedLabel

Description

Set the extended label by type of extended label.

Syntax

BOOL SetExtendedLabel( LPCSTR lpcszLabel, int nn, BOOL bByType = TRUE )

Parameters

lpcszLabel
[input] the string value
nn
[input] the type. It can be one of the following:
RCLT_LONG_NAME,
RCLT_UNIT,
RCLT_COMMENT,
RCLT_FORMULA,
RCLT_SAMPLE_RATE,
RCLT_SPARKLINE,
RCLT_COL_FILTER,
RCLT_CATEGORIES,
RCLT_PARAM ( RCLT_PARAM + 1, RCLT_PARAM + 2 stands for the 2rd, 3th system parameter ),
RCLT_UDL ( RCLT_UDL + 1, RCLT_UDL + 2 stands for the 2rd, 3th user defined parameter ),
The maximum count of system parameters is 10. The maximum count of user defined paramters is 128. See more details in OC_const.h file.
bByType
[input] must be true.

Return

TRUE if OK, otherwise FALSE.

Examples

EX1

// Create a worksheet with labels
void Column_SetExtendedLabel_Ex1()
{
    Worksheet    wks;
    wks.Create("Origin", CREATE_VISIBLE);
    wks.AddCol();
    for( int ii = 0 ; ii < 3 ; ii++ )
    {
        wks.Columns(ii).SetExtendedLabel("Long Name"+ii, RCLT_LONG_NAME);
        wks.Columns(ii).SetExtendedLabel("Unit"+ii, RCLT_UNIT);
        wks.Columns(ii).SetExtendedLabel("Comment"+ii+"\nand more", RCLT_COMMENT); // Only Comments can be multilined
        wks.Columns(ii).SetExtendedLabel("Param"+ii, RCLT_PARAM);
    }
}

Image1.png

EX2

In this example, label names are input into user defined labels rows. Refer to this page for creating user defined labels rows using OriginC.
// Edit user defined column labels. 
void Column_SetExtendedLabel_Ex2()
{
    Worksheet wks = Project.ActiveLayer();
    StringArray saNames = {"Peter", "John", "Andrew"};
    for( int ii = 0 ; ii < 3 ; ii++ )
    {
        wks.Columns(ii).SetExtendedLabel(saNames[ii], RCLT_UDL);
        wks.Columns(ii).SetExtendedLabel("Machine#" + ftoa(ii+1), RCLT_UDL+1);
    }
}

Image3.png

Remark

Set the extended label by type of extended label.

See Also

Column::GetExtendedLabel Grid::SetUserDefinedLabelNames Grid::GetShowLabels Grid::SetShowLabels

Header to Include

origin.h