SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftMask/OCX 7.0 - Masked Edit Control
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftPrintPreview/DLL 2.0 - Print Preview Control (discontinued)
SftTree/DLL 7.5 - Tree Control
SftBox/OCX 5.0 - Combo Box Control
SftButton/OCX 3.0 - Button Control
SftDirectory 3.5 - File/Folder Control (discontinued)
SftMask/OCX 7.0 - Masked Edit Control
SftOptions 1.0 - Registry/INI Control (discontinued)
SftPrintPreview/OCX 1.0 - Print Preview Control (discontinued)
SftTabs/OCX 6.5 - Tab Control (VB6 only)
SftTree/OCX 7.5 - Tree Control
SftTabs/NET 6.0 - Tab Control (discontinued)
SftTree/NET 2.0 - Tree Control
Defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered.
C
BOOL WINAPI SftTree_SetOwnerDrawCallback(HWND hwndCtl, LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); BOOL WINAPI SftTreeSplit_SetOwnerDrawCallback(HWND hwndCtl, LPCSFTTREE_OWNERDRAWPARM lpDrawInfo);
C++
BOOL CSftTree::SetOwnerDrawCallback(LPCSFTTREE_OWNERDRAWPARM lpDrawInfo); BOOL CSftTreeSplit::SetOwnerDrawCallback(LPCSFTTREE_OWNERDRAWPARM lpDrawInfo);
hwndCtl
The window handle of the tree control.
lpDrawInfo
A pointer to a SFTTREE_OWNERDRAWPARM structure containing the parameters for this function to register a callback function and user supplied data. This parameter may be NULL to stop using the callback function. The SFTTREE_OWNERDRAWPARM structure contains the following members:
LPFNSFTTREE_OWNERDRAWPROC lpfnOwnerDrawProc | A user supplied routine which is called every time an object needs to be rendered. |
SFTTREE_DWORD_PTR OwnerDrawUserData | User supplied, application-specific data. |
The return value is TRUE if the function was successful, otherwise FALSE if an error occurred.
The SetOwnerDrawCallback function defines an application-supplied owner-draw function, which is called whenever an object needs to be rendered.
The callback receives control when an object needs to be rendered. The callback can then perform application specific rendering of the object. An application can render cells, cell ToolTips, row headers, column headers and row/column headers using the owner-draw function.
SftTree_SetRowColHeaderStyle(g_hwndTree, ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */ SftTree_SetRowColHeaderPictureStyle(g_hwndTree, SFTTREE_BMP_RIGHT);/* Row/column picture alignment */ SftTree_SetCharSearchMode(g_hwndTree, SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */ /* Use an ownerdraw callback routine */ { SFTTREE_OWNERDRAWPARM Parm; /* Parameter list */ Parm.lpfnOwnerDrawProc = (LPFNSFTTREE_OWNERDRAWPROC) Tree_OwnerDrawCallback;/* User supplied drawing routine */ Parm.OwnerDrawUserData = (SFTTREE_DWORD_PTR)0;/* User supplied data */ SftTree_SetOwnerDrawCallback(g_hwndTree, &Parm); } /* Change the default colors */ { SFTTREE_COLORS Colors; SftTree_GetCtlColors(g_hwndTree, &Colors);/* Get current color settings */ Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */ Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
m_Tree.SetShowRowHeader(SFTTREE_ROWSTYLE_BUTTONCOUNT1);/* Row style */ m_Tree.SetRowColHeaderText(_T("?")); /* Row/column header text */ m_Tree.SetRowColHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */ m_Tree.SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */ /* Use an ownerdraw callback routine */ { SFTTREE_OWNERDRAWPARM Parm; /* Parameter list */ Parm.lpfnOwnerDrawProc = (LPFNSFTTREE_OWNERDRAWPROC) CSampleView::OwnerDrawCallback;/* User supplied drawing routine */ Parm.OwnerDrawUserData = (SFTTREE_DWORD_PTR)this;/* User supplied data */ m_Tree.SetOwnerDrawCallback(&Parm); } /* Change the default colors */ { SFTTREE_COLORS Colors; m_Tree.GetCtlColors(&Colors); /* Get current color settings */ Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */
See Also C/C++ API | Categories | Notifications