FlexCel Studio for VCL/LCL
ContentsIndex
PreviousUpNext
TFlexCelGrid.SplitText Method

This method will take a line of text, and return a list of strings with the text word-wrapped fit inside a given cell.

Pascal
class procedure SplitText(const Workbook: TExcelFile; const ACanvas: TCanvas; const Text: UTF16String; const w: integer; var TextLines: WidestringArray; const OutRTFRuns: TRTFRunList; var RTFRuns: TRTFRunListList; var TextExtent: TSize; const Vertical: boolean; const Zoom100: extended); overload;
C++
__fastcall SplitText(const TExcelFile Workbook, const TCanvas ACanvas, const UTF16String Text, const int w, WidestringArray TextLines, const TRTFRunList OutRTFRuns, TRTFRunListList RTFRuns, TSize TextExtent, const boolean Vertical, const extended Zoom100);
Parameters 
Description 
const Workbook: TExcelFile 
The TXlsAdapter component linked to FlexCelImport
const ACanvas: TCanvas 
TCanvas where you would like to display the string. 
const Text: UTF16String 
Text you want to word-wrap. 
const w: integer 
Width (in pixels) of the cell. 
var TextLines: WidestringArray 
Return the word-wrapped text. 
const OutRTFRuns: TRTFRunList 
Rich text information for the original text. 
var RTFRuns: TRTFRunListList 
Returns the Rich text information for the wrapped text. 
var TextExtent: TSize 
Returns a box with the dimensions of the word-wrapped text. 
const Vertical: boolean 
If true, text is in vertical mode, and will be fitted one character per line. 
const Zoom100: extended 
Zoom you are using to fit in percent. Normally this will be 100. 

This method is normally for internal use, but you could have an use for it. This is what FlexCelGrid uses itself to show text when the format in the cell is "word wrap". Given the full text of the cell and the width of it, you get a list of lines as they would be once formatted.

Copyright (c) 2002-2008 TMS Software. All rights reserved.
What do you think about this topic? Send feedback!