Custom Combo Button

Discussions related to SoftPro Select user interface development.

Moderator: Phil Barton

Post Reply
MattW
Posts: 46
Joined: Tue May 26, 2015 5:17 pm

Custom Combo Button

Post 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.
BobRichards
Posts: 1376
Joined: Wed Jan 15, 2014 3:50 pm
Location: Raleigh, NC
Contact:

Re: Custom Combo Button

Post 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 963 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>
Bob Richards, Senior Software Developer, SoftPro
Post Reply