Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

RowColHeaderPicture

Defines the picture displayed in the row/column header.

C

BOOL WINAPI SftTree_GetRowColHeaderPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture);
BOOL WINAPI SftTree_SetRowColHeaderPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture);
BOOL WINAPI SftTreeSplit_GetRowColHeaderPicture(HWND hwndCtl, LPSFT_PICTURE lpPicture);
BOOL WINAPI SftTreeSplit_SetRowColHeaderPicture(HWND hwndCtl, LPCSFT_PICTURE lpPicture);

C++

BOOL CSftTree::GetRowColHeaderPicture(LPSFT_PICTURE lpPicture) const;
BOOL CSftTree::SetRowColHeaderPicture(LPCSFT_PICTURE lpPicture);
BOOL CSftTreeSplit::GetRowColHeaderPicture(LPSFT_PICTURE lpPicture) const;
BOOL CSftTreeSplit::SetRowColHeaderPicture(LPCSFT_PICTURE lpPicture);

Parameters

hwndCtl

The window handle of the tree control.

lpPicture

A pointer to a SFT_PICTURE structure to be used as row/column header picture. If the SFT_PICTURE structure defines a bitmap handle, the top, left pixel of the bitmap must contain the image's background color. This color will be replaced by the actual window background color when the bitmap is displayed. This parameter may be NULL to remove the row/column header picture.

Returns

Get/SetRowColHeaderPicture returns TRUE if the function was successful, otherwise FALSE is returned.

Comments

The GetRowColHeaderPicture and SetRowColHeaderPicture functions define the picture displayed in the row/column header.

Get/SetRowColHeaderPicture can be used to define a row/column header picture using a bitmap, icon or ImageList image.

The dimensions of the picture are used to calculate the minimum dimension for the row headers, column headers and row/column headers, so pictures displayed in row headers, column headers and row/column headers are never clipped vertically.

The horizontal and vertical alignment of the row/column picture is defined using RowColHeaderPictureStyle.

The row/column header area is only shown if row headers and column headers are both shown (see SetShowRowHeader and SetShowHeader).

Examples

C

    CellInfo.index = index;
    CellInfo.iCol = 0;
    SftTree_GetCellInfo(hwndTree, &CellInfo);

    Sft_GetPictureSize(&CellInfo.Cell.CellPicture1, &w, &h);

    if (w <= PIC_SIZEX || h <= PIC_SIZEY)  { // don't use images that are too large for the header
        // copy it to row/column header and column header
        SftTree_SetRowColHeaderPicture(hwndTree, &CellInfo.Cell.CellPicture1);/* Row/column picture */

        nCols = SftTree_GetColumnsEx(hwndTree, &lpCol);/* Get column attributes */
        Sft_CopyPicture(&lpCol[1].Picture1, &CellInfo.Cell.CellPicture1); // second column
        SftTree_SetColumnsEx(hwndTree, nCols, lpCol);  /* Set new column attributes */
    } else {
        SftTree_SetRowColHeaderPicture(hwndTree, NULL);

C++

    CellInfo.index = index;
    CellInfo.iCol = 0;
    m_Tree.GetCellInfo(&CellInfo);

    Sft_GetPictureSize(&CellInfo.Cell.CellPicture1, &w, &h);

    if (w <= PIC_SIZEX || h <= PIC_SIZEY)  { // don't use images that are too large for the header
        // copy it to row/column header and column header
        m_Tree.SetRowColHeaderPicture(&CellInfo.Cell.CellPicture1);/* Row/column picture */

        nCols = m_Tree.GetColumns(&lpCol);/* Get column attributes */
        Sft_CopyPicture(&lpCol[1].Picture1, &CellInfo.Cell.CellPicture1); // second column
        m_Tree.SetColumns(nCols, lpCol);  /* Set new column attributes */
    } else {
        m_Tree.SetRowColHeaderPicture(NULL);

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