WPCubed Product Support

Problem with TWPToolpanel buttons

I've got a toolpanel with several buttons that are tied to WP actions.

The problem is that they are being drawn with the default captions in spite of the actions having UseOwnCaption set to True. I don't want them to have captions at all so I've set all their captions to ''

It looks to me as though the problem is that the actions are all created using TWPAction.CreateStyled, which in turn calls SetStyle, which calls UpdateCaption. Now UpdateCaption has the following code :-

if not FUseOwnCaption then
  begin
    WPGetActionHintCaption(Fstyle, aCap, aHint);
    Caption := aCap;
    Hint := aHint;
  end;

Unfortunately, at this point FUseOwnCaption is false, since the properties haven't yet been loaded.

I think the correct solution is to implement the Loaded method and call UpdateCaption there.

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

Another couple of problems with toolpanel buttons :-

  1. I'm not getting a disabled state, when they should be disabled they are invisible
  2. I've got Bold, Italic and Underline buttons bound to the appropriate actions, but the buttons aren't updated appropriately as I move through the text.
#2 ♥ 0
This category is archived. No new posts are possible.