SftTree/DLL 6.5

Buttons

Softel vdm, Inc.

Registers the size and sets the images used for expand/collapse buttons.

C

BOOL WINAPI SftTree_SetButtons(HWND hwndCtl, HBITMAP hButtons);
BOOL WINAPI SftTreeSplit_SetButtons(HWND hwndCtl, HBITMAP hButtons);

C++

BOOL CSftTree::SetButtons(int val = 0);
BOOL CSftTree::SetButtons(HBITMAP Bitmap);
BOOL CSftTree::SetButtons(const CBitmap& Bitmap);
BOOL CSftTreeSplit::SetButtons(int val = 0);
BOOL CSftTreeSplit::SetButtons(HBITMAP Bitmap);
BOOL CSftTreeSplit::SetButtons(const CBitmap& Bitmap);

Parameters

hwndCtl

The window handle of the tree control.

hButtons, Bitmap

A predefined value or a bitmap containing four equal-sized images of an expand/collapse button in the following 4 states:

 

The buttons are arranged horizontally in the bitmap, so the height of the bitmap is the height of one button and the width of the bitmap is four times the width of one button. The top, left pixel of each button image must contain the 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 restore the default, built-in bitmap.

The following predefined button styles are available:

 

SFTTREE_BUTTON_STANDARD

Small gray button image with + and - symbols.

SFTTREE_BUTTON_STDWIDE

Wide gray button image with + and - symbols.

SFTTREE_BUTTON_LARGE

Large gray button image with up and down symbols.

SFTTREE_BUTTON_SIMPLE

White box with + and - symbols, similar to Windows Explorer.

SFTTREE_BUTTON_MODERN

The button style is not based on a bitmap.  It is determined by the Windows release and is rendered by Windows.  Note: On Windows XP and above, the button will always be rendered using the "Windows Classic" style, as standard buttons supported by most themes are not suitable for use as expand/collapse buttons due to their small size.

SFTTREE_BUTTON_THEMED

Button image as used on Windows XP.  This style is not limited to Windows XP as it is based on a bitmap.  No actual Windows themes are used.

SFTTREE_BUTTON_AUTOMATIC

Depending on the Windows version and available features, the control selects the appropriate button style.  On Windows XP (and above) with themes, SFTTREE_BUTTON_THEMED is selected.  On all other Windows versions or if themes are not available, SFTTREE_BUTTON_MODERN is selected.

SFTTREE_BUTTON_AUTOMATIC2

Depending on the Windows version and available features, the control selects the appropriate button style.  On Windows XP (and above) with themes, the button image is rendered using the currently selected Windows theme.  On all other Windows versions or if themes are not available, SFTTREE_BUTTON_SIMPLE is selected.  A Windows Vista themed button looks like a Windows XP button. For a look similar to Windows Explorer on Windows Vista, select SFTTREE_BUTTON_AUTOMATIC3 instead.

SFTTREE_BUTTON_AUTOMATIC3

Depending on the Windows version and available features, the control selects the appropriate button style.  On Windows XP with themes, the button image is rendered using the currently selected Windows theme. On Windows Vista with themes, a look similar to Windows Explorer is used (based on GDI+ images). On all other Windows versions or if themes are not available, SFTTREE_BUTTON_SIMPLE is selected.

SFTTREE_BUTTON_USERDEF

The expand/collapse button images are defined using the members ButtonExpanded, ButtonCollapsed of the SFTTREE_CONTROL structure using Get/SetControlInfo.

val

The only allowable value is 0, which is used to restore the default, built-in bitmap. 

Returns

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

Comments

Registers the size and sets the images used for expand/collapse buttons.

All items use the same expand/collapse bitmap. Expand/collapse buttons are only shown if enabled using SetShowButtons and/or SetShowButton0. The application retains ownership of the bitmap and cannot delete the bitmap until the tree control no longer uses the bitmap (usually until the tree control is destroyed or the bitmap is changed using SetButtons).

Sample bitmaps for expand/collapse buttons are provided in the directory \Program Files\Softelvdm\SftTree DLL 6.5\Images. On Windows 64-bit versions, the root folder is \Program Files (x86).

Expand/collapse buttons for individual items can be suppressed using the SetItemExpandCollapseButton function.

See Also  C/C++ API  |  CategoriesNotifications

 


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