Change bullet and number style

  • I am using a TWPBulletDlg.

    I add a new bullet format to TWPBulletDlg and close the editor.
    I reopen and the format is lost.

    How can I make this format stay?
    How can I add formats that the users can see when first opening the dialog?
    How can I set a new default bullet for all users?

    • Offizieller Beitrag

    Hi,

    >> How can I make this format stay?
    The bullet is a property of the text. If you save the text in RTF format the bullet is saved to it.

    >> How can I add formats that the users can see when first opening the dialog?

    You can do this in code - preferably in the OnClear event.

    >>How can I set a new default bullet for all users?

    Such as in a global document template? I would say it is best to load the NumberStyles from a stream in OnClear.

    The release has a new format option usable for the WPT format:
    'WPT-AllNumberstyles'

    thgis makes sure all number styles are save to and loaded from a stream. So you can also use WPRichText.SaveToStream to create a document template.

    Regards,

    Julian Ziersch


    Regards,

    Julian Ziersch

  • The adding of new bullets is working.
    But the setting of a new bullet to be the one that is first inserted when the bullet button on the tool bar is pressed is still a problem.

    I need this to work for every new document. The users want a standard bullet across the business. I was hoping that

    rtEdit.NumberStyles.SelectedStyle := rtEdit.NumberStyles.Items[1];

    would work after loading the new bullent in the OnClear event. Is there something like this?

    We are not using a global document template. I am not sure what this means, and was unable to find a reference to it in your pdf guide "WPToolsUpgrade.pdf".

    So in summary - can I change (in code) the bullet inserted when the bullets tool bar button is clicked for the first time in a new document?

    • Offizieller Beitrag

    Hi,

    Zitat

    We are not using a global document template. I am not sure what this means, and was unable to find a reference to it in your pdf guide "WPToolsUpgrade.pdf".

    It just means a document which is loaded when the user selects "new document" from your menu. Nothing WPTools specific.

    Zitat

    So in summary - can I change (in code) the bullet inserted when the bullets tool bar button is clicked for the first time in a new document?

    I showed you some code which creates thoes bullets dynamically. Using a document which is loaded and contains those bulltes is the other options.

    Julian

  • OK.

    I have added this code to the OnClear event.

    Code
    rtEdit.NumberStyles.Clear;   rtEdit.NumberStyles.AddNumberStyle(       wp_bullet,       #183,       '',       'Symbol', // Font, important for bullets       750, // default indent       0, // Fontsize or default       false, // = legal numbering       0, // group, 1 for outline numbering       0  // level in group 1..10     );

    When I open the bullets dialog I see just the new bullet - this is good.

    But when I use the tool bar bullets button the bullet inserted into the document is the old one - this is bad.

    I need the new bullet to be inserted by default - the users do not want to have to use the bullet dialog to change formats.

    I tried to do this in the OnClear event

    Code
    rtEdit.NumberStyles.SelectedStyle := rtEdit.NumberStyles.Items[0];

    But this did not change the bullet inserted into the document.

    How can I change the bullet format first used by default in code?

    • Offizieller Beitrag

    Hi,

    Zitat

    But when I use the tool bar bullets button the bullet inserted into the document is the old one - this is bad.

    The default bullet action (you can define your own!) creates abullet style which uses the values from this global variables:

    BulletChar := #108;
    BulletIndent := 360;
    BulletFont := 'Wingdings';

    You can assign different values and use them instead.

    Julian