Page 1 of 1

Custom Combo Button

Posted: Wed Feb 21, 2018 6:51 pm
by MattW
Is there a way to add a custom drop down button to the ribbon?
Would like something exactly like the New Order button on the ProForms tab.

Re: Custom Combo Button

Posted: Mon Feb 26, 2018 3:52 pm
by BobRichards
The fragment of the CTD file with illustration below shows how to create the stacked buttons as in the New Order buttons in the ProForm tab. CTD files are painful to work with. Make sure you get your menu/group nesting correct!
Untitled.png
Untitled.png (7 KiB) Viewed 1021 times

Code: Select all

<Commands>

    <!-- New top level tab -->
    <MenuRef id="shell:RibbonMenu">
        <Group id="RibbonTabGroup" priority="100" style="Vertical">
            <Menu id="NewRibbonTab" priority="100" text="&amp;Custom Dropdown">

                <!-- Group of all menu chunks -->
                <Group id="RibbonTabChunksGroup" priority="100" style="Horizontal">
                                        
                    <!--- Chunk: 1 -->
                    <Menu id="DDChunk" text="Chunk One" priority="10"  importance="30">
                        <Group id="CustomGroup" priority="10" style="Horizontal">
                            
                            <!-- Standalone button -->
                            <Button id="SingleL" priority="90" text="Left" largeImage="Resources\Gear_32x32.png" 
                                    smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />

                            <!-- Multi-button collection -->
                            <Menu id="ButtonsChunk" kind="LatchedMenu"  priority="100" text="Buttons" style="TextUnderneath">
                                <Group id="ButtonsGroup" priority="100" style="Vertical">
                                    <Button id="Button1" priority="100" text="Button 1" largeImage="Resources\Gear_32x32.png" 
                                            smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />
                                    <Button id="Button2" priority="200" text="Button 2" largeImage="Resources\Gear_32x32.png" 
                                            smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />
                                    <Button id="Button3" priority="300" text="Button 3" largeImage="Resources\Gear_32x32.png" 
                                            smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />
                                </Group>
                            </Menu>
                        </Group>
                    </Menu>

                    <!--- Chunk: 2  -->
                    <Menu id="DDChunk2" text="Chunk Two" priority="20" largeImage="Resources\Gear_32x32.png" importance="30">
                        <Group id="CustomGroup2" priority="10" style="Horizontal">

                            <Button id="SingleR" priority="90" text="Right" largeImage="Resources\Gear_32x32.png" 
                                    smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />
                            <Button id="SingleR2" priority="90" text="Right 2" largeImage="Resources\Gear_32x32.png"
                                    smallImage="Resources\Gear_16x16.png" style="TextUnderneath Dynamic" kind="MenuButton" />
                        </Group>
                    </Menu>

                </Group>
            </Menu>
        </Group>
    </MenuRef>

</Commands>