SftTree/DLL 6.5

Pictures

Softel vdm, Inc.

Registers the size and sets the default item pictures used for all items.

C

BOOL WINAPI SftTree_SetPictures(HWND hwndCtl, LPCSFT_PICTURE lpPics);
BOOL WINAPI SftTreeSplit_SetPictures(HWND hwndCtl, LPCSFT_PICTURE lpPics);

C++

BOOL CSftTree::SetPictures(int val = 0);
BOOL CSftTree::SetPictures(LPCSFT_PICTURE lpPics);
BOOL CSftTreeSplit::SetPictures(int val = 0);
BOOL CSftTreeSplit::SetPictures(LPCSFT_PICTURE lpPics);

Parameters

hwndCtl

The window handle of the tree control.

lpPics

A pointer to three SFT_PICTURE structures to be used as default item pictures.  In a fixed height tree control, all item pictures must be the same size, but can be different types.  It is possible to mix bitmaps, icons and ImageList images.  These three pictures are used as default item pictures for 1) an expandable parent item, 2) an expanded parent item and 3) a leaf item.  If the SFT_PICTURE structure describes a bitmap handle, the top, left pixel of each 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 or omitted to stop displaying item bitmaps.

val

The only allowable value is 0, which is used to stop displaying item pictures

Returns

The return value is TRUE if the function was successful, otherwise FALSE.

Comments

The SetPictures function registers the size and sets the default item pictures used for all items.

There are no default item pictures.

Get/SetPictures can be used to define default item pictures using a bitmaps, icons or ImageList images.  Get/SetBitmaps can be used to define default item pictures using bitmap handles only.

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

In a variable height tree control, item pictures can be of varying sizes.  The largest picture size must be registered using SetBitmapsItem pictures defined using SetItemPicture must be of equal or smaller size.

Individual item pictures can be set using SetItemPicture, but will not be shown unless default pictures have been registered using SetPictures.  The height of all tree items is adjusted automatically to allow the complete picture to be displayed.  The default pictures can be changed even after items have been added to the tree control.  Items without individual item bitmap will immediately use the new default bitmaps.

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).

An individual item's item picture can be defined using SetItemPicture.

See Also  C/C++ API  |  CategoriesNotifications

 


Feedback / comments / error reports for this topic
© 2009 - Softel vdm, Inc. - www.softelvdm.com