|
Controls |
Top Previous Next |
|
You can insert any Delphi/C++Builder control in the document. Style of this item type: rvsComponent (-5) Additional Properties This item type has the following specific extra integer properties:
This item type has the following properties affecting vertical position:
Vertical Position This item type has the following properties affecting vertical position:
Resizing You can allow resizing this control in editor by assigning non-zero value to its rvepResizable extra property. You can forbid mouse resizing of all images and controls in the editor by including rvoNoImageResize in EditorOptions. Resizing with mouse changes Width and Height properties of the control. Resizing is activated if this control is selected. You can select this control (for example, in its OnClick event) by calling RichView.SelectControl. OnItemResize event occurs after resizing. Methods of TCustomRichView The following viewer-style methods add item of this type to the end of the document: The following viewer-style method changes the main properties of item of this type: The following method returns main properties of the given item of this type: See also Methods of TCustomRichViewEdit The following editor-style method inserts item of this type at the position of caret: The following editor-style methods modify main properties of the item of this type: The following method returns main properties of the item of this type at the position of caret: Also Events:
Memory Usage RichView owns this control, and it will destroy it when clearing document. Do not free memory for controls inserted in RichView yourself. Do not insert the same control twice. Note about Tags of controls RichView uses tags of inserted controls (TComponent.Tag) for its own needs. Please do not use and do not modify tags of controls. (this note is about Tag property of component, not about tags of items; you can use item's tag as you wish) Saving and Loading In order to load these items from RVF, you need to register a class of the control. For example:
If rvfoSaveControlsBody is excluded from RVFOptions, control itself is not saved in RVF. When loading such RVF files, OnRVFControlNeeded event occurs. Export to text, RTF, and HTML By default, controls are not exported. Use OnSaveComponentToFile event to save controls. Printing RichView creates a temporal bitmap, draws the control in it, then prints this bitmap. It's not possible to create an universal procedure for drawing all possible controls. If you are not satisfied with the results, override the default printing with OnPrintComponent event. Special Width Mode Width of controls can be set in percent: var Item: TRVControlItemInfo; ... Item := RichView.GetItem(ItemNo) as TRVControlItemInfo; Item.PercentWidth := 50; // 50% of document width (minus paragraph indents) The effect will be after reformatting. See also... |