Selection

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

Selection

THtDocument has Selection property with the following members:

 

  // Position in element text 
  StartPos, EndPos: integer;
  CellMode, SingleTable: boolean;
  //Touch markers points
  LeftPoint, RightPoint: TPointF;
  function InSelection(const E: TElement): boolean;
  function PartiallyInSelection(const E: TElement): boolean;
  function Empty: boolean;
  function Inverted: boolean;
  function FullSelected(const E: TElement): boolean;
  function RealStartElement: TElement; 
  function RealEndElement: TElement; 
  function RealStartPos: integer;
  function RealEndPos: integer;
  function SelectedRows: integer;
  function SelectedCols: integer;
  procedure ShrinktoText;
  procedure Clear;
  procedure SelectAll;
  procedure SaveSelection;
  procedure RestoreSelection;
  procedure Invert;
    // Element containing all selected elements
  function TopElement: TElement;
  // Table Cell containing all selected elements 
  function TopCell: TElement;
  // Return selected table when selection is in CellMode and single table is selected
  function SelectedTable: TElement;
  function AtPoint(x, y: integer; out Left: boolean): boolean;
  // Return true in CellMode when E is cell of same table as Start or End element or cell outside of these tables.
  //  Used in style changing procedure to determine if style should be applied to this cell
  function IsTopSelectedCell(const E: TElement): boolean;
  function SelectedFontCount: integer;
  function FirstCell: TElement;
  function LastCell: TElement;
  function LastSelected: TElement;
  // Return selection length in visible symbols (image is treated as single symbol)</summary>
  function VisibleLength: integer;
  property AbsoluteStart: integer;
  property AbsoluteEnd: integer;
  property StartElement: TElement;
  property EndElement: TElement;
  property AllSelected: boolean;
  property Text: hstring;

 

To change selection, set StartElement, StartPos, EndElement, EndPos properties.

 

TTextElement has the following members:

 

  function SelectedText: hstring;
  function SelectedHTMLText: hstring;
  procedure SelectWordAt(CharPos: integer);
  procedure SelectPara;