Ribbon Doesn't show addin Options correctly

I have a addin that has 4 different options to choose from on the menu.  If the user wants to use the toolbar instead they only get 3 options and 2 Flyout boxes.  The image below should have an "S" where the first flyout box is.  Same thing for just s normal toolbar it only shows "C M A"

http://i103.photobucket.com/albums/m157/HaloUmpaLumpa/Work/ToolbarIssue.jpg

I can't figure out where in the code to control this ribbon.

Below is the code i have so far.  I don't see where it's creating the ribbon or the flyout boxes for it.

<p>Public Sub AddCommandMgr()<br><br>        Dim cmdGroup As ICommandGroup<br>        Dim iBmp As New BitmapHandler<br>        Dim thisAssembly As Assembly<br><br>        Dim cmdIndex0 As Integer, cmdIndex1 As Integer, cmdIndex2 As Integer, cmdIndex3 As Integer<br>        Dim Title As String = "Material Selector"<br>        Dim ToolTip As String = "Material Selector"<br><br><br>        Dim docTypes() As Integer = {swDocumentTypes_e.swDocASSEMBLY, _<br>                                       swDocumentTypes_e.swDocDRAWING, _<br>                                       swDocumentTypes_e.swDocPART}<br><br>        thisAssembly = System.Reflection.Assembly.GetAssembly(Me.GetType())<br><br>        cmdGroup = iCmdMgr.CreateCommandGroup(1, Title, ToolTip, "", -1)<br>        cmdGroup.LargeIconList = iBmp.CreateFileFromResourceBitmap("MaterialSelector.ToolbarLarge.bmp", thisAssembly)<br>        cmdGroup.SmallIconList = iBmp.CreateFileFromResourceBitmap("MaterialSelector.CITToolbarSmall.bmp", thisAssembly)<br>        cmdGroup.LargeMainIcon = iBmp.CreateFileFromResourceBitmap("MaterialSelector.MainIconLarge.bmp", thisAssembly)<br>        cmdGroup.SmallMainIcon = iBmp.CreateFileFromResourceBitmap("MaterialSelector.MainIconSmall.bmp", thisAssembly)<br><br>        cmdIndex0 = cmdGroup.AddCommandItem2("CreatePart", 0, "Create a Part", "Create Part", 0, "CreatePart", "", 0, swCommandItemType_e.swMenuItem)<br>        cmdIndex1 = cmdGroup.AddCommandItem2("ModifyPart", 1, "Modify Currently opened part", "Modify Part", 1, "ModifyPart", "", 1, swCommandItemType_e.swMenuItem)<br>        cmdIndex2 = cmdGroup.AddCommandItem2("AssemblyUpdater", 2, "Update assembly", "Updates Currently Opened Assembly", 2, "AssemblyUpdater", "", 2, swCommandItemType_e.swMenuItem)<br>        cmdIndex3 = cmdGroup.AddCommandItem2("Setup", 3, "Setup", "Allows modifying data for a part type", 3, "ModifyData", "", 3, swCommandItemType_e.swMenuItem)<br><br>        cmdGroup.HasToolbar = True<br>        cmdGroup.HasMenu = True<br>        cmdGroup.Activate()<br><br>        For Each docType As Integer In docTypes<br>            Dim cmdTab As ICommandTab = iCmdMgr.GetCommandTab(docType, Title)<br>            Dim bResult As Boolean<br><br>            If cmdTab Is Nothing Then<br>                cmdTab = iCmdMgr.AddCommandTab(docType, Title)<br><br>                Dim cmdBox As CommandTabBox = cmdTab.AddCommandTabBox<br><br>                Dim cmdIDs(3) As Integer<br>                Dim TextType(3) As Integer<br><br>                cmdIDs(0) = cmdGroup.CommandID(cmdIndex0)<br>                TextType(0) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal<br><br>                cmdIDs(1) = cmdGroup.CommandID(cmdIndex1)<br>                TextType(1) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal<br><br>                cmdIDs(2) = cmdGroup.CommandID(cmdIndex2)<br>                TextType(2) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal<br><br>                cmdIDs(3) = cmdGroup.ToolbarId<br>                TextType(3) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal<br><br><br>                bResult = cmdBox.AddCommands(cmdIDs, TextType)<br><br>                Dim cmdBox1 As CommandTabBox = cmdTab.AddCommandTabBox()<br>                ReDim cmdIDs(1)<br>                ReDim TextType(1)<br><br>                cmdIDs(0) = cmdGroup.ToolbarId<br>                TextType(0) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextBelow<br><br>                bResult = cmdBox1.AddCommands(cmdIDs, TextType)<br><br>                cmdTab.AddSeparator(cmdBox1, cmdGroup.ToolbarId)<br>            End If<br>        Next<br><br>        thisAssembly = Nothing<br>        iBmp.Dispose()<br>    End Sub</p>

What is causing this or where should I look to start changing how this is laid out?

SolidworksApi macros
Answers 4
JC
JC 2009-08-04 Best Answer
<p> The bitmap file should contain all of the images for all of the large buttons and separators for this CommandGroup, in a single bitmap for both parent and child toolbars. Each image of each button must be 24x24. The images should use a 256-color palette. Use gray (RGB 192, 192, 192) for transparent areas in your bitmap. </p><p></p>

one pixel can break it

SF
SF 2009-08-06

The problem isn't the icons.  They show up correctly on the menu just not on the ribbon or toolbar.

The only set of icons i have changed at this point are the small toolbar icons.

Below is what the drop down menu looks like which is correct.

On the ribbon i'm looking for just these 4 options.  But i get only 3 of them and then two (Non-Functional) flyout boxes for some reason.

I'm just not seeing where this is created and if it's created from the same commands that create the drop down menu why does it show up differently.

comment imagecomment imagecomment imagecomment image
SF
SF 2009-08-06

As I understand you have 4 buttons you would like to add to command tab.

But in this code snippet the last command id is toolbar id while it should be the command ID:

                Dim cmdIDs(3) As Integer
                Dim TextType(3) As Integer

                cmdIDs(0) = cmdGroup.CommandID(cmdIndex0)
                TextType(0) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal

                cmdIDs(1) = cmdGroup.CommandID(cmdIndex1)
                TextType(1) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal

                cmdIDs(2) = cmdGroup.CommandID(cmdIndex2)
                TextType(2) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal

                cmdIDs(3) = cmdGroup.ToolbarId
                TextType(3) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal

                cmdIDs(3) = cmdGroup.CommandID(cmdIndex3)
                 TextType(3) = swCommandTabButtonTextDisplay_e.swCommandTabButton_TextHorizontal


                bResult = cmdBox.AddCommands(cmdIDs, TextType)

Use lines marked as blue instead of red ones.

JC
JC 2009-08-06

your computers Registry might be bad

go to this form and look at the anwser Update,  to see it's bad and how to fix it

https://forum.solidworks.com/message/107784#107784