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
Defines whether an item is ignored for cell editing.
C
BOOL WINAPI SftTree_GetItemEditIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTree_SetItemEditIgnore(HWND hwndCtl, int index, BOOL fIgnore); BOOL WINAPI SftTreeSplit_GetItemEditIgnore(HWND hwndCtl, int index); BOOL WINAPI SftTreeSplit_SetItemEditIgnore(HWND hwndCtl, int index, BOOL fIgnore);
C++
BOOL CSftTree::GetItemEditIgnore(int index) const; BOOL CSftTree::SetItemEditIgnore(int index, BOOL fIgnore = TRUE); BOOL CSftTreeSplit::GetItemEditIgnore(int index) const; BOOL CSftTreeSplit::SetItemEditIgnore(int index, BOOL fIgnore = TRUE);
hwndCtl
The window handle of the tree control.
index
The zero-based index of the item for which the cell editing value is to be retrieved or set.
fIgnore
Set to TRUE to mark the item as non-editable, otherwise set to FALSE.
GetItemEditIgnore returns a value indicating whether an item is ignored for cell editing. TRUE is returned if the item is not used for cell editing, otherwise FALSE.
SetItemEditIgnore returns TRUE if the function was successful, otherwise FALSE is returned.
The GetItemEditIgnore and SetItemEditIgnore functions define whether an item is ignored for cell editing.
The tree control doesn't control cell editing, which is always performed by the application. The value defined using SetItemEditIgnore is not used by the tree control in any way, but can be used by the application during cell editing and navigation to determine whether certain items need to be ignored during cell editing, i.e., they cannot be edited.
Individual cells can be ignored for cell editing using the SFTTREE_CELL structure's flag2 member (SFTTREECELL_EDITIGNORE).
In a tree control using a virtual data source, SetItemEditIgnore cannot be used and an error is returned. The flag2 member of the SFTTREE_ITEM structure is used instead.
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; SftTree_GetCellInfo(g_hwndTree, &CellInfo); if (CellInfo.Cell.flag2 & SFTTREECELL_EDITIGNORE) return; // this item can't be edited
m_Tree.SetText(index, 2, _T("3rd Column"));/* Set text in next column */ index = m_Tree.AddString(_T("Another item"));/* Add another item */ m_Tree.SetText(index, 1, _T("2nd Column"));/* Set text in next column */ m_Tree.SetText(index, 2, _T("3rd Column"));/* Set text in next column */ m_Tree.SetItemLevel(index, 1);/* change level */ index = m_Tree.AddString(_T("This item can't be edited"));/* Add another item */ m_Tree.SetItemEditIgnore(index, TRUE); m_Tree.SetItemLevel(index, 2);/* change level */ m_Tree.SetText(index, 1, _T("2nd Column (can't edit this item)"));/* Set text in next column */ m_Tree.SetText(index, 2, _T("3rd Column (can't edit this item)"));/* Set text in next column */ index = m_Tree.AddString(_T("A fourth item"));/* Add another item */ m_Tree.SetItemLevel(index, 1);/* change level */ m_Tree.SetText(index, 1, _T("This cell can't be edited"));/* Set text in next column */
See Also C/C++ API | Categories | Notifications