TWPPreview - editable?

    • Offizieller Beitrag

    Q: Is it possible to edit text with the TWPPreview control

    A: Yes:

    Code
    const FInEditMode = TRUE;
    
    
     WPPreview1.Readonly := not FInEditMode;
    WPPreview1.CaretDisabled :=  WPPreview1.Readonly;
    if WPPreview1.Readonly then
            WPPreview1.ViewOptions :=  WPPreview1.ViewOptions +
    [wpHideSelection,wpCenterPaintPages]
    else WPPreview1.ViewOptions :=  WPPreview1.ViewOptions -
    [wpHideSelection,wpCenterPaintPages];

    It makes sense to do this if you need another view on the same text but do not want to use the TWPRtfDataStorage to create a central text object different editors (TWPRichText) are linked to.
    A TWPPreview is always linked to an editor - it cannot work on its own.

    Julian Ziersch