Pulldown style ribbon button

Discussions concerning general integration topics.

Moderator: Phil Barton

Post Reply
dchapin
Posts: 2
Joined: Mon Apr 06, 2009 9:42 am

Pulldown style ribbon button

Post by dchapin »

I am working on an add-on and have added several buttons to my ribbon. I am trying to create a pulldown style button like the one used in the ProForm File Open button where you can select New Order or New Template. I am writing in vb. Can someone get me started or point me in the right direction?

Thanks In Advance
Dan
Hadi Chemaly

Re: Pulldown style ribbon button

Post by Hadi Chemaly »

In your package's command table file (e.g. Package.ctd), you need to set the kind attribute of your <Menu> and/or <Button> entries.

Here are the options for <Menu>: "Ribbon", "Menu", "Context", "Toolbar", "ApplicationPopup", "QuickAccess", "ButtonBar", "LatchedMenu", "ExtendedStatus". The one we use for New Order / New Template is LatchedMenu.

Here are the options for <Button>: "Button" (default), "MenuButton", "HyperLink".

You should be able to see these options via intellisense.
Dan Chapin
Posts: 1
Joined: Fri Nov 07, 2008 11:48 am

Re: Pulldown style ribbon button

Post by Dan Chapin »

Thanks Hadi, Are these documented somewhere that I missed? I would like to see what each does. Also, can you give me a vb sample of the File Open button? I am not sure of the syntax to add an item into that latchedmenu.

Thanks once again
DC
Hadi Chemaly

Re: Pulldown style ribbon button

Post by Hadi Chemaly »

I may have misunderstood your question.

What I was referring to as a "LatchedMenu" is the big New Order button that you see on the ProForm Ribbon tab. The behavior of a latched menu is that you specify commands/buttons to be added to the menu, but you also set the dominant command - in our case New Order is dominant, by giving it the lowest priority. Note that when you drop-down the latched menu, you can see a New Order and a New Template buttons.

Now based on your last comment, "I am trying to create a pulldown style button like the one used in the ProForm File Open button where you can select New Order or New Template", I believe what you are trying to do is to add an item to the Application Menu button (i.e. the application "Bubble" at the top-left of the application that has the SoftPro Select logo on it).

Before I go on to explain how to achieve that, I want to point out that command table files are xml-based, so the changes you need to make are not tied to a specific .NET language such as C# or VB.NET.

Back to the application menu entries, to add your own buttons there, you first need to reference the Select.cts file in your Package.ctd file as such:

Code: Select all

<Using alias="shell" href="C:\Program Files\SoftPro\Select SDK\Include\Select.cts" />
Then after you define your buttons (e.g. MyOpenButton), you can place aliases (or shortcuts if you will) to them anywhere in the Select UI components. For example, to place a shortcut to your button in the application menu's Open group, you would do the following:

Code: Select all

<GroupRef id="shell:OpenGroup">
  <ButtonRef id="MyOpenButton" priority="40" />
</GroupRef>
You can find more help in the SDK, especially if you take a look at the samples shipped with SoftPro Select 2.3.
dchapin
Posts: 2
Joined: Mon Apr 06, 2009 9:42 am

Re: Pulldown style ribbon button

Post by dchapin »

Hi Hadi,

Thanks for your time. You had it correct the first time. I am looking for the latchedmenu you describe. (The other example is useful also!!). I am close to "getting it", here is what I have so far:

Code: Select all

                <Menu id="ButtonMenu1" priority="10" kind="LatchedMenu" style="TextUnderneath">

                  <Group id="ButtonMenu1Group1" priority="11" style="Vertical">

                    <Button id="ButtonMenu1Sub0" kind="Button"
                          largeImage="Resources\edit-32.png"
                          smallImage="Resources\edit-16.png"
                          priority="12"
                          text="Recent Documents"
                          toolTip="Your most recent documents are listed below."
                          style="TextUnderneath"
                      />
                      <Button id="ButtonMenu1Sub1" kind="MenuButton"
                            largeImage="Resources\edit-32.png"
                            smallImage="Resources\edit-16.png"
                            priority="13"
                            text="Sample 1"
                        />
                      <Button id="ButtonMenu1Sub2" kind="MenuButton"
                            largeImage="Resources\edit-32.png"
                            smallImage="Resources\edit-16.png"
                            priority="14"
                            text="Sample 2"
                        />
                      <Button id="ButtonMenu1Sub3" kind="MenuButton"
                            largeImage="Resources\edit-32.png"
                            smallImage="Resources\edit-16.png"
                            priority="15"
                            text="Sample 3"
                        />

                    </Group>

               </Menu>
In the code here, things are VERY close to working. My issue now is that the "Dominant" comand is also appearing in the menu item list. I have moved these things around quite a bit trying to get the order just right, and know that I am close. I want the main or Dominant item, when clicked to do one thing, and each of the menu items 1,2,3 to do something else. I can add the functions for 1,2,3 but dont think I want the main button item in the submenu list.

Thanks In advance for your help.
Dan
Hadi Chemaly

Re: Pulldown style ribbon button

Post by Hadi Chemaly »

The behavior of the LatchedMenu is dictated by the 2007 MICROSOFT® OFFICE FLUENT™ USER INTERFACE DESIGN GUIDELINES, hence we also have to enforce it. The dominant menu item has to also appear in the dropped list of items.

I'm glad to see you've got your latched menu set up and working. Do let me know if you need further assistance.
Post Reply