Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Toolbar Questions
posted
Hi guys, I have a few quick questions about the UltraToolbars and PopupMenus that I have run into the past few days.

- Currently it is possible to add a PopupMenuTool to itself or to a different menu that it contains. For example, I can add the File menu into the File menu (File > File). Also, if I add the Edit menu into the File menu (File > Edit), I can then also add the File menu into the Edit menu (Edit > File). This causes my program to go into an Infinite loop -- right now I need to check the submenu elements for availability, and with two menus containing each other I get stuck (File > Edit > File > Edit > etc..). We had tried hooking into the BeforeToolDragBegin and AfterToolDragEnd to prevent the user from creating a recursive menu, but ran into a different problem. It seems as though the AfterToolDragEnd event is not fired if the user cancels a drag (if they drop the item at a place where the icon is an X), so we have no way of knowing when the drag ends if we are preventing the menu from opening. Is there some kind of workaround for this?

- Right now when the Customize Dialog is opened, all tools on the visible toolbars are shown whether they were hidden by the user or not. Is there some way to prevent this from happening? We are running into a host of issues that are caused by the toolbars expanding and showing all icons. Our only solution at the moment is to set the SharedProps.Visible property of each hidden tool to False in order to stop them from appearing, and then re-showing them after the dialog is closed. Is there a better way of doing this? Or would it be possible to choose to open the Customize dialog without showing all hidden tools?

- Is it possible to add a tool to a toolbar with a default "bumped" state? For example, I want to add 5 tools to a toolbar but only have one shown by default. The other 4 I want to appear in the Add/Remove Tools dropdown without any user interaction. This way if the user chooses to reset the toolbar, these 4 tools will return to the "bumped" dropdown. It seems setting the Visible to false hides the buttons but they also do not appear in this dropdown. Is there some other way to do this without setting the CustomizedVisible to false each time the toolbar is reset?

Any feedback would be great!

Thanks,
Andrew Orner
Parents
No Data
Reply
  • 44743
    posted

    AndrewO said:
    Currently it is possible to add a PopupMenuTool to itself or to a different menu that it contains. For example, I can add the File menu into the File menu (File > File). Also, if I add the Edit menu into the File menu (File > Edit), I can then also add the File menu into the Edit menu (Edit > File). This causes my program to go into an Infinite loop -- right now I need to check the submenu elements for availability, and with two menus containing each other I get stuck (File > Edit > File > Edit > etc..). We had tried hooking into the BeforeToolDragBegin and AfterToolDragEnd to prevent the user from creating a recursive menu, but ran into a different problem. It seems as though the AfterToolDragEnd event is not fired if the user cancels a drag (if they drop the item at a place where the icon is an X), so we have no way of knowing when the drag ends if we are preventing the menu from opening. Is there some kind of workaround for this?

    The AfterToolDragEnd intentionally does not fire when the drag does not occur. We normally don’t fire an after event if it was cancelled, either directly or indirectly as in this case. It might be best to just remove any recursion in the AfterToolDragEnd. You can walk down each menu checking for recursion with a list of menu keys indicating the menu hierarchy. If you ever hit a duplicate menu along the way, remove it.

    AndrewO said:
    Right now when the Customize Dialog is opened, all tools on the visible toolbars are shown whether they were hidden by the user or not. Is there some way to prevent this from happening? We are running into a host of issues that are caused by the toolbars expanding and showing all icons. Our only solution at the moment is to set the SharedProps.Visible property of each hidden tool to False in order to stop them from appearing, and then re-showing them after the dialog is closed. Is there a better way of doing this? Or would it be possible to choose to open the Customize dialog without showing all hidden tools?

    The bumped tools will always be forced to display on screen when the customize dialog is opened. You can submit a feature request for a property to be able to control this: http://devcenter.infragistics.com/Protected/RequestFeature.aspx.

    AndrewO said:
    Is it possible to add a tool to a toolbar with a default "bumped" state? For example, I want to add 5 tools to a toolbar but only have one shown by default. The other 4 I want to appear in the Add/Remove Tools dropdown without any user interaction. This way if the user chooses to reset the toolbar, these 4 tools will return to the "bumped" dropdown. It seems setting the Visible to false hides the buttons but they also do not appear in this dropdown. Is there some other way to do this without setting the CustomizedVisible to false each time the toolbar is reset?

    No, you would have to manually update their CustomizedVisible properties each time the toolbar is reset, in the AfterToolbarReset event.

Children
No Data