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
Returns the location of a cell.
C
BOOL WINAPI SftTree_GetDisplayCellRect(HWND hwndCtl, int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan); BOOL WINAPI SftTreeSplit_GetDisplayCellRect(HWND hwndCtl, int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan);
C++
BOOL CSftTree::GetDisplayCellRect(int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan) const; BOOL CSftTreeSplit::GetDisplayCellRect(int index, int iCol, BOOL fClient, LPRECT lpRect, int* lpSpan) const;
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item for which the cell position is to be retrieved.
iCol
The zero-based column number of the cell for which the position is to be retrieved.
fClient
Set to TRUE to limit the returned rectangle lpRect to the tree control's client area and to adjust for horizontal scrolling. If set to FALSE, the rectangle returned is not clipped to the client area or otherwise adjusted for horizontal scrolling.
lpRect
A pointer to a RECT structure where the location of the cell is returned (in pixels).
lpSpan
A pointer to a variable where the number of columns is returned that the cell occupies. If cell merging is allowed and the cell merges into an adjacent cell, it can span more than one column. This parameter may be NULL.
GetDisplayCellRect returns TRUE if successful, otherwise FALSE is returned.
The GetDisplayCellRect function returns the location of a cell.
The RECT structure lpRect describes the location of the specified cell. It can be used for cell editing to create a Windows control of the correct size.
GetCellRectInfoEx can be used to retrieve the coordinates of cell text and cell pictures.
GetItemRect returns the coordinates of an entire item.
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; CellInfo.index = index; CellInfo.iCol = col;
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; CellInfo.version = 7; CellInfo.index = index; CellInfo.iCol = col;
See Also C/C++ API | Categories | Notifications