Forum Discussion

jmassey's avatar
jmassey
Contributor
9 years ago

PopupGalleryTool in Infragistics Ribbon

Hi, I'm wondering if I could get some help with this particular type of Ribbon button in an Infragistics Ribbon. I found a very similar thread, but noticed after replying that it was in the Web Testing area. Still, it sounds very likely related, even if on different platforms, and I'm running into the same kind of problem and have not found a good solution. I can add some extra info:

 

We have a Ribbon control (UltraToolbarsDockArea), and that is supported. We also have some buttons on the ribbon that, themselves, have dropdown selections. There are two types of these superficially similar buttons:

 

The first, which seems to be fully supported, is:

Infragistics.Win.UltraWinToolbars.PopupMenuTool

If I do a script recording on such a button, I get something like this:

Aliases.XYZ.UltraToolbarsDockArea.ClickItem("CAD|Print|Print|Print Preview")

This clicks the Print Preview button from the dropdown in the Print button in the Print group of the CAD tab of the ribbon.

 

The second, seemingly unsupported type, which I think is the same or similar to what the original poster in this thread was running into, is:

Infragistics.Win.UltraWinToolbars.PopupGalleryTool

If I do a script recording on this type of button (e.g., click the Circle button in the dropdown of the Linestring button in the Lines group of the CAD tab), I get this script:

Aliases.X.Y.Z.UltraToolbarsDockArea.ClickItemXY("CAD|Lines|Linestring", 37, 62)
Aliases.X.Y.DropDownForm.PopupControl.Click(64, 103)

I'll attach a couple little screenshots as well so it's easier to understand what's going on, but yeah basically if I try to address the sub-menu items of a button on the ribbon and it's the PopupMenu type, it works fine. If it's the PopupGallery type, no joy. Internally, browsing down through the Object Browser, they're both laid out in exactly the same way: Ribbon.Tabs.Item[x].Groups.Item[y].Tools.Item[z].Tools.Item[zz]

 

They do function slightly differently, however; clicking a PopupMenu type always causes the dropdown, whereas with the gallery type, the top half of the button functions as a normal button, while the bottom half causes the dropdown to open up.

If I try to just use a path on the Gallery type (e.g. ClickItem('CAD|Lines|Linestring'), that works fine, but if I try to access a submenu item like ClickItem('CAD|Lines|Linestring|Circle'), it says it cannot find the item, or if I uses indices instead of captions, that the index is out of bounds.

 

And as a sort of followup, because I suspect I'm going to find out that it's not supported - is there a way to get Object Browser to look at something like that, that disappears as soon as it loses focus? It would be very helpful.

  • SumanthKotha's avatar
    SumanthKotha
    Occasional Contributor

    Try using the below format

    Ribbon.ToolBarObj.wItems.Item("CAD").Items.Item("Lines").Items.Item("Linestring").Items.Item("Circle").Click()

    • jmassey's avatar
      jmassey
      Contributor

      Interesting - UltraToolbarsDockArea.wItems.Item["CAD"].Items.Item["Lines"].Items.Item["Linestring"].Items has 0 items. The Print ones, on the other hand, do find that last group of children when I take that approach to them (starting at UltraToolbarsDockArea.wItems instead of UltraToolbarsDockArea.ToolbarsManager.Ribbon.Tabs). Doesn't really solve my issue, heh, but at least gives a little insight into what TC might be doing.

      • SumanthKotha's avatar
        SumanthKotha
        Occasional Contributor

        Item count should not show "0". Can you try enabling all the checkboxes in the "Object Mapping -> Infragistics Controls -> UltraDropDownButton" and "Object Mapping -> Infragistics Controls -> UltraToolbarsDockArea" and spy. It should show the count.