Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

CalcLimit

Defines the maximum number of items to consider for optimal column width and scrolling calculation.

C

int WINAPI SftTree_GetCalcLimit(HWND hwndCtl);
void WINAPI SftTree_SetCalcLimit(HWND hwndCtl, int limit);
int WINAPI SftTreeSplit_GetCalcLimit(HWND hwndCtl);
void WINAPI SftTreeSplit_SetCalcLimit(HWND hwndCtl, int limit);

C++

int CSftTree::GetCalcLimit() const;
void CSftTree::SetCalcLimit(int limit = 0);
int CSftTreeSplit::GetCalcLimit() const;
void CSftTreeSplit::SetCalcLimit(int limit = 0);

Parameters

hwndCtl

The window handle of the tree control.

limit

Defines the maximum number of items to be considered for width calculation. Specify a number less than or equal to 0 to consider all items. If a tree control contains many items, scanning all items may be extremely slow, as each row header or cell width needs to be calculated. Using an application defined maximum number, the calculation can be limited to limit items. This results in better response time, yet some items which are not within the number of scanned items may still be clipped.

Returns

GetCalcLimit returns the maximum number of items to be considered for optimal column width and scrolling calculation.

Comments

The GetCalcLimit and SetCalcLimit functions define the maximum number of items to consider for optimal column width and scrolling calculation.

This function is used to define the maximum number of items to be considered when using SftTree_CalcOptimalColumnWidth, SftTree_CalcOptimalRowHeaderWidth, SftTree_MakeColumnOptimal, SftTree_MakeRowHeaderOptimal and SftTree_RecalcHorizontalExtent. The C implementation of these functions does not support the limit parameter. SetCalcLimit is not normally used with C++ as the equivalent C++ functions support limit as a parameter.

Examples

C

        {
            SFTTREE_COLORS Colors;
            SftTreeSplit_GetCtlColors(g_hwndTree, &Colors);/* Get current color settings */
            Colors.colorSelBgNoFocus = COLOR_BTNFACE | 0x80000000L;/* Selection background color (no input focus) */
            Colors.colorSelFgNoFocus = COLOR_BTNTEXT | 0x80000000L;/* Selection foreground color (no input focus) */
            SftTreeSplit_SetCtlColors(g_hwndTree, &Colors);/* Set new colors */
        }

        // In our example, we use SetCalcLimit(50) which will only consider 50 items when
        // MakeColumnOptimal, MakeRowHeaderOptimal or MakeSplitterOptimal is used.  Because our sample
        // data is wider at the end of the list, we'll change the TopIndex to the very last few items.
        // That way the last 50 items are analyzed.  In a typical application this is not necessary.
        SftTreeSplit_SetTopIndex(g_hwndTree, SftTreeSplit_GetCount(g_hwndTree) - 50);


        /* Make all column widths optimal, so text and pictures    */

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