hi there
i am setting styles (boldface) on a button:
Code
procedure TForm6.Button1Click(Sender: TObject);begin wprichtext1.CurrAttr.TextStyle([afsBold], true); refreshstylelabel;end;
then i click into the wp-component, several times, and
the style "all of a sudden" gets reverted back to undefined.
i receive a OnCharacterAttrChange and in that i do a style refresh:
Code
procedure TForm6.WPRichText1CharacterAttrChange(Sender: TObject; Attribute: TWPSetModeControl);begin refreshstylelabel;end;
where refreshstylelabel is:
Code
procedure TForm6.refreshstylelabel;
var
curStyle: WrtStyle;
wStyle: WrtStyle;
begin
Label1.Caption := 'styles (curr / writing): ';
curStyle := wprichtext1.CurrAttr.Style;
if (afsBold in curStyle) then
Label1.Caption := Label1.Caption + 'bold'
else
Label1.Caption := Label1.Caption + '-';
Label1.Caption := Label1.Caption + ' / ';
wprichtext1.WritingAttr.GetStyles(wStyle);
if (afsBold in wStyle) then
Label1.Caption := Label1.Caption + 'bold'
else
Label1.Caption := Label1.Caption + '-';
end;
Alles anzeigen
is this expected and if so why?
full source: https://polypoint.egnyte.com/h-s/20111024/519d046e8fbe45b4