Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ShowRowHeader

Defines the row header display style.

C

int WINAPI SftTree_GetShowRowHeader(HWND hwndCtl);
void WINAPI SftTree_SetShowRowHeader(HWND hwndCtl, int style);
int WINAPI SftTreeSplit_GetShowRowHeader(HWND hwndCtl);
void WINAPI SftTreeSplit_SetShowRowHeader(HWND hwndCtl, int style);

C++

int CSftTree::GetShowRowHeader() const;
void CSftTree::SetShowRowHeader(int style);
int CSftTreeSplit::GetShowRowHeader() const;
void CSftTreeSplit::SetShowRowHeader(int style);

Parameters

hwndCtl

The window handle of the tree control.

style

A value describing the row header display style:

SFTTREE_ROWSTYLE_NONENo row headers.
SFTTREE_ROWSTYLE_BUTTONTEXTDisplays row headers as buttons. No default text.
SFTTREE_ROWSTYLE_TITLETEXTDisplays row headers as titles. No default text.
SFTTREE_ROWSTYLE_BUTTONCOUNT0Displays row headers as buttons. The row header text defaults to the zero-based index of the item and can be specified using SetRowText.
SFTTREE_ROWSTYLE_TITLECOUNT0Displays row headers as titles. The row header text defaults to the zero-based index of the item and can be specified using SetRowText.
SFTTREE_ROWSTYLE_BUTTONCOUNT1Displays row headers as buttons. The row header text defaults to the one-based index of the item and can be specified using SetRowText.
SFTTREE_ROWSTYLE_TITLECOUNT1Displays row headers as buttons. The row header text defaults to the one-based index of the item and can be specified using SetRowText.

Returns

GetShowRowHeader returns a value describing the current row header style.

Comments

The GetShowRowHeader and SetShowRowHeader functions define the row header display style.

If the current style is set to SFTTREE_ROWSTYLE_BUTTONTEXT, SFTTREE_ROWSTYLE_BUTTONCOUNT0 or SFTTREE_ROWSTYLE_BUTTONCOUNT1, the row headers are displayed as buttons, which can be clicked by the user. Row header buttons reflect the selection status (See GetSel and GetCurSel) of each item.

The value defined using SetShowRowHeader applies to all row headers and cannot be changed for individual items.

The status of the row header buttons can be controlled using SetRowHeaderStyle.

Examples

C

            LPSFTTREE_COLUMN_EX lpCol;
            int nCols;
            nCols = SftTree_GetColumnsEx(g_hwndTree, &lpCol);/* Get column attributes */
            Sft_SetPictureSizeOnly(&lpCol[0].Picture1, PIC_SIZEX, PIC_SIZEY);/* Set column header picture size */
            Sft_SetPictureSizeOnly(&lpCol[1].Picture1, PIC_SIZEX, PIC_SIZEY);/* Set column header picture size */
            SftTree_SetColumnsEx(g_hwndTree, nCols, lpCol);/* Set new column attributes */
        }

        SftTree_SetShowRowHeader(g_hwndTree, SFTTREE_ROWSTYLE_BUTTONCOUNT1);/* Row style */
        /* Register the row header picture size.  All row header   */
        /* pictures used must be the same size.  Only one picture  */
        /* needs to be registered, even if several are used.       */
        {
            SFTTREE_ROWINFOPARM RowInfo;
            RowInfo.version = 7;             
            RowInfo.index = -1;

C++

        LPSFTTREE_COLUMN_EX lpCol;
        int nCols;
        nCols = m_Tree.GetColumns(&lpCol);/* Get column attributes */
        Sft_SetPictureSizeOnly(&lpCol[0].Picture1, PIC_SIZEX, PIC_SIZEY);/* Set column header picture size */
        Sft_SetPictureSizeOnly(&lpCol[1].Picture1, PIC_SIZEX, PIC_SIZEY);/* Set column header picture size */
        m_Tree.SetColumns(nCols, lpCol); /* Set new column attributes */
    }

    m_Tree.SetShowRowHeader(SFTTREE_ROWSTYLE_BUTTONCOUNT1);/* Row style */
    /* Register the row header picture size.  All row header   */
    /* pictures used must be the same size.  Only one picture  */
    /* needs to be registered, even if several are used.       */
    {
        SFTTREE_ROWINFOPARM RowInfo;
        RowInfo.version = 7;             
        RowInfo.index = -1;

See Also C/C++ API | Categories | Notifications