TAdvToolbar 6.7.1.3
Delphi 10.3.3
I have a toolbar with a TAdvGlowButton on it to toggle the bullet state of a line in an editor. If the button is visible and I click it, focus remains with the editor. However, if the toolbar is too big to fit on the TAdvDockPanel, it has to be accessed via the option dropdown menu. When I click it in the option dropdown menu, it applies the bullet attribute to the line however, focus is moved to some totally unrelated control, in my case another panel.
On controls that I have access to, I can force to the focus back to the editor. However, some things like bullets is an action performed by a 3rd party control, in this case WPTools, so I cannot force focus back to the editor easily (like not use the action). I may have to contact WPTools to see if they can force focus back to the editor, but I would not think I should have to do that since focus is fine as long as the toolbar button is visible.
Is there anything you can do on your side?
We were able to reproduce this issue and this will be implemented in the following TMS VCL UI Pack update.
If possible we will store the latest focused control on opening the dropdown and when the window is closed, that control should get the focus back.
Excellent, Thanks! However, there are a couple of related issues. One is that the "ActiveControl" is also changed, and the other is that the editor's OnExit event occurs (neither of which occur when clicking a visible button). In the actions I created, I was expecting the ActiveControl to be one of two editors during the action execution. But in the dropdown selection case, it was not. I was able to program around that by saving the active editor in a variable but the editor's on exit event still occurs if I have to click the button from the dropdown. I should be able to program around that as well but if focus returns back to the editor it might be OK with the OnEnter event reoccurring.
It would be preferable to me to never have a toolbar collapse down at all but rather have an autowrap property for the TAdvDockPanel to make all toolbars wrap to fit within a dock panel (until you have one panel per dockpanel row). I could never figure out a way to make that happen. Anyone figure out how to do that with options and/or in code? The ArrangeToolBars method for the dock panel only seems to left justify toolbars, not wrap them (bad option setting on my part?)
The toolbar collapse mechanism is now modeled after how this works in Microsoft Office.
Not sure if it is desirable to have a deviating mechanism.