WPCubed Product Support

Next Style question

Julian

I am using a few styles. These are stored in Letter.css and are loaded when a new letter is created.

I use Futura fonts throughout. I have a Default style and a number of others.

I select a paragraph and then apply style1. I then click at the end of the paragraph and press Enter. The new paragraph does not have style1 but prints in Arial 11pt.

I have set the Default font to Futura 10pt and assumed that if I do not set a Next Style value that the Default style wold be used. Is this not the case?

Why is not the 'default' Next Style' the same as the actual style unless defined otherwise? Surely this is what a user would expect?

In case the issue is completely my fault ( ;-) ), my code to apply a style is as follows:

procedure TfrmReport.dxBarComboStylesCloseUp(Sender: TObject);
begin
  if not bMouseDown then
  begin
    RichText.TextCursor.CurrAttribute.BeginUpdate;
    RichText.TextCursor.CurrAttribute.ClearAttr(true, true);
    //RichText.CurrAttr.StyleName := dxBarComboStyles.CurText;
    dxBarComboStyles.Text := dxBarComboStyles.CurText;
    RichText.TextCursor.CurrAttribute.SetStyle(RichText.ParStyles.GetID(dxBarComboStyles.CurText));
    RichText.TextCursor.CurrAttribute.EndUpdate;
    RichText.ReformatAll(true); // Initialize because we changed the font
    RichText.Repaint;
  end;
end;

Thanks.

Rob.

#1 ♥ 0
11.4k Views 2 users read 2 min
support

Hi,

usually NextStyle works - but not when CSS is used to load/save. CSS does not have this kind of logic, only RTF styles have.

If the next style connection is esstablished the auto assignment works - just checked.

Julian

#2 ♥ 0

Thanks Julian.

But how do I use the WPStyleDlg to save and load RTF styles? I cannot see any options in the properties and the file type is 'fixed' as sty or css.

Thanks.

Rob.

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