Hide

SftTree/DLL 7.5 - Tree Control

Display
Print

CalcOptimalCellDimensions

Calculates a cell's optimal height and width so its contents aren't truncated.

C

int WINAPI SftTree_CalcOptimalCellDimensions(HWND hwndCtl, int index, int realCol, 
        int maxAllowedWidth, LPINT lpWidth, LPINT lpHeight);
int WINAPI SftTreeSplit_CalcOptimalCellDimensions(HWND hwndCtl, int index, int realCol, 
        int maxAllowedWidth, LPINT lpWidth, LPINT lpHeight);

C++

int CSftTree::CalcOptimalCellDimensions(int index, int realCol, int maxAllowedWidth, 
        int& Width, int& Height) const;
int CSftTreeSplit::CalcOptimalCellDimensions(int index, int realCol, int maxAllowedWidth, 
        int& Width, int& Height) const;

Parameters

hwndCtl

The window handle of the tree control.

index

The zero-based index of the item, whose cell dimensions are to be calculated.

realCol

The zero-based column number of the cell.

maxAllowedWidth

Defines the maximum allowed width to consider. Specify -1 to allow the width to be optimal for the cell contents.

lpWidth, Width

Returns the calculated width, in pixels.

lpHeight, Height

Returns the calculated height, in pixels.

Returns

CalcOptimalCellDimensions returns 1- if an error occurs, 0 otherwise.

Comments

The CalcOptimalCellDimensions function calculates a cell's optimal height and width so its contents aren't truncated.

Typically, the MakeColumnOptimal function can be used instead to let the control determine the optimal column width.

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