TAdvRichEditorFormatToolBar GetButton method issue

I think I found an issue related to AdvRichEditorFormatToolBar->GetButton() method.

If the toolbar is used "as is". it works as expected (GetButton(0) returns the pointer to the Bold format one, GetButton(1) to the Italic format and so on) but if I drop a new custom button (TAdvGlowButton, for example) into the toolbar (it's added with TabOrder 22 just fyi) GetButton(0) starts its unexpected behaviour and returns the pointer to new button and not the Bold format one. GetButton(1) still returns the Italic format one.

The only way I found to access the pinter to the Bold formaty button is going through ToolBarControls property.

Just wanted to let you know.

Thanks.

I have retested this here with something like:

and GetButton() does not return the added button.
Do you use the latest version and if so, do you have more details how to reproduce this?

I'll try to reproduce the issue in a small project and i'll get back to you ...

I've uploaded a test project (C++ under Rad Studio XE3) to my GDrive. Link to download => TestProjectWin32.zip - Google Drive

Hope it helps.

The button identification is done based on a preset control.Tag value in the toolbar.
The Bold button is the first button and has Tag set to 0.
As you set Tag = 0 also for your custom button, this is the button returned. As such, set this custom button Tag property to a unique value.

Will check it. I wasn't aware that the Tag property was used in the GetButton method.