Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

SFTTREE_OWNERDRAWPARM Structure

The SFTTREE_OWNERDRAWPARM structure is used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered.

typedef struct tagSftTreeOwnerDrawParm {
    LPFNSFTTREE_OWNERDRAWPROC lpfnOwnerDrawProc;
    SFTTREE_DWORD_PTR OwnerDrawUserData;
} SFTTREE_OWNERDRAWPARM, * LPSFTTREE_OWNERDRAWPARM;
typedef const SFTTREE_OWNERDRAWPARM * LPCSFTTREE_OWNERDRAWPARM;

Members

lpfnOwnerDrawProc

A pointer to a owner-draw callback routine, which is called every time an object needs to be rendered.

OwnerDrawUserData

An application-specific value. This value is passed to the function lpfnOwnerDrawProc LPFNSFTTREE_OWNERDRAWPROC as OwnerDrawUserData parameter. Could be used to pass a global storage area to the callback routine.

Comments

The SFTTREE_OWNERDRAWPARM structure is used to define an application-specific owner-draw callback routine, which is called whenever an object needs to be rendered.

Examples

C

        SftTree_SetShowRowHeader(g_hwndTree, SFTTREE_ROWSTYLE_BUTTONCOUNT1);/* Row style */
        SftTree_SetRowColHeaderText(g_hwndTree, TEXT("?"));/* Row/column header text */
        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 */

C++

    }

    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;

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