Hi,
I customized appearance and increased the height of toolbar buttons. The buttons that can't fit in the toolbar area overlap each other on the "More Buttons" dropdown menu. Is there a way to enlarge the height reserved for the buttons?
Hello Yi,
In order to assist me with helping you with this issue, could you include some more detail concerning how you customized the appearance, and what problem you are seeing with the buttons on the toolbar? Including a sample project which shows me the behavior would be ideal, and any screenshots that you could take showcasing the behavior you don't want would be helpful as well.
Hi John,
I am sorry for the delay.
I have attached a sample project. I want to enlarge the vertical space between the buttons "VARIABLE" on the overflow popup of the toolbar.
Thank you
Yi,
With your .xml I was able to reproduce the issue. The buttons with the PopupMenu are overlapping due to your drawfilter extending the rendering of the buttons beyond the rectangles of the associated elements. The element on the PopupMenu are contiguous, and thus the rendered buttons overlap. Rendering the buttons outside the bounds of the element is not recommended as hit-testing will only occur within the rectangle of the element.
While there is no property to affect the spacing of all tools on the PopupMenu, you can get the increased spacing you desire through the ImageSizeSmall property. In the attached sample, you'll see on line 185 of JDAToolbarsManager I've increased the ImageSizeSmall to 22, 22 to accommodate your buttons. In order to see this affect your buttons, you will also find on line 344 I set your buttons' ToolDisplayStyle to ImageAndText. As long as you don't assign an image to the button, no image will render on it, but it will still honor the ImageSizeSmall spacing requirements. This results in your buttons receiving their proper spacing.
Please let me know if I can be of further assistance.
Thank you so much, John! That works great.
I have other problems with the same project after enabling ToolbarSettings.AllowCustomize. I have included screenshots in the attachment with the modified project.
1) multiple buttons are displayed in one row on the PopupMenu
2) I have special background color for the first button and that color gets carried to Add or Remove Buttons popup menu. I managed to get rid of the color on the text part of the button but could not on the icon part.
In response to 1): Because the BumpedToolbar is a toolbar following the same settings as your toolbar, it will behave in the same way that the parent toolbar does. That is why it is organizing the buttons the way it is; it will fit them as it can according to their size, and since it can fit the image only buttons on the same row as the text only, it does that. There is no way to change this behavior or to force its width without creating your own toolbar and hiding ours.
The one workaround you may use to force the toolbar to create a new row for each of those buttons is to make the buttons use image and text, which will force the toolbar to reserve more space for it, and then omit the text on the button using a creation filter. It would be best to use a creation filter instead of a draw filter in that scenario in order to facilitate proper hit testing for the button.
In response to 2): The background you are still seeing is the background of the PopupMenuItemImageAreaUIElement. Therefore, it is a matter of including that type in your GetPhasesToFilter() method on line 416:
if (drawParams.Element is PopupMenuItemImageAreaUIElement)
{
phase |= DrawPhase.BeforeDrawBackColor;
}
and your DrawElement() method on line 336:
else if (drawParams.Element is PopupMenuItemImageAreaUIElement)
return true;
Please take a look at the modified sample I've attached to see how I implemented these two changes, and let me know if there is anything else I can clarify about it.
Thank you John for your help. Everything works.
Thanks John your answer was very clear for me, and help me a lot, have some overlaping info, no just buttons, and works very well now.