WPCubed Product Support

Dubbing of preview and text

Hello,

i use TWPRichtext instead of TDBWPRichText.
With the following code i load data from db:

procedure TFRMMain.LoadTextFromDB;
begin
  WPRichText.BeginUpdate;
  WPRichText.Clear;
  with DMMain do
    WPRichText.AsString := qryDoc.FieldByName('document').AsString;
  WPRichText.EndUpdate;
end;

After the rearrangement the TWPPreview isn't updated any more.
At the first record change the preview is automatic updated,
at the next no more. What to do?

Thanks, Frank

#1 ♥ 0
5.6k Views 3 users read 2 min
support

Hi,

to update the data
WPRichText.AsString := qryDoc.FieldByName('document').AsString;

would be sufficent, the BeginUpdate/EndUpdate complicate things.

If it does not work then use WPPreview1.Refresh;

Julian

#2 ♥ 0

Hi, sometimes I need a wp.ReformatAll too, specially when I have underlined stuffs on my text.

#3 ♥ 0
support

Hi,

You need wp.ReformatAll after changes to the attributes of the text. Basically all changes which use procedures and properties which are not part of WPRichText but of an inner object, such as SelectedTextAttr.

Julian

#4 ♥ 0

I need ReformatAll when I do such this things:

if Sender = btnFechar then
begin

// Procura por partes ideiais para sublinhar
frmEditor.WPRichText.Finder.Clear;
frmEditor.WPRichText.Finder.ToStart;

while frmEditor.WPRichText.Finder.Next('uma parte ideal*)') do
frmEditor.WPRichText.Finder.FoundAttr.IncludeStyle(afsUnderline);

frmEditor.WPRichText.ReformatAll;

Close;

end;

#5 ♥ 0

Thx to everyone,

it was helpful and the problem is solved now.

Frank

#6 ♥ 0
This category is archived. No new posts are possible.