Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

TreeLineStyle

Defines the display style of tree lines.

C

int WINAPI SftTree_GetTreeLineStyle(HWND hwndCtl);
void WINAPI SftTree_SetTreeLineStyle(HWND hwndCtl, int style);
int WINAPI SftTreeSplit_GetTreeLineStyle(HWND hwndCtl);
void WINAPI SftTreeSplit_SetTreeLineStyle(HWND hwndCtl, int style);

C++

int CSftTree::GetTreeLineStyle() const;
void CSftTree::SetTreeLineStyle(int style);
int CSftTreeSplit::GetTreeLineStyle() const;
void CSftTreeSplit::SetTreeLineStyle(int style);

Parameters

hwndCtl

The window handle of the tree control.

style

Defines the display style used for selected items. Style can be one of the following values:

SFTTREE_TREELINE_NONENo tree lines.
SFTTREE_TREELINE_SOLIDTree lines are drawn using a solid line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other.
SFTTREE_TREELINE_DOTTree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are not connected to each other.
SFTTREE_TREELINE_DOT0Tree lines are drawn using a dotted line. Items on level 1 and lower are connected to items on level 0. Items on level 0 are also connected to each other.
SFTTREE_TREELINE_TRANSPARENTConnecting tree lines are not shown, but all layout and formatting is calculated as if they were present. This only affects the horizontal indentation of levels.
SFTTREE_TREELINE_AUTOMATICThe value is translated to SFTTREE_TREELINE_DOT or SFTTREE_TREELINE_TRANSPARENT depending on the operating system used. On Windows 98, ME, 2000, connecting dotted tree lines are shown between items on levels 1 and lower (using SFTTREE_TREELINE_DOT). On Windows XP and above, connecting dotted tree lines are not shown (using SFTTREE_TREELINE_TRANSPARENT).
SFTTREE_TREELINE_AUTOMATIC0The value is translated to SFTTREE_TREELINE_DOT0 or SFTTREE_TREELINE_TRANSPARENT depending on the operating system used. On Windows 98, ME, 2000, connecting dotted tree lines are shown between all items (using SFTTREE_TREELINE_DOT0). On Windows XP and above, connecting dotted tree lines are not shown (using SFTTREE_TREELINE_TRANSPARENT).

Returns

GetTreeLineStyle returns a value indicating the current display style used for tree lines.

Comments

The GetTreeLineStyle and SetTreeLineStyle functions define the display style of tree lines.

The color used for tree lines can be defined using SFTTREE_COLORS, colorTreeLines.

When printing or previewing the tree control contents using SftPrintPreview/DLL, solid tree lines are used, even if dotted tree lines are defined using SFTTREE_TREELINE_DOT or SFTTREE_TREELINE_DOT0.

Examples

C

            // CellInfo.iCol = column_number_to_change;
            // SftTree_GetCellInfo(g_hwndTree, &CellInfo);
            // /* m_hCellBitmap = LoadBitmap(app_instance, MAKEINTRESOURCE(IDB_your_bitmap)); *//* Cell bitmap */
            // Sft_SetPictureBitmap(&CellInfo.Cell.CellPicture1, m_hCellBitmap);
            // CellInfo.Cell.flag = SFTTREE_BMP_RIGHT;
            // SftTree_SetCellInfo(g_hwndTree, &CellInfo);
        }

        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 */

C++

        // CellInfo.index = cell_index_to_change;
        // CellInfo.iCol = column_number_to_change;
        // m_Tree.GetCellInfo(&CellInfo);
        // /* m_CellBitmap.LoadBitmap(IDB_your_bitmap); *//* Cell picture */
        // Sft_SetPictureBitmap(&CellInfo.Cell.CellPicture1, m_CellBitmap);
        // CellInfo.Cell.flag = SFTTREE_BMP_RIGHT;
        // m_Tree.SetCellInfo(&CellInfo);
    }
    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 */

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