WPCubed Product Support

How to select current style in style combo box?

I wrote my own editor using DevExpress components. In a toolbar I have a combo box where the user can select styles from all available styles.

So he can write some text and then assign a style to that paragraph by selecting a style from the combo box. Then he carries on writing and selecting a different style for the next text he wrote.

When he now places the cursor in the first text I would like to automaically select the style of that current paragraph from my style combo box. Is there an event or something I can use?

Also if the user selects a single word and hits the bold button to make the selected text bold face. If he returns with the cursor to the bold text the bold button should be selected and deselected when it is in normal text.

How do I do that?

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

Hi,

did you find this topic in the manual?

and also
Toolbar and Action Classes

and also
please open unit WPCtrRich.PAS and check out method OnToolBarIconSelection. This method is executed for all toolbar button clicks and WPTools actions. You can see how things are done. You can also call this method from "outside".

The event to update your toolbar is
OnCharacterAttrChange

Here you can read the properties in "Attribute"

Julian

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