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 display column number given a real column number.
C
int WINAPI SftTree_GetDisplayColumn(HWND hwndCtl, int realCol); int WINAPI SftTreeSplit_GetDisplayColumn(HWND hwndCtl, int realCol);
C++
int CSftTree::GetDisplayColumn(int realCol) const;
hwndCtl
The window handle of the tree control.
realCol
The real column number whose display column number is to be returned.
The return value is the display column number for a real column number, or -1 if an error occurred.
The GetDisplayColumn function returns the display column number given a real column number.
As a user reorders columns, this is completely transparent to the application. An application still references cells by the "real" column number, which is the original column number that the cell had before columns were reordered by the user. While columns appear in a new order after dragging a column to a new position, the application references columns and cells by their real column number which never changes.
If a user reorders columns using column drag & drop, the (real) column numbers, which is the column number as it appears to the application, may need to be translated into the display column number as seen by the user. For more information see section "Display vs. Real Columns".
int index = m_editIndex, col = m_editCol; int dispCol, firstDispCol, lastDispCol; LPSFTTREE_COLUMN_EX lpCol; int nCols; int lastShown = SftTree_GetPrevShown(g_hwndTree, -1); // get general information about tree control and columns nCols = SftTree_GetColumnsEx(g_hwndTree, &lpCol);/* Get column attributes */ dispCol = SftTree_GetDisplayColumn(g_hwndTree, col); firstDispCol = SftTree_GetFirstDisplayColumn(g_hwndTree); lastDispCol = SftTree_GetLastDisplayColumn(g_hwndTree); if (vKey == VK_HOME && (vMask & SFTTREE_HANDLECTRL)) { // Control+Home index = 0; dispCol = firstDispCol; vKey = VK_RIGHT; // if index/dispCol can't be edited, search a cell in this direction:
int index = m_editIndex, col = m_editCol; int dispCol, firstDispCol, lastDispCol; LPSFTTREE_COLUMN_EX lpCol; int nCols; int lastShown = m_Tree.GetPrevShown(-1); // get general information about tree control and columns nCols = m_Tree.GetColumns(&lpCol);/* Get column attributes */ dispCol = m_Tree.GetDisplayColumn(col); firstDispCol = m_Tree.GetFirstDisplayColumn(); lastDispCol = m_Tree.GetLastDisplayColumn(); if (vKey == VK_HOME && (vMask & SFTTREE_HANDLECTRL)) { // Control+Home index = 0; dispCol = firstDispCol; vKey = VK_RIGHT; // if index/dispCol can't be edited, search a cell in this direction:
See Also C/C++ API | Categories | Notifications