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 the number of text lines used for item height calculation.
C
int WINAPI SftTree_GetItemLines(HWND hwndCtl); BOOL WINAPI SftTree_SetItemLines(HWND hwndCtl, int nLines); int WINAPI SftTreeSplit_GetItemLines(HWND hwndCtl); BOOL WINAPI SftTreeSplit_SetItemLines(HWND hwndCtl, int nLines);
C++
int CSftTree::GetItemLines() const; BOOL CSftTree::SetItemLines(int nLines); int CSftTreeSplit::GetItemLines() const; BOOL CSftTreeSplit::SetItemLines(int nLines);
hwndCtl
The window handle of the tree control.
nLines
The number of text lines used to calculate the expected height of items.
GetItemLines returns the current number of text lines last defined using SetItemLines.
SetItemLines returns TRUE if the function was successful, otherwise FALSE is returned.
The GetItemLines and SetItemLines functions define the number of text lines used for item height calculation.
The height of items is determined based on an item's attributes such as registered item picture size, label picture size, fonts used, etc. Using SetItemLines, an application can specify how many lines of cell text an item can display in a cell.
In a fixed height tree control (see SFTTREESTYLE_VARIABLE) all cell text has the same number of text lines. If an application needs multiple text lines to support word wrapping (see SFTTREE_COLUMN_EX, SFTTREE_WRAP) or new line characters in cell text, SetItemLines must be used to specify the number of text lines.
In a variable height tree control, each item's height is determined individually. If an application allows word wrapping (see SFTTREE_COLUMN_EX, SFTTREE_WRAP) or new line characters in cell text, SetItemLines must be used to specify the maximum number of text lines to display in all cells. If cell text exceeds the specified number of lines, "+" is shown at the bottom, right corner of the cell.
A tree control defaults to one line of text for each item.
if (!g_hwndTree) return -1; /* Resources, such as bitmaps, should be loaded and must remain */ /* valid until the tree control is destroyed or no longer uses */ /* these. For example, use DeleteObject to delete any bitmaps. */ SftTree_SetShowHeader(g_hwndTree, TRUE);/* Show column headers */ SftTree_SetItemLines(g_hwndTree, 5); /* (Maximum) number of text lines */ /* Register the label picture size. All label pictures */ /* used must be the same size. Only one picture needs to */ /* be registered, even if several are used. */ Sft_InitPicture(&Pic); Sft_SetPictureSizeOnly(&Pic, PIC_SIZEX, PIC_SIZEY);/* Dimensions only for registration */ SftTree_SetItemLabelPicture(g_hwndTree, -1, &Pic);/* Register the label picture size */ /* Set individual label bitmaps using the following sample code: */
WS_HSCROLL | WS_VSCROLL | /* Vertical and horizontal scrollbars */ WS_VISIBLE | WS_CHILD, /* Visible, child window */ CRect(0,0,0,0), /* Location */ this, /* Parent window */ IDC_TREE)) /* Tree control ID */ return -1; m_Tree.SetShowHeader(TRUE); /* Show column headers */ m_Tree.SetItemLines(5); /* (Maximum) number of text lines */ SFT_PICTURE Pic; /* Register the label picture size. All label pictures */ /* used must be the same size. Only one picture needs to */ /* be registered, even if several are used. */ Sft_InitPicture(&Pic); /* Initialize */
See Also C/C++ API | Categories | Notifications