Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

GridStyle

Defines the grid line display style.

C

int WINAPI SftTree_GetGridStyle(HWND hwndCtl);
void WINAPI SftTree_SetGridStyle(HWND hwndCtl, int style);
int WINAPI SftTreeSplit_GetGridStyle(HWND hwndCtl);
void WINAPI SftTreeSplit_SetGridStyle(HWND hwndCtl, int style);

C++

int CSftTree::GetGridStyle() const;
void CSftTree::SetGridStyle(int type = SFTTREE_GRID_VERT);
int CSftTreeSplit::GetGridStyle() const;
void CSftTreeSplit::SetGridStyle(int type = SFTTREE_GRID_VERT);

Parameters

hwndCtl

The window handle of the tree control.

style

A value describing the grid lines displayed.

SFTTREE_GRID_VERTVertical grid lines are drawn around columns using a solid line.
SFTTREE_GRID_HORZHorizontal grid lines are drawn around items using a solid line.
SFTTREE_GRID_BOTHVertical and horizontal grid lines are drawn using a solid line.
SFTTREE_GRID_VERT_DOTVertical grid lines are drawn around columns using a dotted line.
SFTTREE_GRID_HORZ_DOTHorizontal grid lines are drawn around items using a dotted line.
SFTTREE_GRID_BOTH_DOTVertical and horizontal grid lines are drawn using a dotted line.

Returns

GetGridStyle returns the current grid line display style.

Comments

The GetGridStyle and SetGridStyle functions define the grid line display style.

The color used for grid lines can be defined using SFTTREE_COLORS, colorGridVert and colorGridHorz.

If grid lines are not shown (see SetShowGrid), this function has no effect.

Horizontal grid lines are not drawn if items are drawn using a 3D display method (see SetShow3D).

Vertical grid lines are not drawn if all column headers have no header text and footer text (except for the first column) and all cells are marked for cell merging, in which case all cells are handled as one (visually) contiguous cell, even if each cell has individual cell text.

When printing or previewing the tree control contents using SftPrintPreview/DLL, solid grid lines are used, even if dotted grid lines are defined using SFTTREE_GRID_VERT_DOT, SFTTREE_GRID_HORZ_DOT or SFTTREE_GRID_BOTH_DOT.

Examples

C

        SftTree_SetTreeLineStyle(g_hwndTree, SFTTREE_TREELINE_AUTOMATIC0);/* Dotted tree lines (incl. level 0) */
        SftTree_SetShowButtons(g_hwndTree, TRUE);/* Expand/collapse buttons (level 1..n) */
        SftTree_SetShowButton0(g_hwndTree, TRUE);/* Show expand/collapse buttons (level 0) */
        if (SftTree_GetGDIPlusAvailable(g_hwndTree))
            SftTree_SetButtons(g_hwndTree, SFTTREE_BUTTON_USERDEF);/* User-defined buttons */
        else
            SftTree_SetButtons(g_hwndTree, SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
        SftTree_SetShowGrid(g_hwndTree, TRUE);/* Show grid */
        SftTree_SetGridStyle(g_hwndTree, SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */
        SftTree_SetShowTruncated(g_hwndTree, TRUE);/* Show ... if truncated */
        SftTree_SetSelectionStyle(g_hwndTree, SFTTREE_SELECTION_ALL | SFTTREE_SELECTION_OUTLINE);/* Select entire item using outline */
        SftTree_SetSelectionArea(g_hwndTree, SFTTREE_SELECTIONAREA_ALLCELLS);/* Selection changes by clicking on an item's cells */
        SftTree_SetFlyby(g_hwndTree, TRUE);  /* Flyby highlighting */
        SftTree_SetUpdateCaretExpandCollapse(g_hwndTree, FALSE);/* don't update caret location when expand/collapse button clicked */
        SftTree_SetScrollTips(g_hwndTree, TRUE);/* Show Scrolltips */
        SftTree_SetInheritBgColor(g_hwndTree, TRUE);/* Inherit background color of first cell */

C++

    m_Tree.SetTreeLineStyle(SFTTREE_TREELINE_AUTOMATIC0);/* Dotted tree lines (incl. level 0) */
    m_Tree.SetShowButtons(TRUE);         /* Expand/collapse buttons (level 1..n) */
    m_Tree.SetShowButton0(TRUE);         /* Show expand/collapse buttons (level 0) */
    if (m_Tree.GetGDIPlusAvailable())
        m_Tree.SetButtons(SFTTREE_BUTTON_USERDEF);/* User-defined buttons */
    else
        m_Tree.SetButtons(SFTTREE_BUTTON_AUTOMATIC3);/* Automatic button style 3 */
    m_Tree.SetShowGrid(TRUE);            /* Show grid */
    m_Tree.SetGridStyle(SFTTREE_GRID_BOTH_DOT);/* Dotted grid lines */
    m_Tree.SetShowTruncated(TRUE);       /* Show ... if truncated */
    m_Tree.SetSelectionStyle(SFTTREE_SELECTION_ALL | SFTTREE_SELECTION_OUTLINE);/* Select entire item using outline */
    m_Tree.SetSelectionArea(SFTTREE_SELECTIONAREA_ALLCELLS);/* Selection changes by clicking on an item's cells */
    m_Tree.SetFlyby(TRUE);               /* Flyby highlighting */
    m_Tree.SetUpdateCaretExpandCollapse(FALSE);/* don't update caret location when expand/collapse button clicked */
    m_Tree.SetScrollTips(TRUE);          /* Show Scrolltips */
    m_Tree.SetInheritBgColor(TRUE);      /* Inherit background color of first cell */

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