TTMSFMXRichEditorFormatToolBar - Events

Hello friends,

In the event of RichEditFormatToolBar component, when you set a particular event, it does not perform the action it should.
example:
If in the Event OnApplyBold I add the code:

TForm1.TMSFMXRichEditorFormatToolBar1ApplyBold procedure (Sender: TObject);
begin
   ShowMessage ('Foo');
end;

He did not set the font to bold, because in the event this way:

TTMSFMXRichEditorFormatToolBar.Bold procedure (Sender: TObject);
begin
   if Assigned (OnApplyBold) then
   begin
     OnApplyBold (Self);
     Exit;
   end;

   DoApplyBold;
end;

I wonder if this is a bug or have any explanation?

Thanks.

This is by design. The event is to override the default behavior, hence, it doesn't execute the default behavior.

Hello,

But I added to all events the same proceudre buttonClicked;

procedure TForm1.FormCreate(Sender: TObject);
begin
  TMSFMXRichEditorFormatToolBar1.OnApplyBold   := buttonClicked;
  TMSFMXRichEditorFormatToolBar1.OnApplyItalic := buttonClicked;
  ...
end;

TForm1.ButtonClicked procedure (Sender: TObject);
begin
   ClientDataSet.Edit;
end;

Do you have any suggestions for implementation?
Or how the event "OnOptionsMenuItemClick"?

Thanks.
Hello Bruno and others,

Do you have any position on my problem?
Or any suggested solution?

I temporarily commented the lines 'Exit'.
Because I need to run the default behavior and also my own behavior.

Thanks.

I don't see an easy solution as we designed the toolbar with 2 options:

1) Event handler is not used and toolbar performs the action
2) Event handler is used, meaning the user wants to perform a custom action and thus the toolbar no longer executes the default action.
I think the way the toolbar handles this is a logic way.
Maybe an option could be to add a public property with which this behavior can be altered, but that's really an exceptional custom implementation.

Ok,


And you can tell me when the component fires the event 'OnOptionsMenuItemClick'?

I found, it was not what I was thinking.