WPCubed Product Support

How to update WPComboBox out of WPToolbar?

I put a TWPComboBox (ComboBoxStyle = cbsColor) on form and a TWPRichText.
On create of form I did:

WPComboBox1.FRtfEdit := WPRichText1;

When I select some text and choose a color on combo the color of text change rightly, but how to update the WPComboBox with the current attribute color? I tried:

procedure TForm1.WPRichText1ChangeCursorPos(Sender: TObject);
begin
  WPComboBox1.Color := WPRichText1.CurrAttr.Color;
end;

But didn't works.
I need do the same with wpcombox to others styles (font name, font size, font back color, etc...) I need put the wpcombobox in my owner toolbar!

#1 ♥ 0
4.5k Views 1 links 2 users read 2 min
support

Hi,

a TWPComboBox can be attached to a TWPRichText using the TWPToolsCustomEditContolAction action class.

This action class is created in the ActionList and its property AttachedControl is set to the TWPComboBox instance you need to attach. The property AttachedControlStyle to select the functionality is not used for TWPComboBox - they have their own property ComboboxStyle for the same purpose.

Julian

#2 ♥ 0

Julian, I'm using your tip (TWPToolsCustomEditContolAction) but the combos not updating when moving cursor on rich with diferentes attributes

#3 ♥ 0
support

Is the action list registred in all TWPRichText with property ActionList ?

#4 ♥ 0

yes. I set wprich.actionlist property with the action that have the CustomControlEdit action!

#5 ♥ 0
support

This image should clarify the required connection:

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