Issue with the Toolbar buttons for TMSFNCWXHTMLMemo (WebCore)

Hi.

I am using the TMSFNCWXHTMLMemo in a WebCore project.

I create the component in run-time and set the visibility of some toolbar buttons. This was working last week (I don’t remember which FNC version was installed then), but now, I have rebuild the project with the latest version, and this behavior is broken.

This is the code I use to create the editor in run time:

(I have injected a div in the DOM with the ID 'EDT_RT')

procedure SetupRichEdit(AttribElem: TJSHTMLElement);
var DivContainer:TWebHTMLDiv;
HTMLMemo:TTMSFNCWXHTMLMemo;
begin
DivContainer:=TWebHTMLDiv.Create('EDT_RT');
HTMLMemo:=TTMSFNCWXHTMLMemo.Create(DivContainer);
HTMLMemo.Toolbar.Buttons.FontStyle.BtFontName := False;
HTMLMemo.Toolbar.Buttons.FontStyle.BtColor := False;
HTMLMemo.Toolbar.Buttons.FontStyle.BtFontSize := False;
HTMLMemo.Toolbar.Buttons.Misc.BtCodeView := True;
HTMLMemo.Parent:=DivContainer;
HTMLMemo.Left := 0;
HTMLMemo.Top := 0;
HTMLMemo.Width := 537;
HTMLMemo.Height := 303;
HTMLMemo.Align := alClient;
HTMLMemo.ParentDoubleBuffered := False;
HTMLMemo.DoubleBuffered := True;
HTMLMemo.Font.Height := -15;
HTMLMemo.Font.Name := 'Roboto';
HTMLMemo.ParentFont := false;
HTMLMemo.TabOrder := 0;
HTMLMemo.ElementHandle.style.removeProperty('position');
end;

For test purpose, I tried the following:

  • I put the component on the form in design time and set the properties for the buttons: this works.

  • Then I added a WebButton on the form and in its event, changed the visibility of some toolbar buttons. This does nothing. I guess it is the same reason than why my code is no more working.

Hi,

We can reproduce this but it’s not immediately clear where the issue comes from. There were no changes to TTMSFNCWXHTMLMemo recently that could affect initialization.

To speed up investigation, can you try to narrow this down as best as you can? Did you update FNC only or WEB Core too? For how long were you using the previous FNC version? If not an exact version number, perhaps an esimation can lead us to some clues.

Hello Tünde.

It was working for sure in the version I put on line in september 2024. We can safely assume that I was then using the actual TMS libraries (FNC as well as WebCore).

I remember though that it was important (like you can see in the code that I provided above) to set the visibility for the buttons before assigning the parent. Doing it after having the parent assigned did nothing also in that version.

Hi,

Thank you for the additional details! The reason could be toolbar related changes made right after september 2024. We applied an improvement and I sent you an incremental source update in private messages.

Can you please report back if this works as expected to you?

Hello Tünde.

Your solution works for me.

1 Like