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 window containing the specified cell in a split tree control.
C
HWND WINAPI SftTree_GetCellEditWindow(HWND hwndCtl, int index, int realCol); HWND WINAPI SftTreeSplit_GetCellEditWindow(HWND hwndCtl, int index, int realCol);
C++
CWnd* CSftTree::GetCellEditWindow(int index, int realCol = 0) const; CWnd* CSftTreeSplit::GetCellEditWindow(int index, int realCol = 0) const;
hwndCtl
The window handle of the tree control.
index
The zero-based index of the cell for which the window is to be retrieved.
realCol
The zero-based column number of the cell for which the window is to be retrieved.
The return value is the window (handle) of the left or right pane of a split tree control or the window (handle) of the tree control if no splitter bar is used.
The GetCellEditWindow function returns the window containing the specified cell in a split tree control.
This function is used for cell editing. Controls such as edit control or combo boxes which are created by the application for cell editing are created with the tree control as the parent window. When a split tree control is used, the control must be attached to the left or right pane, not the tree control. GetCellEditWindow is used to determine the window (handle) of the left or right pane. AdjustCellEditRect is used to calculate the coordinates for the control relative to the left or right pane.
GetCellEditWindow has no effect in a tree control without splitter bar. But it is recommended to use GetCellEditWindow in case the application is later converted to use a split tree control.
/* Change selection style to not shown anything */ SftTree_SetNoFocusStyle(g_hwndTree, SFTTREE_NOFOCUS_NOTHING); /* Copy the text found in the tree control */ SftTree_GetTextCol(g_hwndTree, m_editIndex, m_editCol, szBuffer); SftTree_AdjustCellEditRect(g_hwndTree, m_editIndex, m_editCol, &rect); EditParent = SftTree_GetCellEditWindow(g_hwndTree, m_editIndex, m_editCol); // based on font height, get best height for the control used for cell editing hFont = (HFONT) SendMessage(g_hwndTree, WM_GETFONT, 0, 0); { int diff; TEXTMETRIC tm; HDC hDC = GetDC(NULL); hFont = (HFONT)SelectObject(hDC, hFont);
/* Change selection style to not shown anything */ m_Tree.SetNoFocusStyle(SFTTREE_NOFOCUS_NOTHING); /* Copy the text found in the tree control */ CString str; m_Tree.GetText(m_editIndex, m_editCol, str); m_Tree.AdjustCellEditRect(m_editIndex, m_editCol, &rect); CWnd* pEditParent = m_Tree.GetCellEditWindow(m_editIndex, m_editCol); // based on font height, get best height for the control used for cell editing CFont* pFont = m_Tree.GetFont(); int diff; TEXTMETRIC tm; CDC* pDC = GetDC();
See Also C/C++ API | Categories | Notifications