Procedure TParagraph.ParagraphObjAdd(obj:TCustomParagraphObj)

Unit: WPRTEDefs
Class: WPRTEDefs.TParagraph

Parameters

Description

The procedure ParagraphObjAdd attaches a property object to a paragraph. Such an object is automatically freed when the paragraph is destroyed. The objects have to be derived from . The constructor requires a type id to be passed as integer. (We use type ids and not object class comparison for performance reason). You can use to remove an object use to find an object with a certain type id. You can use any type ID larger than the constant WPPAROBJ_USER.
// This example creates a property popup which // displays a panel with enclosed speed button. var par : TParagraph; obj : TWPParPopupObj; begin par := WPRichText1.FirstPar; while par<>nil do begin par.ParagraphObjClear; if par.ParagraphType=wpIsTable then begin obj := TWPParPopupObj.Create( WPPAROBJ_PopupObjTyp ); obj.Position := wrmBottomRight; obj.Width := +Panel2.Width; // - for wrmLeft ! obj.Height := Panel2.Height; obj.aControl := Panel2; par.ParagraphObjAdd( obj ); end; par := par.NextPar; end;