2.2.4.46.42 Worksheet::GetSelectedColumns

Description

Fill a vector with column indexes where column is completely or partially selected

Syntax

BOOL GetSelectedColumns( vector<int> & v )

Parameters

v
[output] Vector of integers which will receive the 0-offset indices of all selected columns

Return

TRUE for success; otherwise FALSE

Examples

EX1

//Output the columns which have a selection.
int Worksheet_GetSelectedColumns_Ex1()
{
    WorksheetPage wksPage = Project.WorksheetPages(0);
    if(!wksPage)
        return -1;
    
    Worksheet wks(wksPage.GetName());
    vector<int> v;
    BOOL bOK = wks.GetSelectedColumns(v);
    if(bOK)
    {
        for( int ii = 0 ; ii < v.GetSize() ; ii++ )
            printf("Column %u has a selection\n", v[ii] + 1);
        return (int) v.GetSize();
    }
    else
        return -1;
}

Remark

Retrieves the 0-offset indices of the selected columns (selected all in in part) in the worksheet.

See Also

Worksheet::GetSelection, Worksheet::GetSelectedRange

Header to Include

origin.h