WPCubed Product Support

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?

#1 ♥ 0
8.8k Views 3 users read 4 min
support

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.

WPRichText1.NumberStyles.AddNumberStyle(
       wp_1, // wp_bullet, wp_circle,
             // wp_1, wp_lg_i, wp_i, wp_lg_a, wp_a,
       Before1.Text,
       After1.Text,
       '', // Font, important for bullets
       ind, // default indent
       0, // Fontsize or default
       false, // = legal numbering
       0, // group, 1 for outline numbering
       0  // level in group 1..10
     )

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

#2 ♥ 0

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?

#3 ♥ 0

Is there an answer to the last line of my previous posting?

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?

#4 ♥ 0
support

Hi,

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.

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

#5 ♥ 0

OK.

I have added this code to the OnClear event.

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

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?

#6 ♥ 0

Hello !

I have the same problem. Pressing the bullet-toolbutton create a new NumberStyle (the bad one) und use it.

#7 ♥ 0
support

Hi,

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

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