WPCubed Product Support

Remove <Edit Style...> in TWPComboBox

Hi!

When using TWPComboBox to show the styles (cbsStyleNames) there also are some options like <default>, <Edit Style...> and <New Style...>. How do I do to only show the styles and not these special options?

/Fredrik

#1 ♥ 0
5.5k Views 2 users read 1 min

It looks like it's impossible to remove these special items:

In file WPPanel.pas on line 821-822:

ItemIndex := FRtfEdit.Memo.RTFData.RTFProps.ParStyles.GetStringList(
    Items, true, FRTFEdit.ActiveStyleName);

The second parameter indicates that <New Style> should be added to the combobox. This parameter is hardcoded to true. How about a property in TWPComboBox to turn off this feature?

/Fredrik

#2 ♥ 0
support

I added a prop for this, thanks for the suggestion

#3 ♥ 0

@wpsupport:
I added a prop for this, thanks for the suggestion

Thanks, that would be great.

We also use the TBX toolbar in another project and here the special items also are added. I have found this in WPAction.pas on line 541:

FControl.Memo.RTFData.RTFProps.ParStyles.GetStringList(TTBXComboBoxItem(FAttachedControl).Strings, true);

Is it possible to put a property here also?

/Fredrik

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