04 MIDAS CLASSES/GeniiRTChunk

GeniiRTChunk class
Version added: 1.00
Represents a defined chunk of a Lotus Notes rich text field.  Test  FindNamedChunk method
Containment
Contained by:  GeniiRTItem class
Properties
ImageInPixels property 
NamedType property (obsolete) 
RegularExpression property 
SetImpliedProperties property
SimpleParagraphStyle property
TargetColumn property 
TargetFrame property 
TargetNTH property
TargetRow property 

Methods
ChangeProperty method
GetTargetProperties method 
GetTableProperties method 
InsertHTML method
ZoomOnProperty method (obsolete)  


Events

Access
One of the most powerful features of the Midas Rich Text LSX is its ability to work with "chunks" of text that are defined by the developer using a simple set of keywords.  The chunk to be acted on may be anything from "Everything", which is used when the entire rich text field is to be acted on, down to a very particular chunk such as "Table 1; Row 3; Column 2; Graphic 2".   The  GeniiRTChunk class encapsulates the properties and methods available with any given chunk of rich text.  Of course, not all of these properties and methods are applicable to all chunks.  A basic rule to remember when using the  Midas Rich Text LSX is that if changing a property or calling a method on a particular chunk would be impossible, it is simply not done.  No error is raised, because this is not considered an error.  If the  CellColor property is set for a particular chunk, every cell in that chunk has its background color set, whether there are hundreds of cells or none at all.
Chunks may be defined more expansively, including more than a single object, such as "After Section 2", which is everything in the rich text field after the second section.  In addition, a chunk may be no-contiguous, meaning that a single chunk definition may refer to several parts of the rich text field which are not next to each other.  A simple example is "Table *", which refers to all tables in the rich text field, but nothing in between them.  If you were to use the  ChangeFont method to set the text to Bold on such a chunk, the text inside each table would be set to Bold, but not the text between tables.
A GeniiRTChunk object reference can be created using the  DefineChunk method of the  GeniiRTItem class , or using the  DefineSubChunk method of the  GeniiRTChunk class .  A chunk defined by the  DefineSubChunk method inherits the definition of its parent and is then defined to be more restrictive.   Note that this definition is inherited only on creation.  Once a chunk is defined, its definition is wholly its own, with no dependence on its original parent.
Usage
After defining and connecting a GeniiRTItem object, define chunks directly from that object using the  DefineChunk method .  After defining a GeniiRTChunk object, you may also further narrow its definition by defining another GeniiRTChunk object using the  DefineSubChunk method .  The primary advantage to the latter method is that you could pass a chunk into a subroutine or and define a subchunk relative to the first chunk.  Thus, you could have a function that dealt with tables.  If you passed in a GeniiRTChunk object set to some table, but it "Table 1" or "Table 5", you could simply use the  DefineSubChunk method inside the function to get the first row by defining a subchunk as "Row 1".  The chunk would wind up with a definition of  either "Table 1; Row 1" or " Table 5; Row 1", but the function wouldn't care which it was.

Example