Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

CharSearchMode

Defines the method used to search for matching items in response to characters typed by the user.

C

int WINAPI SftTree_GetCharSearchMode(HWND hwndCtl);
void WINAPI SftTree_SetCharSearchMode(HWND hwndCtl, int mode, int realCol);
int WINAPI SftTreeSplit_GetCharSearchMode(HWND hwndCtl);
void WINAPI SftTreeSplit_SetCharSearchMode(HWND hwndCtl, int mode, int realCol);

C++

int CSftTree::GetCharSearchMode() const;
void CSftTree::SetCharSearchMode(int mode = SFTTREE_CHARSEARCH_ONECHAR, int realCol = -1);
int CSftTreeSplit::GetCharSearchMode() const;
void CSftTreeSplit::SetCharSearchMode(int mode = SFTTREE_CHARSEARCH_ONECHAR, int realCol = -1);

Parameters

hwndCtl

The window handle of the tree control.

mode

Defines the method used to search for matching items in response to characters typed by the user. mode can be one of the following values:

SFTTREE_CHARSEARCH_ONECHARStarting at the current item, the next item starting with the one single character typed is located and made current.
SFTTREE_CHARSEARCH_ALLCHARSThe first item in the tree control that matches the character(s) typed within a short time period is located and made current. As the user types additional characters, the search continues. If the user pauses for more than the time interval defined using SFTTREE_CONTROL, nCharSearchMaxInterval (default one second), the search ends. The next character typed starts a new search.
SFTTREE_CHARSEARCH_NONECharacters typed are ignored.
SFTTREE_CHARSEARCH_ALLCHARS2Same as SFTTREE_CHARSEARCH_ALLCHARS, but dependent items of a collapsed parent item are not searched.
SFTTREE_CHARSEARCH_ONECHAR2Same as SFTTREE_CHARSEARCH_ONECHAR, but dependent items of a collapsed parent item are not searched.
SFTTREE_CHARSEARCH_ONECHARWRAPStarting at the current item, the next item starting with the one single character typed is located and made current. If the end of the list of items is reached, the search wraps around and starts at the beginning of the list.
SFTTREE_CHARSEARCH_ONECHARWRAP2Same as SFTTREE_CHARSEARCH_ONECHARWRAP, but dependent items of a collapsed parent item are not searched.
SFTTREE_CHARSEARCH_ALLCHARSWRAPThe next item in the tree control that matches the character(s) typed within a short time period is located and made current. As the user types additional characters, the search continues. If the user pauses for more than the time interval defined using SFTTREE_CONTROL, nCharSearchMaxInterval (default one second), the search ends. The next character typed starts a new search.
SFTTREE_CHARSEARCH_ALLCHARSWRAP2Same as SFTTREE_CHARSEARCH_ALLCHARSWRAP, but dependent items of a collapsed parent item are not searched.

realCol

The zero-based column number to be searched. If -1 is specified, the first displayed column is searched.

Returns

GetCharSearchMode returns a value indicating the current search method used.

Comments

The GetCharSearchMode and SetCharSearchMode functions define the method used to search for matching items in response to characters typed by the user.

Examples

C

            // SftTree_SetRowInfo(g_hwndTree, &RowInfo);
        }
        SftTree_SetRowColHeaderText(g_hwndTree, TEXT(""));/* Row/column header text */
        SftTree_SetRowColHeaderStyle(g_hwndTree, ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */
        Sft_InitPicture(&Pic);
        Sft_SetPictureSizeOnly(&Pic, PIC_SIZEX, PIC_SIZEY);/* Row/column header picture */
        SftTree_SetRowColHeaderPicture(g_hwndTree, &Pic);/* Row/column picture */
        SftTree_SetRowColHeaderPictureStyle(g_hwndTree, SFTTREE_BMP_RIGHT);/* Row/column picture alignment */
        SftTree_SetCharSearchMode(g_hwndTree, SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
        /* Change the default colors */
        {
            SFTTREE_COLORS Colors;
            SftTree_GetCtlColors(g_hwndTree, &Colors);/* Get current color settings */
            Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */
            Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
            Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */

C++

        // m_Tree.SetRowInfo(&RowInfo);
    }
    m_Tree.SetRowColHeaderText(_T("?"));       /* Row/column header text */
    m_Tree.SetRowColHeaderStyle(ES_LEFT | SFTTREE_HEADER_UP);/* Row/column header style */
    Sft_InitPicture(&Pic);               /* Initialize */
    Sft_SetPictureSizeOnly(&Pic, PIC_SIZEX, PIC_SIZEY);/* Row/column header picture */
    m_Tree.SetRowColHeaderPicture(&Pic);       /* Row/column picture */
    m_Tree.SetRowColHeaderPictureStyle(SFTTREE_BMP_RIGHT);/* Row/column picture alignment */
    m_Tree.SetCharSearchMode(SFTTREE_CHARSEARCH_ALLCHARS, -1);/* Consider all characters typed */
    /* Change the default colors */
    {
        SFTTREE_COLORS Colors;
        m_Tree.GetCtlColors(&Colors);    /* Get current color settings */
        Colors.colorTreeLines = COLOR_3DDKSHADOW | 0x80000000L;/* Tree line color */
        Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
        Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */

See Also C/C++ API | Categories | Notifications