Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

ItemLabelPicture

Defines an item's label picture information.

C

BOOL WINAPI SftTree_GetItemLabelPicture(HWND hwndCtl,
        int index,
        LPSFT_PICTURE lpPicture);
BOOL WINAPI SftTree_SetItemLabelPicture(HWND hwndCtl,
        int index,
        LPCSFT_PICTURE lpPicture);
BOOL WINAPI SftTreeSplit_GetItemLabelPicture(HWND hwndCtl,
        int index,
        LPSFT_PICTURE lpPicture);
BOOL WINAPI SftTreeSplit_SetItemLabelPicture(HWND hwndCtl,
        int index,
        LPCSFT_PICTURE lpPicture);

C++

BOOL CSftTree::GetItemLabelPicture(int index, LPSFT_PICTURE lpPicture) const;
BOOL CSftTree::SetItemLabelPicture(int index, LPCSFT_PICTURE lpPicture);
BOOL CSftTreeSplit::GetItemLabelPicture(int index, LPSFT_PICTURE lpPicture) const;
BOOL CSftTreeSplit::SetItemLabelPicture(int index, LPCSFT_PICTURE lpPicture);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the item for which the label picture is to be retrieved or set. This parameter may be -1 to register the label picture size and make the label picture area visible.

lpPicture

A pointer to a SFT_PICTURE structure to use as the label picture for the specified item. 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. If the index parameter is -1, this bitmap is only used to determine the size of all label pictures. This parameter may be NULL to remove an item's label picture or to stop displaying label pictures for all items (set index to -1).

Returns

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

Comments

The GetItemLabelPicture and SetItemLabelPicture functions define an item's label picture information.

Get/SetItemLabelPicture can be used to define a label picture using a bitmap, icon or ImageList image. Get/SetItemLabel can be used to define a label picture using a bitmap handle only.

In a fixed height tree control, all label pictures used for all items must be the same size. New pictures can be registered at any time, but all label pictures in use must be replaced by pictures of the new size.

In a variable height tree control, label pictures can be of varying sizes. The largest picture size must be registered using SetItemLabelPicture.

If an item doesn't have a label picture, the space normally occupied by the label picture is left blank.

An item may have an associated label picture without the label picture area actually being visible. The label picture area doesn't become visible until the (largest) label picture size has been registered using SetItemLabelPicture by setting index to -1.

The application retains ownership of any resources used to define the picture and cannot free these resources until the tree control no longer uses these (usually until the tree control is destroyed or the pictures are changed).

In a tree control using a virtual data source, SetItemLabelPicture can only be used to register the label picture size, otherwise an error is returned. The LabelPicture member of the SFTTREE_ITEM structure is used instead.

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