Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

MakeCellVisible

Scrolls the specified cell into view horizontally and vertically so that it is displayed in the tree control's client area.

C

void WINAPI SftTree_MakeCellVisible(HWND hwndCtl, int index, int realCol);
void WINAPI SftTreeSplit_MakeCellVisible(HWND hwndCtl, int index, int realCol);

C++

void CSftTree::MakeCellVisible(int index, int realCol);
void CSftTreeSplit::MakeCellVisible(int index, int realCol);

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the cell to scroll into view.

realCol

The zero-based column number of the cell to make visible.

Comments

The MakeCellVisible function scrolls the specified cell into view horizontally and vertically so that it is displayed in the tree control's client area.

MakeCellVisible can be used to make a cell visible by scrolling it into view (horizontally and vertically). The user normally scrolls the tree control items horizontally and vertically using the scroll bars, but an application can use MakeCellVisible to insure that a cell is visible.

To make a column or item visible, use MakeColumnVisible or MakeRowVisible.

Examples

C

    TCHAR szBuffer[100];
    RECT rect;
    int height;
    HWND EditParent;
    HFONT hFont;
    SFTTREE_CELLINFOPARM CellInfo;

    /* Make the cell completely visible */
    SftTree_MakeCellVisible(g_hwndTree, index, col);
    /* Get the location */
    if (!SftTree_GetDisplayCellRect(g_hwndTree, index, col, TRUE, &rect, NULL))
        return;

    if (SftTree_GetItemEditIgnore(g_hwndTree, index))
        return; // this item can't be edited
    CellInfo.version = 7;

C++

/* Start editing in response to a                          */
/* SFTTREEN_LBUTTONDOWN_TEXT notification.                 */

void CSampleView::StartEdit(int index, int col)
{
    CRect rect;

    /* Make the cell completely visible */
    m_Tree.MakeCellVisible(index, col);
    /* get the item location */
    if (!m_Tree.GetDisplayCellRect(index, col, TRUE, &rect, NULL))
        return;                          /* No column active */

    if (m_Tree.GetItemEditIgnore(index))
        return; // this item can't be edited
    SFTTREE_CELLINFOPARM CellInfo;

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